chore: Do not show the user actions if the user doesn't have the necessary permissions in the channel

This commit is contained in:
Alex Jbanca 2024-02-06 11:23:19 +02:00 committed by Alex Jbanca
parent 055d8e8322
commit bf90d1bbc0
1 changed files with 7 additions and 0 deletions

View File

@ -924,6 +924,7 @@ Loader {
},
Loader {
active: !root.isInPinnedPopup && delegate.hovered && !delegate.hideQuickActions
&& root.rootStore.permissionsStore.viewAndPostCriteriaMet
visible: active
sourceComponent: StatusFlatRoundButton {
objectName: "replyToMessageButton"
@ -939,6 +940,7 @@ Loader {
},
Loader {
active: !root.isInPinnedPopup && root.isText && !root.editModeOn && root.amISender && delegate.hovered && !delegate.hideQuickActions
&& root.rootStore.permissionsStore.viewAndPostCriteriaMet
visible: active
sourceComponent: StatusFlatRoundButton {
objectName: "editMessageButton"
@ -963,6 +965,9 @@ Loader {
if(delegate.hideQuickActions)
return false;
if (!root.rootStore.permissionsStore.viewAndPostCriteriaMet)
return false;
const chatType = root.messageStore.chatType;
const pinMessageAllowedForMembers = root.messageStore.isPinMessageAllowedForMembers
@ -1025,6 +1030,8 @@ Loader {
return false;
if (delegate.hideQuickActions)
return false;
if (!root.rootStore.permissionsStore.viewAndPostCriteriaMet)
return false;
return (root.amISender || root.amIChatAdmin) &&
(messageContentType === Constants.messageContentType.messageType ||
messageContentType === Constants.messageContentType.stickerType ||