HomePhabricator
Diffusion Comm e7cda98d7bb1

[keyserver/lib] Add a fetchPinnedMessages method to retrieve all pinned…

Description

[keyserver/lib] Add a fetchPinnedMessages method to retrieve all pinned messages for a thread

Summary:
For any given thread, we need to allow participants to view the pinned messages. The query checks for messages where m.pinned = 1 and translates the rows into messageInfos using an existing function. I use shimUnsupportedRawMessageInfos to prevent problems if there is a pinned message of a newer message type that an older client does not yet support.

Depends on D6930

Linear: https://linear.app/comm/issue/ENG-3186/add-a-fetchpinnedmessages-method-to-retrieve-all-pinned-messages-for-a

Test Plan:
Set three messages in the messages table to be 'pinned' and call this query and log the results. Confirm the results are as expected.

Screenshot 2023-03-20 at 6.11.30 PM.png (740×2 px, 596 KB)

Screenshot 2023-03-20 at 6.11.20 PM.png (738×1 px, 313 KB)

Reviewers: atul, ginsu, tomek, ashoat

Reviewed By: ashoat

Subscribers: ashoat

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