hide reactions from menu if conversation is read-only

Fixes #1956

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-05-02 22:59:23 +02:00
parent bc0b4143e7
commit 572a212fc1
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -89,8 +89,6 @@ class MessageActionsDialog(
ChatMessage.MessageType.SYSTEM_MESSAGE != message.getMessageType() &&
BuildConfig.DEBUG
)
initEmojiMore()
}
override fun onStart() {
@ -153,7 +151,10 @@ class MessageActionsDialog(
}
private fun initEmojiBar() {
if (CapabilitiesUtil.hasSpreedFeatureCapability(user, "reactions")) {
if (CapabilitiesUtil.hasSpreedFeatureCapability(user, "reactions") &&
Conversation.ConversationReadOnlyState.CONVERSATION_READ_ONLY !=
currentConversation?.conversationReadOnlyState
) {
checkAndSetEmojiSelfReaction(dialogMessageActionsBinding.emojiThumbsUp)
dialogMessageActionsBinding.emojiThumbsUp.setOnClickListener {
sendReaction(message, dialogMessageActionsBinding.emojiThumbsUp.text.toString())
@ -182,6 +183,7 @@ class MessageActionsDialog(
dialogMessageActionsBinding.emojiMore.setOnClickListener {
dismiss()
}
initEmojiMore()
dialogMessageActionsBinding.emojiBar.visibility = View.VISIBLE
} else {
dialogMessageActionsBinding.emojiBar.visibility = View.GONE