Handle the case where user leaves the selected room.

This commit is contained in:
giomfo
2015-04-16 19:08:29 +02:00
parent bf3dd8e8d4
commit 96620c31ff
3 changed files with 42 additions and 83 deletions
@@ -183,15 +183,6 @@
#pragma mark - Internal methods
- (void)refreshRecentsDisplay {
// Check whether the current selected room has not been left
if (currentRoomViewController.roomDataSource.roomId) {
MXRoom *mxRoom = [[MatrixSDKHandler sharedHandler].mxSession roomWithRoomId:currentRoomViewController.roomDataSource.roomId];
if (mxRoom == nil || mxRoom.state.membership == MXMembershipLeave || mxRoom.state.membership == MXMembershipBan) {
// release the room viewController
[currentRoomViewController destroy];
currentRoomViewController = nil;
}
}
// Update the unreadCount in the title
[self updateTitleView];