mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-28 12:16:58 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user