From b53707ccb1cf06ccd94f70886db385b8c182ec69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Mon, 16 Oct 2023 20:03:16 +0200 Subject: [PATCH] Fix position of message expiration selector on iPads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- NextcloudTalk/RoomInfoTableViewController.m | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/NextcloudTalk/RoomInfoTableViewController.m b/NextcloudTalk/RoomInfoTableViewController.m index ee6cffa4d..967832443 100644 --- a/NextcloudTalk/RoomInfoTableViewController.m +++ b/NextcloudTalk/RoomInfoTableViewController.m @@ -433,6 +433,17 @@ - (NSArray *)getConversationActions return [NSArray arrayWithArray:actions]; } +- (NSIndexPath *)getIndexPathForConversationAction:(ConversationAction)action +{ + NSInteger section = [self getSectionForRoomInfoSection:kRoomInfoSectionConversation]; + NSIndexPath *actionIndexPath = [NSIndexPath indexPathForRow:0 inSection:section]; + NSInteger actionRow = [[self getConversationActions] indexOfObject:[NSNumber numberWithInt:action]]; + if(NSNotFound != actionRow) { + actionIndexPath = [NSIndexPath indexPathForRow:actionRow inSection:section]; + } + return actionIndexPath; +} + - (NSArray *)getWebinarActions { NSMutableArray *actions = [[NSMutableArray alloc] init]; @@ -688,8 +699,8 @@ - (void)presentMessageExpirationSelector // Presentation on iPads optionsActionSheet.popoverPresentationController.sourceView = self.tableView; - optionsActionSheet.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:[self getIndexPathForNotificationAction:kNotificationActionChatNotifications]]; - + optionsActionSheet.popoverPresentationController.sourceRect = [self.tableView rectForRowAtIndexPath:[self getIndexPathForConversationAction:kConversationActionMessageExpiration]]; + [self presentViewController:optionsActionSheet animated:YES completion:nil]; }