mirror of
https://github.com/nextcloud/talk-android
synced 2025-02-02 20:53:09 +00:00
add check if delete message is allowed to be executed
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
cc6f582ee2
commit
7cf18923b5
@ -2513,6 +2513,15 @@ class ChatController(args: Bundle) :
|
||||
}
|
||||
|
||||
fun deleteMessage(message: IMessage?) {
|
||||
if (!AttendeePermissionsUtil(currentConversation!!.permissions)
|
||||
.canPostChatShareItemsDoReaction(conversationUser!!)
|
||||
) {
|
||||
Log.e(
|
||||
TAG, "Deletion of message is skipped because of restrictions by permissions. " +
|
||||
"This method should not have been called!"
|
||||
)
|
||||
Toast.makeText(context, R.string.nc_common_error_sorry, Toast.LENGTH_LONG).show()
|
||||
} else {
|
||||
var apiVersion = 1
|
||||
// FIXME Fix API checking with guests?
|
||||
if (conversationUser != null) {
|
||||
@ -2558,6 +2567,7 @@ class ChatController(args: Bundle) :
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun replyPrivately(message: IMessage?) {
|
||||
val apiVersion =
|
||||
|
@ -34,7 +34,7 @@ class AttendeePermissionsUtil(flag: Int) {
|
||||
if (CapabilitiesUtil.hasSpreedFeatureCapability(user, "chat-permission")) {
|
||||
return canPostChatShareItemsDoReaction
|
||||
}
|
||||
// if capability is not available the spreed version doesn't support to restrict this
|
||||
// if capability is not available then the spreed version doesn't support to restrict this
|
||||
return true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user