update Matrix Sessions handling.

This commit is contained in:
giomfo
2015-11-20 14:47:38 +01:00
parent ef28b58abb
commit 2419450531
3 changed files with 23 additions and 8 deletions
+16 -1
View File
@@ -82,7 +82,6 @@
}];
// Add each matrix session, to update the view controller appearance according to mx sessions state
// FIXME GFO We should observe added/removed matrix sessions during view controller use.
NSArray *sessions = [AppDelegate theDelegate].mxSessions;
for (MXSession *mxSession in sessions)
{
@@ -103,6 +102,22 @@
[super destroy];
}
- (void)onMatrixSessionStateDidChange:(NSNotification *)notif
{
MXSession *mxSession = notif.object;
// Check whether the concerned session is a new one which is not already associated with this view controller.
if (mxSession.state == MXSessionStateInitialised && [self.mxSessions indexOfObject:mxSession] != NSNotFound)
{
// Store this new session
[self addMatrixSession:mxSession];
}
else
{
[super onMatrixSessionStateDidChange:notif];
}
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];