HomePhabricator
Diffusion Comm 12ac24c6b7b1

[keyserver] Introduce `constructMediaFromMediaMessageContentsAndUploadRows`

Description

[keyserver] Introduce constructMediaFromMediaMessageContentsAndUploadRows

Summary:
Pull functionality out of fetchMediaFromMediaMessageContent(...) so it can be reused in rawMessageInfoFromRows(...) to reconstruct Media objects for MULTIMEDIA messages.

The difference between the two is that in fetchMediaFromMediaMessageContent(...) is we're fetching the upload rows whereas in rawMessageInfoFromRows(...) they're given to us.

In next diff we'll consume this function in rawMessageInfoFromRows to correctly pull MULTIMEDIA messages from the DB given the the content column of the message (stringified MediaMessageServerDBContent in addition to the upload rows.


Depends on D5191

Test Plan: Refactor, things continue to work as expected.

Reviewers: tomek, marcin, abosh, varun

Reviewed By: tomek

Subscribers: ashoat

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