To pin a message, the user has to have PinMessage
permission. Here is a list of permissions and defaults in the Permission Resources and Default Permissions sections.
Upgrading to a minimum of version 5.1.8 is recommended as this is when permission checking for pinMessages has been implemented.
Simply update and use "pin" in your messageActions.
messageActions={ ["edit", "flag", "delete", "pin"] }
To show pinned messages, you could create a custom array of messages that filters only pinned messages and pass this to the MessageList component like so:
const customMessages - [
// array of messages
];
<Chat client={client}>
<ChannelList />
<Channel>
<MessageList messages={customMessages} />
<MessageInput />
</Channel>
</Chat>;
Comments
0 comments
Please sign in to leave a comment.