On the client, we prevent non-composable message types (specifically robotext) messages from being pinned. This means only text and multimedia should be able to be pinned. In light of the urgent issues arising with source messages / inconsistency across keyserver and client, it'd be good to make sure we also cover this check directly on the server when a client requests to pin/unpin a message.
One thing to note is that with ENG-4981, one of the short term solutions was to just disable the pin action for sidebar source messages. If I can't resolve it and have to resort to the short-term solution, I'll do that in a different diff to keep this one just a 'unifying client and server logic' change.
Here, we throw a error if the target message that is trying to be pinned is not composable, matching the behavior on the client.
Depends on D9238
Part of ENG-4849