Given a viewer: Viewer and mediaMessageContents: $ReadOnlyArray<MediaMessageServerDBContent, fetchMediaFromMediaMessageContent(...) will query the serverDB uploads table and return array of "reconstructed" Media.
At a high level...
- Go through each MediaMessageServerDBContent and aggregate uploadIDs
- Query the uploads table for the id, secret, type, and extra of each upload
- Go through each mediaMessageContent and construct corresponding Media by (A) pulling out information from primaryUpload and (B) pulling out information from the thumbnailUpload in the case of videos
The functionality of this function was inspired by the existing fetchMedia(...) and mediaFromRow(...) functionality in upload-fetchers.js... and will replace their usage in the non-legacy multimediaMessageCreationResponder(...)
Depends on D5063