File tree Expand file tree Collapse file tree 2 files changed +24
-20
lines changed
Sources/StreamChatSwiftUI/ChatChannel/Reactions/MessageActions Expand file tree Collapse file tree 2 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55
66### 🐞 Fixed
77- Fix visibility of tabbar when reactions are shown [ #750 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/750 )
8+ ### 🔄 Changed
9+ - Only show "Pin/Unpin message" Action if user has permission [ #749 ] ( https://github.com/GetStream/stream-chat-swiftui/pull/749 )
810
911# [ 4.72.0] ( https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.72.0 )
1012_ February 04, 2025_
Original file line number Diff line number Diff line change @@ -88,26 +88,28 @@ public extension MessageAction {
8888 messageActions. append ( replyThread)
8989 }
9090
91- if message. pinDetails != nil {
92- let unpinAction = unpinMessageAction (
93- for: message,
94- channel: channel,
95- chatClient: chatClient,
96- onFinish: onFinish,
97- onError: onError
98- )
99-
100- messageActions. append ( unpinAction)
101- } else {
102- let pinAction = pinMessageAction (
103- for: message,
104- channel: channel,
105- chatClient: chatClient,
106- onFinish: onFinish,
107- onError: onError
108- )
109-
110- messageActions. append ( pinAction)
91+ if channel. canPinMessage {
92+ if message. pinDetails != nil {
93+ let unpinAction = unpinMessageAction (
94+ for: message,
95+ channel: channel,
96+ chatClient: chatClient,
97+ onFinish: onFinish,
98+ onError: onError
99+ )
100+
101+ messageActions. append ( unpinAction)
102+ } else {
103+ let pinAction = pinMessageAction (
104+ for: message,
105+ channel: channel,
106+ chatClient: chatClient,
107+ onFinish: onFinish,
108+ onError: onError
109+ )
110+
111+ messageActions. append ( pinAction)
112+ }
111113 }
112114
113115 if !message. text. isEmpty {
You can’t perform that action at this time.
0 commit comments