[keyserver] Create a function to query for all uploads from a provided threadID
Summary:
We create a function in upload-fetchers to query the database for uploads given a specific threadID. The query uses a UNION to join two select statements, one for the photos and one for the videos. We get the necessary information for both media, and for the thumbnail data for videos, the photos are defaulted to NULL.
Depends on D6482
Test Plan:
I tested the membership permissions in two ways:
- By simulating a user who should have access to the media, navigating to the thread and confirming that the shared media is still present in the gallery.
- More importantly, to try to simulate a user who shouldn't have access to the shared media, I ran the query in TablePlus and filled in the ${viewer.id} parameter with a user who definitely should not have access to the thread media. I confirmed that the query returned 0 results, as opposed to, prior to the permissions checking, the query always returned all of the media.
Reviewers: atul, ginsu, kamil, tomek, ashoat
Reviewed By: ashoat
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D6485