HomePhabricator
Diffusion Comm 5db09ba53c31

[keyserver/lib] Dedup isMessageSidebarSourceReactionEditOrPin into…

Description

[keyserver/lib] Dedup isMessageSidebarSourceReactionEditOrPin into isInvalidSidebarSource

Summary:
As a first step of separating logic into message-specs to determine whether messages can be sidebar sources / can be pinned / etc, we should first dedup isMessageSidebarSourceReactionEditOrPin into isInvalidSidebarSource since the checks are the same.

Resolves https://linear.app/comm/issue/ENG-5206/dedup-ismessagesidebarsourcereactioneditorpin-into

Test Plan: Ran flow, confirmed using isInvalidSidebarSource in place of isMessageSidebarSourceReactionEditorPin didn't cause any regressions, and just general testing to make sure sidebars (especially with robotext) still works. Also rewrote the unit tests to be more resistant to unintentional changes to message types and ran yarn workspace lib test

Reviewers: atul, ginsu

Reviewed By: ginsu

Subscribers: ashoat, tomek

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