Remove Jitsi widget info from activities view

This commit is contained in:
ismailgulek
2021-04-02 17:29:26 +03:00
parent 7d60f0955e
commit c1ecb9c016
-95
View File
@@ -4442,101 +4442,6 @@ NSNotificationName const RoomViewControllerViewDidDisappearNotification = @"Room
}
}];
}
else if (customizedRoomDataSource.roomState.isOngoingConferenceCall)
{
// Show the "Ongoing conference call" banner only if the user is not in the conference
MXCall *callInRoom = [self.roomDataSource.mxSession.callManager callInRoom:self.roomDataSource.roomId];
if (callInRoom && callInRoom.state != MXCallStateEnded)
{
if ([self checkUnsentMessages] == NO)
{
[self refreshTypingNotification];
}
}
else
{
self.activitiesViewExpanded = YES;
[roomActivitiesView displayOngoingConferenceCall:^(BOOL video) {
NSLog(@"[RoomVC] onOngoingConferenceCallPressed");
// Make sure there is not yet a call
if (![customizedRoomDataSource.mxSession.callManager callInRoom:customizedRoomDataSource.roomId])
{
[customizedRoomDataSource.room placeCallWithVideo:video success:nil failure:nil];
}
} onClosePressed:nil];
}
}
else if (jitsiWidget)
{
// The room has an active jitsi widget
// Show it in the banner if the user is not already in
LegacyAppDelegate *appDelegate = [AppDelegate theDelegate];
if ([appDelegate.callPresenter.jitsiVC.widget.widgetId isEqualToString:jitsiWidget.widgetId])
{
if ([self checkUnsentMessages] == NO)
{
[self refreshTypingNotification];
}
}
else
{
self.activitiesViewExpanded = YES;
[roomActivitiesView displayOngoingConferenceCall:^(BOOL video) {
NSLog(@"[RoomVC] onOngoingConferenceCallPressed (jitsi)");
__weak __typeof(self) weakSelf = self;
NSString *appDisplayName = [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"];
// Check app permissions first
[MXKTools checkAccessForCall:video
manualChangeMessageForAudio:[NSString stringWithFormat:[NSBundle mxk_localizedStringForKey:@"microphone_access_not_granted_for_call"], appDisplayName]
manualChangeMessageForVideo:[NSString stringWithFormat:[NSBundle mxk_localizedStringForKey:@"camera_access_not_granted_for_call"], appDisplayName]
showPopUpInViewController:self completionHandler:^(BOOL granted) {
if (weakSelf)
{
if (granted)
{
// Present the Jitsi view controller
[appDelegate.callPresenter displayJitsiCallWithWidget:jitsiWidget];
}
else
{
NSLog(@"[RoomVC] onOngoingConferenceCallPressed: Warning: The application does not have the perssion to join the call");
}
}
}];
} onClosePressed:^{
[self startActivityIndicator];
// Close the widget
__weak __typeof(self) weakSelf = self;
[[WidgetManager sharedManager] closeWidget:jitsiWidget.widgetId inRoom:self.roomDataSource.room success:^{
if (weakSelf)
{
typeof(self) self = weakSelf;
[self stopActivityIndicator];
// The banner will automatically leave thanks to kWidgetManagerDidUpdateWidgetNotification
}
} failure:^(NSError *error) {
if (weakSelf)
{
typeof(self) self = weakSelf;
[self showJitsiErrorAsAlert:error];
[self stopActivityIndicator];
}
}];
}];
}
}
else if ([self checkUnsentMessages] == NO)
{
// Show "scroll to bottom" icon when the most recent message is not visible,