示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        public void Insert(int FromUserID, int?ToUserID, int HostID, string Message, DateTime CreatedOn, bool IsSpam, int?ChatID)
        {
            Shout item = new Shout();

            item.FromUserID = FromUserID;

            item.ToUserID = ToUserID;

            item.HostID = HostID;

            item.Message = Message;

            item.CreatedOn = CreatedOn;

            item.IsSpam = IsSpam;

            item.ChatID = ChatID;


            item.Save(UserName);
        }
        public void Insert(int FromUserID,int? ToUserID,int HostID,string Message,DateTime CreatedOn,bool IsSpam,int? ChatID)
        {
            Shout item = new Shout();

            item.FromUserID = FromUserID;

            item.ToUserID = ToUserID;

            item.HostID = HostID;

            item.Message = Message;

            item.CreatedOn = CreatedOn;

            item.IsSpam = IsSpam;

            item.ChatID = ChatID;

            item.Save(UserName);
        }