HomePhabricator
Diffusion Comm 50bd34ebe9dd

[keyserver] Update `sendMultimediaMsgReqInpValidator` to accept list of…

Description

[keyserver] Update sendMultimediaMsgReqInpValidator to accept list of mediaMessageContents in addition to mediaIDs

Summary:
In the past, the input to multimediaMessageCreationResponder included the threadID, localID, and mediaIDs.

mediaIDs contained the list of upload IDs for the multimedia message being created. This worked fine under the assumption that there was a 1:1 relationship between media and uploads. However, we break that assumption with video messages...

Going forward we will need to support a 1:many relationship between media and uploads. Specifically with video messages we have 2 uploads (actual video and thumbnail image) for a given video.

The problem is that we need to communicate this more complex relationship between media and uploads to the keyserver when creating a media message. The way we're going to do this is by modifying multimediaMessageCreationResponder to also accept a mediaMessageContents (of type MediaMessageServerDBContent) parameter that encodes the relationship between messages and uploads.

This diff just modifies the validator to support both types of inputs.


Depends on D4990

Test Plan: Able to send image/video messages as expected with the old parameters and "legacy" responder. AKA nothing breaks for existing flows.

Reviewers: abosh, tomek, marcin

Reviewed By: tomek

Subscribers: ashoat

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