HomePhabricator
Diffusion Comm 196ba465b204

[keyserver/lib] Introduce a new message type and spec for toggling pins

Tags
None
Referenced Files
F440873: Mixed Media (DB).png
Apr 11 2023, 9:00 AM
File Not Attached
F440872: Video (DB).png
Apr 11 2023, 9:00 AM
File Not Attached
F440871: Two Images (DB).png
Apr 11 2023, 9:00 AM
File Not Attached
F440870: One Image (DB).png
Apr 11 2023, 9:00 AM
File Not Attached
F440869: Text (DB).png
Apr 11 2023, 9:00 AM
File Not Attached
F440868: Mixed Media (Robotext).png
Apr 11 2023, 9:00 AM
File Not Attached
F440867: Video (Robotext).png
Apr 11 2023, 9:00 AM
File Not Attached
F440866: Two Images (Robotext).png
Apr 11 2023, 9:00 AM
File Not Attached
Subscribers
None

Description

[keyserver/lib] Introduce a new message type and spec for toggling pins

Summary:
Part of the way we want to alert clients that a message has been pinned / unpinned is by introducing a new message type and message spec to represent toggling a pin. I've decided to consolidate the two actions into one spec and handle the robotext / notif texts that are sent within the functions to avoid lots of duplicate code (much like update-relationship-message-spec.js). We could probably indicate a message preview like 'you pinned "This is a message to b..."', but if we want to do that I'd prefer to handle that in a later diff once the core keyserver implementation is done.

Depends on D7112

Linear: https://linear.app/comm/issue/ENG-3190/introduce-a-new-message-type-and-spec-for-toggling-pins

Test Plan:

  1. Confirmed that hasMinCodeVersion successfully works for both cases where the client should be able to see the new message type and vice versa.
  2. Ran several pin / unpin actions on a variety of messages (text, images, videos) to confirm that the robotext is as expected

Sorry for the table view, I figured it'll make it easier to see specific images

TextOne ImageTwo ImagesVideoMixed Media
Original
Text (Original).png (52×2 px, 52 KB)
One Image (Original).png (56×2 px, 48 KB)
Two Images (Original).png (50×2 px, 49 KB)
Video (Original).png (60×2 px, 69 KB)
Mixed Media (Original).png (48×2 px, 69 KB)
Robotext
Text (Robotext).png (114×1 px, 16 KB)
One Image (Robotext).png (178×1 px, 23 KB)
Two Images (Robotext).png (134×1 px, 18 KB)
Video (Robotext).png (96×1 px, 14 KB)
Mixed Media (Robotext).png (90×1 px, 44 KB)
Database
Text (DB).png (54×2 px, 66 KB)
One Image (DB).png (52×2 px, 66 KB)
Two Images (DB).png (44×2 px, 65 KB)
Video (DB).png (56×2 px, 68 KB)
Mixed Media (DB).png (70×2 px, 71 KB)

Reviewers: atul, ginsu, tomek, ashoat, kuba

Reviewed By: ashoat

Subscribers: kuba, bartek, ashoat

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