[keyserver, lib] extract checking if message is an edit, reaction or sidebar_source
Summary:
In response to review on D7584 I am fixing a invariant message and extracting checking if message is an edit, reaction or sidebar_source.
I cannot use the assertion pattern (using invariants like in assertComposableRawMessage) because in D7584 I need to check the type, not assert it.
I cannot have a function that checks the type and returns a boolean, because then in message-fetchers in line 765 flow is not convinced that the type is correct, because the check is
done elsewhere, and it just sees that the type is RawMessageInfo, which is too broad. Same for sidebar-source-message
I don't think this is a great solution, but I didn't find a better one.
Test Plan: run flow check in keyserver/ and lib/
Reviewers: ashoat, bartek, kamil
Reviewed By: bartek
Subscribers: tomek, atul
Differential Revision: https://phab.comm.dev/D7632