Merge branch 'voip_design_updates' into voip_jitsi_remover

This commit is contained in:
ismailgulek 2021-04-28 14:03:24 +03:00
commit cf3c4ac073
No known key found for this signature in database
GPG key ID: E96336D42D9470A9
7 changed files with 33 additions and 56 deletions

View file

@ -9,7 +9,8 @@ Changes to be released in next version
* Update "Jump to unread" banner to a pill style button. * Update "Jump to unread" banner to a pill style button.
🐛 Bugfix 🐛 Bugfix
* * RoomVC: Avoid navigation to integration management using integration popup with settings set to integration disabled (#4261).
* RiotSettings: Logging out resets RiotSettings (#4259).
⚠️ API Changes ⚠️ API Changes
* *

View file

@ -85,36 +85,6 @@ final class RiotSettings: NSObject {
return userDefaults return userDefaults
}() }()
// MARK: - Public
func reset() {
defaults.removeObject(forKey: UserDefaultsKeys.settingsScreenShowChangePassword)
defaults.removeObject(forKey: UserDefaultsKeys.settingsScreenShowInviteFriends)
defaults.removeObject(forKey: UserDefaultsKeys.settingsScreenShowEnableStunServerFallback)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowSessions)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowSetupBackup)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowRestoreBackup)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowDeleteBackup)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowCryptographyInfo)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowCryptographyExport)
defaults.removeObject(forKey: UserDefaultsKeys.settingsSecurityScreenShowAdvancedUnverifiedDevices)
defaults.removeObject(forKey: UserDefaultsKeys.roomCreationScreenAllowEncryptionConfiguration)
defaults.removeObject(forKey: UserDefaultsKeys.roomCreationScreenRoomIsEncrypted)
defaults.removeObject(forKey: UserDefaultsKeys.roomCreationScreenAllowRoomTypeConfiguration)
defaults.removeObject(forKey: UserDefaultsKeys.roomCreationScreenRoomIsPublic)
defaults.removeObject(forKey: UserDefaultsKeys.allowInviteExernalUsers)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenShowLowPriorityOption)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenShowDirectChatOption)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenAllowChangingAccessSettings)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenAllowChangingHistorySettings)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenShowAddressSettings)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenShowFlairSettings)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenShowAdvancedSettings)
defaults.removeObject(forKey: UserDefaultsKeys.roomSettingsScreenAdvancedShowEncryptToVerifiedOption)
defaults.removeObject(forKey: UserDefaultsKeys.allowInviteExernalUsers)
defaults.removeObject(forKey: UserDefaultsKeys.roomsAllowToJoinPublicRooms)
}
// MARK: Servers // MARK: Servers
var homeserverUrlString: String { var homeserverUrlString: String {

View file

@ -2136,10 +2136,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
[self logoutSendingRequestServer:YES completion:^(BOOL isLoggedOut) { [self logoutSendingRequestServer:YES completion:^(BOOL isLoggedOut) {
if (completion) if (completion)
{ {
if (isLoggedOut)
{
[RiotSettings.shared reset];
}
completion (YES); completion (YES);
} }
}]; }];

View file

@ -78,18 +78,21 @@
} }
// Link to the integration manager // Link to the integration manager
alertAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"widget_picker_manage_integrations", @"Vector", nil) if (RiotSettings.shared.roomInfoScreenShowIntegrations)
style:UIAlertActionStyleDefault {
handler:^(UIAlertAction * _Nonnull action) alertAction = [UIAlertAction actionWithTitle:NSLocalizedStringFromTable(@"widget_picker_manage_integrations", @"Vector", nil)
{ style:UIAlertActionStyleDefault
IntegrationManagerViewController *modularVC = [[IntegrationManagerViewController alloc] initForMXSession:self->mxSession handler:^(UIAlertAction * _Nonnull action)
inRoom:self->roomId {
screen:kIntegrationManagerMainScreen IntegrationManagerViewController *modularVC = [[IntegrationManagerViewController alloc] initForMXSession:self->mxSession
widgetId:nil]; inRoom:self->roomId
screen:kIntegrationManagerMainScreen
widgetId:nil];
[mxkViewController presentViewController:modularVC animated:NO completion:nil]; [mxkViewController presentViewController:modularVC animated:NO completion:nil];
}]; }];
[self.alertController addAction:alertAction]; [self.alertController addAction:alertAction];
}
// Cancel // Cancel
alertAction = [UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"] alertAction = [UIAlertAction actionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"]

View file

@ -27,6 +27,11 @@ static const NSString *kJitsiDataErrorKey = @"error";
*/ */
static NSString * _Nonnull kRCTSafeAreaViewClassName = @"RCTSafeAreaView"; static NSString * _Nonnull kRCTSafeAreaViewClassName = @"RCTSafeAreaView";
/*
Some feature flags defined in https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/flags/constants.js
*/
static NSString * _Nonnull kJitsiFeatureFlagChatEnabled = @"chat.enabled";
@interface JitsiViewController () <PictureInPicturable, JitsiMeetViewDelegate> @interface JitsiViewController () <PictureInPicturable, JitsiMeetViewDelegate>
// The jitsi-meet SDK view // The jitsi-meet SDK view
@ -268,6 +273,7 @@ static NSString * _Nonnull kRCTSafeAreaViewClassName = @"RCTSafeAreaView";
andEmail:nil andEmail:nil
andAvatar:avatarUrl]; andAvatar:avatarUrl];
builder.token = self.jwtToken; builder.token = self.jwtToken;
[builder setFeatureFlag:kJitsiFeatureFlagChatEnabled withBoolean:NO];
}]; }];
[self.jitsiMeetView join:jitsiMeetConferenceOptions]; [self.jitsiMeetView join:jitsiMeetConferenceOptions];

