[keyserver] Update pinnedCount when a message is pinned and unpinned
Summary:
Now that pinned_count is stored in the database, we want to trigger an update when a message is pinned or unpinned to reflect the most up to date value of how many pins are in a thread.
Linear: https://linear.app/comm/issue/ENG-3403/update-pinnedcount-when-a-message-is-pinned-and-unpinned
Depends on D7211
Test Plan:
- Trigger a ‘toggle pin’ when the media gallery is opened (for now)
- Display the threadInfo.pinnedCount somewhere visible, for the test I displayed it right by ChatThreadListItem
- Open the media gallery (to pin a message) on an admin user, and confirm the other account part of the thread receives the updated pin count
- Confirm the permissions by trying to doing the same on the non-admin account and having an invalid_credentials server error in my logs
- Validate the same, but for unpinning, where the pinned_count should decrease each time
Message Pin
Message Unpin
Reviewers: atul, ginsu, tomek, ashoat
Reviewed By: ashoat
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D7220