/// <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; }
/// <summary> /// Checks (light) if the list of users the user /// </summary> private void CheckUsers(Response response) { response.Users = CheckUsers().Users; }
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; }