Fixed allowEndToEndEncryptedChatWithoutPresence setting + added the same one but for group chat

This commit is contained in:
Sylvain Berfini 2024-03-27 10:16:29 +01:00
parent 238ee8dc63
commit 69b82e9954
2 changed files with 10 additions and 2 deletions

View file

@ -63,7 +63,9 @@ class ChatRoomCreationFragment : SecureFragment<ChatRoomCreationFragmentBinding>
binding.viewModel = viewModel
adapter = ContactsSelectionAdapter(viewLifecycleOwner)
adapter.setGroupChatCapabilityRequired(viewModel.createGroupChat.value == true)
adapter.setGroupChatCapabilityRequired(
viewModel.createGroupChat.value == true && !corePreferences.allowGroupChatWithoutPresence
)
adapter.setLimeCapabilityRequired(
viewModel.isEncrypted.value == true && !corePreferences.allowEndToEndEncryptedChatWithoutPresence
)
@ -96,7 +98,9 @@ class ChatRoomCreationFragment : SecureFragment<ChatRoomCreationFragmentBinding>
viewModel.isEncrypted.observe(
viewLifecycleOwner
) {
adapter.setLimeCapabilityRequired(it)
adapter.setLimeCapabilityRequired(
it && !corePreferences.allowEndToEndEncryptedChatWithoutPresence
)
}
viewModel.sipContactsSelected.observe(

View file

@ -502,6 +502,10 @@ class CorePreferences constructor(private val context: Context) {
val allowEndToEndEncryptedChatWithoutPresence: Boolean
get() = config.getBool("app", "allow_lime_friend_without_capability", false)
// Turning this ON will show the group chat button even if there is no conference capability in presence (or no presence)
val allowGroupChatWithoutPresence: Boolean
get() = config.getBool("app", "allow_group_friend_without_capability", false)
val showEmojiPickerButton: Boolean
get() = config.getBool("app", "show_emoji_picker", true)