Groups: self-management of membership of groups

- Custom the group view controllers with the blue color.

vector-im/riot-meta#114
This commit is contained in:
Giom Foret
2017-12-22 14:33:40 +01:00
parent 2a2ca1e1de
commit e12326c2dc
23 changed files with 106 additions and 80 deletions
+33 -54
View File
@@ -436,39 +436,12 @@
_selectedEventId = nil;
_selectedRoomSession = nil;
if (_currentRoomViewController)
{
// If the displayed data is not a preview, let the manager release the room data source
// (except if the view controller has the room data source ownership).
if (!_currentRoomViewController.roomPreviewData && _currentRoomViewController.roomDataSource && !_currentRoomViewController.hasRoomDataSourceOwnership)
{
MXSession *mxSession = _currentRoomViewController.roomDataSource.mxSession;
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession];
// Let the manager release live room data sources where the user is in
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:NO];
}
[_currentRoomViewController destroy];
_currentRoomViewController = nil;
}
_selectedContact = nil;
if (_currentContactDetailViewController)
{
[_currentContactDetailViewController destroy];
_currentContactDetailViewController = nil;
}
_selectedGroup = nil;
_selectedGroupSession = nil;
if (_currentGroupDetailViewController)
{
[_currentGroupDetailViewController destroy];
_currentGroupDetailViewController = nil;
}
[self releaseCurrentDetailsViewController];
}
- (void)dismissUnifiedSearch:(BOOL)animated completion:(void (^)(void))completion
@@ -516,32 +489,7 @@
{
UINavigationController *navigationController = [segue destinationViewController];
// Release existing Room view controller (if any)
if (_currentRoomViewController)
{
// If the displayed data is not a preview, let the manager release the room data source
// (except if the view controller has the room data source ownership).
if (!_currentRoomViewController.roomPreviewData && _currentRoomViewController.roomDataSource && !_currentRoomViewController.hasRoomDataSourceOwnership)
{
MXSession *mxSession = _currentRoomViewController.roomDataSource.mxSession;
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession];
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:NO];
}
[_currentRoomViewController destroy];
_currentRoomViewController = nil;
}
else if (_currentContactDetailViewController)
{
[_currentContactDetailViewController destroy];
_currentContactDetailViewController = nil;
}
else if (_currentGroupDetailViewController)
{
[_currentGroupDetailViewController destroy];
_currentGroupDetailViewController = nil;
}
[self releaseCurrentDetailsViewController];
if ([[segue identifier] isEqualToString:@"showRoomDetails"])
{
@@ -701,6 +649,37 @@
}
}
- (void)releaseCurrentDetailsViewController
{
// Release the existing details view controller (if any).
if (_currentRoomViewController)
{
// If the displayed data is not a preview, let the manager release the room data source
// (except if the view controller has the room data source ownership).
if (!_currentRoomViewController.roomPreviewData && _currentRoomViewController.roomDataSource && !_currentRoomViewController.hasRoomDataSourceOwnership)
{
MXSession *mxSession = _currentRoomViewController.roomDataSource.mxSession;
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession];
// Let the manager release live room data sources where the user is in
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:NO];
}
[_currentRoomViewController destroy];
_currentRoomViewController = nil;
}
else if (_currentContactDetailViewController)
{
[_currentContactDetailViewController destroy];
_currentContactDetailViewController = nil;
}
else if (_currentGroupDetailViewController)
{
[_currentGroupDetailViewController destroy];
_currentGroupDetailViewController = nil;
}
}
- (void)setHidden:(BOOL)hidden
{
_hidden = hidden;