diff --git a/syMessaging/syMessaging/HomeViewController.m b/syMessaging/syMessaging/HomeViewController.m index 53b0e0c58..7337ab3cf 100644 --- a/syMessaging/syMessaging/HomeViewController.m +++ b/syMessaging/syMessaging/HomeViewController.m @@ -359,6 +359,13 @@ } else { // Join the selected room [mxHandler.mxSession joinRoom:publicRoom.room_id success:^{ + // ****************** + // Presently the SDK is not able to handle correctly the context for the room recently joined + // PATCH: we force new initial sync + // FIXME: this new initial sync should be removed when SDK will fix the issue + [mxHandler forceInitialSync]; + // ****************** + // Show joined room [[AppDelegate theDelegate].masterTabBarController showRoom:publicRoom.room_id]; } failure:^(NSError *error) { diff --git a/syMessaging/syMessaging/MatrixHandler.h b/syMessaging/syMessaging/MatrixHandler.h index 595cd3385..75eb15bc6 100644 --- a/syMessaging/syMessaging/MatrixHandler.h +++ b/syMessaging/syMessaging/MatrixHandler.h @@ -36,6 +36,13 @@ - (void)logout; +// ****************** +// Presently the SDK is not able to handle correctly the context for the room recently joined +// PATCH: we define temporarily a method to force initial sync +// FIXME: this method should be removed when SDK will fix the issue +- (void)forceInitialSync; +// ****************** + - (BOOL)isAttachment:(MXEvent*)message; - (BOOL)isNotification:(MXEvent*)message; - (NSString*)displayTextFor:(MXEvent*)message inSubtitleMode:(BOOL)isSubtitle; diff --git a/syMessaging/syMessaging/MatrixHandler.m b/syMessaging/syMessaging/MatrixHandler.m index 4bc820028..05617c5a4 100644 --- a/syMessaging/syMessaging/MatrixHandler.m +++ b/syMessaging/syMessaging/MatrixHandler.m @@ -108,6 +108,17 @@ static MatrixHandler *sharedHandler = nil; self.accessToken = nil; } +// ****************** +// Presently the SDK is not able to handle correctly the context for the room recently joined +// PATCH: we define temporarily a method to force initial sync +// FIXME: this method should be removed when SDK will fix the issue +- (void)forceInitialSync { + [self closeSession]; + notifyOpenSessionFailure = NO; + [self openSession]; +} +// ****************** + - (NSString *)homeServerURL { return [[NSUserDefaults standardUserDefaults] objectForKey:@"homeserverurl"]; }