From 26a14ab5bddc4f4ce1b80b02b79fe986838f080d Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Fri, 11 Jun 2021 10:22:13 +0200 Subject: [PATCH 1/3] Add button to enable/disable ephemeral message feature in the chat conversations --- Classes/LinphoneCoreSettingsStore.m | 2 ++ Settings/InAppSettings.bundle/Chat.plist | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 20986dc37..4b7128750 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -344,6 +344,7 @@ [self setInteger:maxSize forKey:@"auto_download_incoming_files_max_size"]; [self setBool:[VFSUtil vfsEnabledWithGroupName:kLinphoneMsgNotificationAppGroupId] forKey:@"vfs_enabled_mode"]; [self setBool:[lm lpConfigBoolForKey:@"auto_write_to_gallery_preference" withDefault:YES] forKey:@"auto_write_to_gallery_mode"]; + [self setBool:[lm lpConfigBoolForKey:@"ephemeral_feature" withDefault:NO] forKey:@"ephemeral_feature"]; } // network section @@ -806,6 +807,7 @@ } } [lm lpConfigSetBool:[self boolForKey:@"auto_write_to_gallery_mode"] forKey:@"auto_write_to_gallery_preference"]; + [lm lpConfigSetBool:[self boolForKey:@"ephemeral_feature"] forKey:@"ephemeral_feature"]; // network section BOOL edgeOpt = [self boolForKey:@"edge_opt_preference"]; diff --git a/Settings/InAppSettings.bundle/Chat.plist b/Settings/InAppSettings.bundle/Chat.plist index d5e3c9395..a8727c126 100644 --- a/Settings/InAppSettings.bundle/Chat.plist +++ b/Settings/InAppSettings.bundle/Chat.plist @@ -60,6 +60,16 @@ IASKTextAlignment IASKUITextAlignmentRight + + DefaultValue + + Key + ephemeral_feature + Title + Enable ephemeral messages (beta) + Type + PSToggleSwitchSpecifier + Type PSGroupSpecifier From f489d4747af7c140798c0a826800ce54d23edfe6 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 14 Jun 2021 11:51:21 +0200 Subject: [PATCH 2/3] Group chat info popup menu : reload data to take into account the potential changes with the ephemeral feature being activated or not in the settings, and remove table cell separators continuing further than the actual size of the popup menu --- Classes/ChatConversationView.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index e9d92230b..251c10903 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -1573,6 +1573,8 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog _popupMenu.layer.shadowRadius = 10; _popupMenu.layer.masksToBounds = false; _toggleMenuButton.hidden = false; + _popupMenu.tableFooterView = [UIView new]; + [_popupMenu reloadData]; } -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { From d42c8d005374bff8bbd134bed58959bda0764e90 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 14 Jun 2021 16:21:29 +0200 Subject: [PATCH 3/3] Change the group chat info popup menu size to match the available features --- Classes/ChatConversationView.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 251c10903..428ee958b 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -240,6 +240,11 @@ static UICompositeViewDescription *compositeDescription = nil; completion:nil]; } [self configureForRoom:self.editing]; + + // Resize the popup table depending on wether ephemeral messages are enabled or not. + CGRect popupFrame = _popupMenu.frame; + popupFrame.size.height = 44 * [_popupMenu numberOfRowsInSection:0]; + _popupMenu.frame = popupFrame; }