public void AddFriend(int friendID) { UserFriend.Insert(this.UserID, friendID, DateTime.Now); UserBR.AddUserAlertMessage(friendID, Incremental.Kick.Common.Enums.AlertMessageEnum.NewFriendRequest); UserCache.RemoveUser(this.UserID); UserCache.RemoveUser(friendID); }
public static void AddShout(User fromUser, int hostID, string message, string toUsername, int?chatID) { if (!String.IsNullOrEmpty(message) && (!fromUser.IsBanned)) { Shout shout = new Shout(); shout.HostID = hostID; shout.Message = TextHelper.EncodeAndReplaceComment(message); shout.FromUserID = fromUser.UserID; User toUser = null; if (!string.IsNullOrEmpty(toUsername)) { toUser = UserCache.GetUserByUsername(toUsername); shout.ToUserID = toUser.UserID; //record the event as an alert UserBR.AddUserAlertMessage(toUser.UserID, Incremental.Kick.Common.Enums.AlertMessageEnum.ProfileShoutComment); } if (chatID.HasValue) { shout.ChatID = chatID; } shout.Save(); if (!chatID.HasValue) { if (toUser == null) { UserAction.RecordShout(hostID, fromUser); } else { UserAction.RecordShout(hostID, fromUser, toUser); } } ShoutCache.Remove(hostID, shout.ToUserID, chatID); } }