fix displaying of message delete-button

this will fix to hide the delete-button when the message is not from the current user and the user not a moderator.
see https://nextcloud-talk.readthedocs.io/en/latest/chat/#deleting-a-chat-message

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2021-08-12 18:03:50 +02:00
parent a8f95247f4
commit 402325ffb5
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -2421,7 +2421,7 @@ class ChatController(args: Bundle) :
val isUserAllowedByPrivileges = if (message.actorId == conversationUser.userId) {
true
} else {
currentConversation!!.isParticipantOwnerOrModerator
currentConversation!!.canModerate(conversationUser)
}
if (!isUserAllowedByPrivileges) return false