mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Merge pull request #4401 from simonwiedmer/dial_pad_home
Add 'Dial pad' option to plus menu on homescreen
This commit is contained in:
commit
7718258750
2 changed files with 61 additions and 0 deletions
|
@ -8,6 +8,7 @@ Changes to be released in next version
|
||||||
* MXRoomSummary: Adapt room summary changes on MatrixSDK (#4360).
|
* MXRoomSummary: Adapt room summary changes on MatrixSDK (#4360).
|
||||||
* EncryptionKeyManager: Create keys for room last message data type.
|
* EncryptionKeyManager: Create keys for room last message data type.
|
||||||
* Integrated FLEX for debug builds.
|
* Integrated FLEX for debug builds.
|
||||||
|
* Add dial pad for PSTN capable servers to menu on homescreen
|
||||||
|
|
||||||
🐛 Bugfix
|
🐛 Bugfix
|
||||||
* RoomDirectCallStatusBubbleCell: Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403).
|
* RoomDirectCallStatusBubbleCell: Fix crash when entering a DM after a call is hung-up/rejected while being answered (#4403).
|
||||||
|
|
|
@ -72,6 +72,8 @@
|
||||||
|
|
||||||
@property (nonatomic, strong) SpaceFeatureUnavailablePresenter *spaceFeatureUnavailablePresenter;
|
@property (nonatomic, strong) SpaceFeatureUnavailablePresenter *spaceFeatureUnavailablePresenter;
|
||||||
|
|
||||||
|
@property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation RecentsViewController
|
@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"]
|
[currentAlert addAction:[UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]
|
||||||
style:UIAlertActionStyleCancel
|
style:UIAlertActionStyleCancel
|
||||||
handler:^(UIAlertAction * action) {
|
handler:^(UIAlertAction * action) {
|
||||||
|
@ -1815,6 +1835,46 @@
|
||||||
[self presentViewController:currentAlert animated:YES completion:nil];
|
[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
|
- (void)createNewRoom
|
||||||
{
|
{
|
||||||
// Sanity check
|
// Sanity check
|
||||||
|
|
Loading…
Reference in a new issue