Merge branch 'develop' into maximee/3779_fix_reply_after_jump_unread

This commit is contained in:
MaximeE
2022-02-25 15:17:01 +01:00
51 changed files with 815 additions and 385 deletions
+19 -27
View File
@@ -1066,15 +1066,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
self.jumpToLastUnreadBannerContainer.hidden = YES;
[super leaveRoomOnEvent:event];
if (self.delegate)
{
[self.delegate roomViewControllerDidLeaveRoom:self];
}
else
{
[[AppDelegate theDelegate] restoreInitialDisplay:nil];
}
[self notifyDelegateOnLeaveRoomIfNecessary];
}
// Set the input toolbar according to the current display
@@ -2201,16 +2193,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
[self.roomDataSource.room leave:^{
[self stopActivityIndicator];
// We remove the current view controller.
if (self.delegate)
{
[self.delegate roomViewControllerDidLeaveRoom:self];
}
else
{
[[AppDelegate theDelegate] restoreInitialDisplay:^{}];
}
[self notifyDelegateOnLeaveRoomIfNecessary];
} failure:^(NSError *error) {
@@ -2220,6 +2203,22 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
}];
}
- (void)notifyDelegateOnLeaveRoomIfNecessary {
if (self.delegate)
{
// Leaving room often triggers multiple events, incl local delegate callbacks as well as global notifications,
// which may lead to multiple identical UI changes (navigating to home, displaying notification etc).
// To avoid this, as soon as we notify the delegate the first time, we nilify it, preventing future messages
// from being passed along, assuming that after leaving a room there is nothing else to communicate to the delegate.
[self.delegate roomViewControllerDidLeaveRoom:self];
self.delegate = nil;
}
else
{
[[AppDelegate theDelegate] restoreInitialDisplay:^{}];
}
}
- (void)roomPreviewDidTapCancelAction
{
// Decline this invitation = leave this page
@@ -7052,14 +7051,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
- (void)roomInfoCoordinatorBridgePresenterDelegateDidLeaveRoom:(RoomInfoCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
if (self.delegate)
{
[self.delegate roomViewControllerDidLeaveRoom:self];
}
else
{
[[AppDelegate theDelegate] restoreInitialDisplay:nil];
}
[self notifyDelegateOnLeaveRoomIfNecessary];
}
#pragma mark - RemoveJitsiWidgetViewDelegate