Skip to content

Commit

Permalink
Make GetRooms async.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Jul 23, 2013
1 parent 48dc7a3 commit 35df51a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions JabbR/Hubs/Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -346,21 +346,19 @@ public object GetShortcuts()
};
}

public IEnumerable<LobbyRoomViewModel> GetRooms()
public Task<List<LobbyRoomViewModel>> GetRooms()
{
string userId = Context.User.GetUserId();
ChatUser user = _repository.VerifyUserId(userId);

var rooms = _repository.GetAllowedRooms(user).Select(r => new LobbyRoomViewModel
return _repository.GetAllowedRooms(user).Select(r => new LobbyRoomViewModel
{
Name = r.Name,
Count = r.Users.Count(u => u.Status != (int)UserStatus.Offline),
Private = r.Private,
Closed = r.Closed,
Topic = r.Topic
}).ToList();

return rooms;
}).ToListAsync();
}

public async Task<IEnumerable<MessageViewModel>> GetPreviousMessages(string messageId)
Expand Down

0 comments on commit 35df51a

Please sign in to comment.