MasterTabBarController: Use RoomPresentationParameters and RoomPreviewPresentationParameters input parameters and selecting a room.

This commit is contained in:
SBiOSoftWhare
2021-10-12 19:10:30 +02:00
parent c741202810
commit 6bba90ecf4
2 changed files with 23 additions and 41 deletions
+9 -12
View File
@@ -584,33 +584,30 @@
}
}
- (void)selectRoomWithId:(NSString*)roomId andEventId:(NSString*)eventId inMatrixSession:(MXSession*)matrixSession
{
[self selectRoomWithId:roomId andEventId:eventId inMatrixSession:matrixSession completion:nil];
}
- (void)selectRoomWithId:(NSString*)roomId andEventId:(NSString*)eventId inMatrixSession:(MXSession*)matrixSession completion:(void (^)(void))completion
- (void)selectRoomWithParameters:(RoomPresentationParameters*)paramaters completion:(void (^)(void))completion
{
[self releaseSelectedItem];
_selectedRoomId = roomId;
_selectedEventId = eventId;
_selectedRoomSession = matrixSession;
_selectedRoomId = paramaters.roomId;
_selectedEventId = paramaters.eventId;
_selectedRoomSession = paramaters.mxSession;
[self.masterTabBarDelegate masterTabBarController:self didSelectRoomWithId:roomId andEventId:eventId inMatrixSession:matrixSession completion:completion];
[self.masterTabBarDelegate masterTabBarController:self didSelectRoomWithParameters:paramaters completion:completion];
[self refreshSelectedControllerSelectedCellIfNeeded];
}
- (void)showRoomPreview:(RoomPreviewData *)roomPreviewData
- (void)selectRoomPreviewWithParameters:(RoomPreviewPresentationParameters*)parameters completion:(void (^)(void))completion
{
[self releaseSelectedItem];
RoomPreviewData *roomPreviewData = parameters.previewData;
_selectedRoomPreviewData = roomPreviewData;
_selectedRoomId = roomPreviewData.roomId;
_selectedRoomSession = roomPreviewData.mxSession;
[self.masterTabBarDelegate masterTabBarController:self didSelectRoomPreviewWithData:roomPreviewData];
[self.masterTabBarDelegate masterTabBarController:self didSelectRoomPreviewWithParameters:parameters completion:completion];
[self refreshSelectedControllerSelectedCellIfNeeded];
}