Skip to content

Commit

Permalink
prevent a user who is not a member of a community from pinning or unp…
Browse files Browse the repository at this point in the history
…inning channel messages
  • Loading branch information
jo-mut committed Jul 23, 2024
1 parent 8104da5 commit ca53173
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
(rf/dispatch [:pin-message/send-pin-message
(assoc message-data :pinned message-not-pinned?)]))))

(defn pin-or-unpin-message
[community?]
(let [able-to-send-message? (rf/sub [:chats/able-to-send-message?])]
(or able-to-send-message? (not community?))))

(defn get-actions
[{:keys [outgoing content pinned-by outgoing-status deleted? deleted-for-me? content-type
bridge-message]
Expand Down Expand Up @@ -131,7 +136,8 @@
:id :copy}])
;; pinning images are temporarily disabled
(when (and message-pin-enabled
(not= content-type constants/content-type-image))
(not= content-type constants/content-type-image)
(pin-or-unpin-message community?))
[{:type :main
:on-press #(pin-message message-data)
:label (i18n/label (if pinned-by
Expand Down

0 comments on commit ca53173

Please sign in to comment.