Example #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);
            }
        }
Example #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);
            }
        }
Example #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);
        }
Example #5
0
 public bool Destroy(object ShoutID)
 {
     return(Shout.Destroy(ShoutID) == 1);
 }
Example #6
0
 public bool Delete(object ShoutID)
 {
     return(Shout.Delete(ShoutID) == 1);
 }