Merge branch 'develop' into remove_call_bar

This commit is contained in:
ismailgulek 2021-06-09 13:56:42 +03:00
commit c9a9685d05
No known key found for this signature in database
GPG key ID: E96336D42D9470A9
2 changed files with 61 additions and 0 deletions

View file

@ -8,6 +8,7 @@ Changes to be released in next version
* MXRoomSummary: Adapt room summary changes on MatrixSDK (#4360).
* EncryptionKeyManager: Create keys for room last message data type.
* Integrated FLEX for debug builds.
* Add dial pad for PSTN capable servers to menu on homescreen
🐛 Bugfix
* RoomDirectCallStatusBubbleCell: Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403).

View file

@ -72,6 +72,8 @@
@property (nonatomic, strong) SpaceFeatureUnavailablePresenter *spaceFeatureUnavailablePresenter;
@property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController;
@end
@implementation RecentsViewController
@ -1796,6 +1798,24 @@
}]];
if (self.mainSession.callManager.supportsPSTN)
{
[currentAlert addAction:[UIAlertAction
actionWithTitle:NSLocalizedStringFromTable(@"room_open_dialpad", @"Vector", nil)
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
if (weakSelf)
{
typeof(self) self = weakSelf;
self->currentAlert = nil;
[self openDialpad];
}
}]];
}
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * action) {
@ -1815,6 +1835,46 @@
[self presentViewController:currentAlert animated:YES completion:nil];
}
- (void)openDialpad
{
DialpadViewController *controller = [DialpadViewController instantiateWithConfiguration:[DialpadConfiguration default]];
controller.delegate = self;
self.customSizedPresentationController = [[CustomSizedPresentationController alloc] initWithPresentedViewController:controller presentingViewController:self];
self.customSizedPresentationController.dismissOnBackgroundTap = NO;
self.customSizedPresentationController.cornerRadius = 16;
controller.transitioningDelegate = self.customSizedPresentationController;
[self presentViewController:controller animated:YES completion:nil];
}
- (void)dialpadViewControllerDidTapCall:(DialpadViewController *)viewController withPhoneNumber:(NSString *)phoneNumber
{
if (self.mainSession.callManager && phoneNumber.length > 0)
{
[self startActivityIndicator];
[viewController dismissViewControllerAnimated:YES completion:^{
MXWeakify(self);
[self.mainSession.callManager placeCallAgainst:phoneNumber withVideo:NO success:^(MXCall * _Nonnull call) {
MXStrongifyAndReturnIfNil(self);
[self stopActivityIndicator];
self.customSizedPresentationController = nil;
// do nothing extra here. UI will be handled automatically by the CallService.
} failure:^(NSError * _Nullable error) {
MXStrongifyAndReturnIfNil(self);
[self stopActivityIndicator];
}];
}];
}
}
- (void)dialpadViewControllerDidTapClose:(DialpadViewController *)viewController
{
[viewController dismissViewControllerAnimated:YES completion:nil];
self.customSizedPresentationController = nil;
}
- (void)createNewRoom
{
// Sanity check