HomePhabricator
Diffusion Comm 4deca77f34e7

[lib] Include an isPinned flag in ChatMessageInfoItem

Description

[lib] Include an isPinned flag in ChatMessageInfoItem

Summary:
Each message on the client needs to be aware if it's pinned or not - the best way I found to do this is in chat-selectors when we compose ChatMessageInfoItem. I purposely didn't include isPinned in RobotextChatMessageInfoItem since robotext messages cannot be pinned.

My main reference was @ginsu's reaction stack for this from D5811. I created a separate for (...) loop to avoid creating conditional checks in the one used for reactions, but if it'll be better to merge the two and perform different actions based on messageInfo.type, I can do that as well.

Linear: https://linear.app/comm/issue/ENG-3392/include-an-ispinned-flag-in-chatmessageinfoitem

Depends on D7148

Test Plan:
Open up a thread on web and confirm that the messages that are pinned on the server have a isPinned flag of true on the client

Database:

Screenshot 2023-03-25 at 9.35.13 AM.png (730×2 px, 181 KB)

Client:

Screenshot 2023-03-25 at 9.34.37 AM.png (950×828 px, 228 KB)

Reviewers: ginsu, atul, tomek, kuba

Reviewed By: tomek

Subscribers: kuba, ashoat, ginsu

Differential Revision: https://phab.comm.dev/D7175