mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 06:36:58 +02:00
Room: When a call is active, turn the call button into a hangup button
This commit is contained in:
@@ -300,6 +300,7 @@
|
||||
if ([call.room.roomId isEqualToString:customizedRoomDataSource.roomId])
|
||||
{
|
||||
[self refreshActivitiesViewDisplay];
|
||||
[self refreshRoomInputToolbar];
|
||||
}
|
||||
}];
|
||||
kMXCallManagerConferenceStartedObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXCallManagerConferenceStarted object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
@@ -316,6 +317,7 @@
|
||||
if ([roomId isEqualToString:customizedRoomDataSource.roomId])
|
||||
{
|
||||
[self refreshActivitiesViewDisplay];
|
||||
[self refreshRoomInputToolbar];
|
||||
}
|
||||
}];
|
||||
}
|
||||
@@ -894,6 +896,17 @@
|
||||
[userPictureView.layer setCornerRadius:userPictureView.frame.size.width / 2];
|
||||
userPictureView.clipsToBounds = YES;
|
||||
}
|
||||
|
||||
// Show the hangup button if there is an active call
|
||||
MXCall *callInRoom = [self.roomDataSource.mxSession.callManager callInRoom:self.roomDataSource.roomId];
|
||||
if (callInRoom && callInRoom.state != MXCallStateEnded)
|
||||
{
|
||||
roomInputToolbarView.activeCall = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
roomInputToolbarView.activeCall = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1906,6 +1919,24 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)roomInputToolbarViewHangupCall:(MXKRoomInputToolbarView *)toolbarView
|
||||
{
|
||||
RoomInputToolbarView *roomInputToolbarView = (RoomInputToolbarView*)toolbarView;
|
||||
|
||||
MXCall *callInRoom = [self.roomDataSource.mxSession.callManager callInRoom:self.roomDataSource.roomId];
|
||||
if (callInRoom)
|
||||
{
|
||||
// Go back to the call screen.
|
||||
// It will correctly manage the hide of the "back to call" banner
|
||||
[[AppDelegate theDelegate] returnToCallView];
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[callInRoom hangup];
|
||||
roomInputToolbarView.activeCall = NO;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)roomInputToolbarView:(MXKRoomInputToolbarView*)toolbarView heightDidChanged:(CGFloat)height completion:(void (^)(BOOL finished))completion
|
||||
{
|
||||
if (self.roomInputToolbarContainerHeightConstraint.constant != height)
|
||||
|
||||
Reference in New Issue
Block a user