[keyserver/lib] Set up responders, endpoints, and related functions to toggle a message pin
Summary:
Now that the function to INSERT and DELETE from MariaDB is set up, this diff handles setting up the endpoint, responder and validator, as well as the action method that'll be called via
useServerCall client-side.
To not block review while I figure out how to alert the client of a message pin, I've created a follow-up task to decide what to replace Promise<void> with: https://linear.app/comm/issue/ENG-3392/alert-the-client-of-a-message-pin-unpin
Depends on D6929
Test Plan:
The testing for both the previous diff and this diff are combined here. I tested the stack so far by doing the following:
- Finding a place to call toggleMessagePin on the client. It's not really important where I call it, just as long as the code runs, so I used the thread settings media gallery on web since it's easy to reach (just need to open the gallery).
- Log into an admin account locally.
- Call toggleMessagePin with the following parameters: {messageID: "83806", threadID: "83794", action: 'pin}. I confirm that the message was considered pinned.
- Call toggleMessagePin with the following parameters: {messageID: "83806", threadID: "83794", action: 'unpin'}. I confirm that the message was considered unpinned.
- Log into a non-admin account part of a thread
- Call toggleMessagePin and confirm that the ServerError throws
Reviewers: atul, ginsu, tomek
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D6930