View file

@ -1497,7 +1497,7 @@ const NSUInteger kJumpToUnreadCloseButtonTintColorForDarkMode = 0x6F7882;
UIEdgeInsets itemInsets = UIEdgeInsetsMake(0, -5, 0, 5); UIEdgeInsets itemInsets = UIEdgeInsetsMake(0, -5, 0, 5);
if (self.supportCallOption) if (self.supportCallOption)
{ {
if (self.roomDataSource.room.isDirect) if (self.roomDataSource.room.summary.membersCount.joined == 2 && self.roomDataSource.room.isDirect)
{ {
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"voice_call_hangon_icon"] style:UIBarButtonItemStylePlain target:self action:@selector(onVoiceCallPressed:)]; UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"voice_call_hangon_icon"] style:UIBarButtonItemStylePlain target:self action:@selector(onVoiceCallPressed:)];
item.accessibilityLabel = NSLocalizedStringFromTable(@"room_accessibility_call", @"Vector", nil); item.accessibilityLabel = NSLocalizedStringFromTable(@"room_accessibility_call", @"Vector", nil);
@ -1509,12 +1509,14 @@ const NSUInteger kJumpToUnreadCloseButtonTintColorForDarkMode = 0x6F7882;
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"video_call"] style:UIBarButtonItemStylePlain target:self action:@selector(onVideoCallPressed:)]; UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"video_call"] style:UIBarButtonItemStylePlain target:self action:@selector(onVideoCallPressed:)];
item.imageInsets = rightBarButtonItems.count ? UIEdgeInsetsMake(0, 10, 0, -10) : itemInsets; item.imageInsets = rightBarButtonItems.count ? UIEdgeInsetsMake(0, 10, 0, -10) : itemInsets;
item.accessibilityLabel = NSLocalizedStringFromTable(@"room_accessibility_video_call", @"Vector", nil); item.accessibilityLabel = NSLocalizedStringFromTable(@"room_accessibility_video_call", @"Vector", nil);
if (self.roomDataSource.room.isDirect) if (self.roomDataSource.room.summary.membersCount.joined == 2 && self.roomDataSource.room.isDirect)
{ {
// Matrix call
item.enabled = !self.isCallActive; item.enabled = !self.isCallActive;
} }
else else
{ {
// Jitsi call
if (self.isCallActive) if (self.isCallActive)
{ {
JitsiViewController *jitsiVC = [AppDelegate theDelegate].callPresenter.jitsiVC; JitsiViewController *jitsiVC = [AppDelegate theDelegate].callPresenter.jitsiVC;

View file

@ -64,6 +64,9 @@
// The groups data source // The groups data source
GroupsDataSource *groupsDataSource; GroupsDataSource *groupsDataSource;
// All tabs deinfed in the storyboard
NSArray *initalTabs;
} }
@property(nonatomic,getter=isHidden) BOOL hidden; @property(nonatomic,getter=isHidden) BOOL hidden;
@ -131,7 +134,7 @@
}]; }];
[self userInterfaceThemeDidChange]; [self userInterfaceThemeDidChange];
[self updateTabs]; initalTabs = [NSArray arrayWithArray:self.viewControllers];
} }
- (void)userInterfaceThemeDidChange - (void)userInterfaceThemeDidChange
@ -161,6 +164,8 @@
// Show the tab bar view controller content only when a user is logged in. // Show the tab bar view controller content only when a user is logged in.
self.hidden = ([MXKAccountManager sharedManager].accounts.count == 0); self.hidden = ([MXKAccountManager sharedManager].accounts.count == 0);
[self updateTabs];
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated
@ -884,13 +889,7 @@
- (void)updateTabs - (void)updateTabs
{ {
if (RiotSettings.shared.homeScreenShowCommunitiesTab && RiotSettings.shared.homeScreenShowRoomsTab NSMutableArray *newTabs = [NSMutableArray arrayWithArray:initalTabs];
&& RiotSettings.shared.homeScreenShowPeopleTab && RiotSettings.shared.homeScreenShowFavouritesTab)
{
return;
}
NSMutableArray *newTabs = [NSMutableArray arrayWithArray:self.viewControllers];
if (!RiotSettings.shared.homeScreenShowCommunitiesTab) if (!RiotSettings.shared.homeScreenShowCommunitiesTab)
{ {
[newTabs removeObjectAtIndex:TABBAR_GROUPS_INDEX]; [newTabs removeObjectAtIndex:TABBAR_GROUPS_INDEX];