store lock setting in arbitrary storage

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-11-08 14:35:09 +01:00
parent 50569a09af
commit 17e105b09c
No known key found for this signature in database
GPG key ID: F7AA2A8B65B50220

View file

@ -839,13 +839,15 @@ class ConversationInfoActivity :
binding.archiveConversationText.text = resources.getString(R.string.archive_conversation)
binding.archiveConversationTextHint.text = resources.getString(R.string.archive_hint)
}
if (ConversationUtils.isConversationReadOnlyAvailable(conversationCopy, spreedCapabilities)) {
binding.lockConversation.visibility = VISIBLE
binding.lockConversationSwitch.isChecked = databaseStorageModule!!.getBoolean("lock_switch", false)
binding.lockConversation.setOnClickListener {
val isChecked = binding.lockConversationSwitch.isChecked
binding.lockConversationSwitch.isChecked = !isChecked
val state = if (isChecked) 0 else 1
val isLocked = binding.lockConversationSwitch.isChecked
binding.lockConversationSwitch.isChecked = !isLocked
databaseStorageModule!!.saveBoolean("lock_switch", !isLocked)
val state = if (isLocked) 0 else 1
makeConversationReadOnly(conversationUser, conversationToken, state)
}
} else {