hide "reply" and "forward" when chatPermission is missing

"forward" is also hidden because this would need bigger changes regarding the state of the hasChatPermission variable inside the ChatController.kt

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-05-10 18:08:07 +02:00
parent 96721a2df6
commit b603031011
No known key found for this signature in database
GPG key ID: C793F8B59F43CE7B
2 changed files with 4 additions and 3 deletions

View file

@ -587,7 +587,7 @@ class ChatController(args: Bundle) :
} }
} }
if (context != null) { if (context != null && hasChatPermission && !isReadOnlyConversation()) {
val messageSwipeController = MessageSwipeCallback( val messageSwipeController = MessageSwipeCallback(
activity!!, activity!!,
object : MessageSwipeActions { object : MessageSwipeActions {

View file

@ -74,7 +74,7 @@ class MessageActionsDialog(
initEmojiBar(hasChatPermission) initEmojiBar(hasChatPermission)
initMenuItemCopy(!message.isDeleted) initMenuItemCopy(!message.isDeleted)
initMenuReplyToMessage(message.replyable) initMenuReplyToMessage(message.replyable && hasChatPermission)
initMenuReplyPrivately( initMenuReplyPrivately(
message.replyable && message.replyable &&
hasUserId(user) && hasUserId(user) &&
@ -83,7 +83,8 @@ class MessageActionsDialog(
) )
initMenuDeleteMessage(showMessageDeletionButton) initMenuDeleteMessage(showMessageDeletionButton)
initMenuForwardMessage( initMenuForwardMessage(
ChatMessage.MessageType.REGULAR_TEXT_MESSAGE == message.getMessageType() && hasChatPermission &&
ChatMessage.MessageType.REGULAR_TEXT_MESSAGE == message.getMessageType() &&
!(message.isDeletedCommentMessage || message.isDeleted) !(message.isDeletedCommentMessage || message.isDeleted)
) )
initMenuMarkAsUnread( initMenuMarkAsUnread(