public ChatModelManager()
 {
     handlers           = new List <ServerHandler>();
     chatGroupList      = ChatGroupList.GetAllGroupList();
     privateMessageList = new PrivateMessageList();
     groupMessageList   = new GroupMessageList();
     databaseOnline     = true;
     cloudDatabase      = new CloudDatabase(this);
 }
 private void Init()
 {
     FunctionTypes             = new List <FunctionType>();
     account                   = new Account();
     friendList                = new FriendList();
     chatGroupList             = ChatGroupList.GetAllGroupList();
     privateMessageList        = new PrivateMessageList();
     groupMessageList          = new GroupMessageList();
     offlinePrivateMessageList = new PrivateMessageList();
     offlineGroupMessageList   = new GroupMessageList();
 }
        public GroupMessageList GetMessageByUserId(string id)
        {
            var messageList = new GroupMessageList();

            foreach (var message in MessageList)
            {
                if (ChatGroupList.GetAllGroupList().GetGroupByGroupId(message.GroupId).HasId(id))
                {
                    messageList.AddMessage(message);
                }
            }
            return(messageList);
        }
Пример #4
0
 public override bool CanRead(string userId)
 {
     return(userId == SenderId || ChatGroupList.GetAllGroupList().GetGroupByGroupId(GroupId).HasId(userId));
 }