예제 #1
0
        /// <summary>
        /// Checks (light) if the list of users has changed
        /// </summary>
        /// <returns></returns>
        public Response CheckUsers()
        {
            var response = new Response();

            var room = CurrentRoom;
            if (room.LastUserChange <= RoomUsersDate) return response;
            foreach (var keyValue in room.Users)
            {
                response.Users.Add(keyValue.Value);
            }

            RoomUsersDate = room.LastUserChange;
            return response;
        }
예제 #2
0
 /// <summary>
 /// Checks (light) if the list of users the user
 /// </summary>
 private void CheckUsers(Response response)
 {
     response.Users = CheckUsers().Users;
 }
예제 #3
0
        public Response CheckMessages(int lastMessage)
        {
            var response = new Response();
            SetLastActivity();

            //Get messages from the db
            var da = new ChatDataAccess();
            var messages = da.GetRoomMessages(lastMessage, RoomId);

            if (messages.Count <= 0)
                return response;

            response.Messages.AddRange(messages);
            response.LastMessageId = messages[messages.Count - 1].Id;

            CheckUsers(response);

            return response;
        }