Room preview: Show members count

This commit is contained in:
manuroe
2016-04-19 17:46:33 +02:00
parent 06b9470e43
commit 8021482056
4 changed files with 45 additions and 13 deletions
+4 -9
View File
@@ -48,22 +48,17 @@
// Make an /initialSync request to get preview data
[_mxSession.matrixRestClient initialSyncOfRoom:_roomId withLimit:0 success:^(MXRoomInitialSync *roomInitialSync) {
MXRoomState *roomState = [[MXRoomState alloc] initWithRoomId:_roomId andMatrixSession:_mxSession andDirection:YES];
_roomState = [[MXRoomState alloc] initWithRoomId:_roomId andMatrixSession:_mxSession andDirection:YES];
// Make roomState digest state events of the room
for (MXEvent *stateEvent in roomInitialSync.state)
{
// Skip members events as they are not not interesting here and can be numerous
if (stateEvent.eventType != MXEventTypeRoomMember)
{
[roomState handleStateEvent:stateEvent];
}
[_roomState handleStateEvent:stateEvent];
}
// Report retrieved data
_roomName = roomState.displayname;
_roomAvatarUrl = roomState.avatar;
_roomTopic = roomState.topic;
_roomName = _roomState.displayname;
_roomAvatarUrl = _roomState.avatar;
completion(YES);