From b4103d2f4f69b3a93257859748ff9fc9f1be4a6c Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Tue, 27 Sep 2022 17:21:16 +0200 Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Conly=5Fsecure=5Fchatrooms?= =?UTF-8?q?=E2=80=9D=20parameter=20to=20rc.=20When=20set=20to=20=E2=80=9C1?= =?UTF-8?q?=E2=80=9D,=20only=20encrypted=20chatrooms=20can=20be=20created?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/ChatConversationCreateView.m | 17 +++++++++++------ Resources/linphonerc-factory | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Classes/ChatConversationCreateView.m b/Classes/ChatConversationCreateView.m index 41e3606b3..63712cbc5 100644 --- a/Classes/ChatConversationCreateView.m +++ b/Classes/ChatConversationCreateView.m @@ -85,6 +85,11 @@ static UICompositeViewDescription *compositeDescription = nil; _allButton.frame = frame; } + if ([LinphoneManager.instance lpConfigBoolForKey:@"only_secure_chatrooms"]) { + _chiffreOptionView.hidden = true; + _isEncrypted = true; + _tableController.isEncrypted = true; + } if (_isForVoipConference) { _switchView.hidden = true; @@ -116,14 +121,14 @@ static UICompositeViewDescription *compositeDescription = nil; frame.origin.x = self.view.frame.size.width * 0.192; } _chiffreOptionView.frame = frame; - _isEncrypted = FALSE; + _isEncrypted = [LinphoneManager.instance lpConfigBoolForKey:@"only_secure_chatrooms"]; // false by default CGRect buttonFrame = _chiffreButton.frame; - _tableController.isEncrypted = _isEncrypted; - // no encrypted by default - buttonFrame.origin.x = 2; - [_chiffreImage setImage:[UIImage imageNamed:@"security_toogle_background_grey.png"]]; - _chiffreButton.frame = buttonFrame; + if (!_isEncrypted) { + buttonFrame.origin.x = 2; + [_chiffreImage setImage:[UIImage imageNamed:@"security_toogle_background_grey.png"]]; + _chiffreButton.frame = buttonFrame; + } _waitView.hidden = YES; _backButton.hidden = IPAD; diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 5468a9c0d..0a8cc554d 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -27,6 +27,7 @@ use_callkit=1 accept_early_media=0 +only_secure_chatrooms=0 fetch_native_contacts=1 [sip]