New async [MXRoom state:]: Create async factory methods for MXKRoomDataSource

This commit is contained in:
manuroe
2018-07-20 10:43:04 +02:00
parent d1e296913e
commit 11c9284f91
7 changed files with 185 additions and 140 deletions
@@ -290,14 +290,19 @@
if (selectedSearchEvent)
{
RoomViewController *roomViewController = segue.destinationViewController;
RoomDataSource *roomDataSource = [[RoomDataSource alloc] initWithRoomId:selectedSearchEvent.roomId initialEventId:selectedSearchEvent.eventId andMatrixSession:selectedSearchEventSession];
[roomDataSource finalizeInitialization];
roomDataSource.markTimelineInitialEvent = YES;
[roomViewController displayRoom:roomDataSource];
roomViewController.hasRoomDataSourceOwnership = YES;
roomViewController.navigationItem.leftItemsSupplementBackButton = YES;
[RoomDataSource loadRoomDataSourceWithRoomId:selectedSearchEvent.roomId
initialEventId:selectedSearchEvent.eventId
andMatrixSession:selectedSearchEventSession onComplete:^(RoomDataSource *roomDataSource) {
[roomDataSource finalizeInitialization];
roomDataSource.markTimelineInitialEvent = YES;
[roomViewController displayRoom:roomDataSource];
roomViewController.hasRoomDataSourceOwnership = YES;
roomViewController.navigationItem.leftItemsSupplementBackButton = YES;
}];
}
// Hide back button title