synapse/storage/room.py
def quarantine_media_ids_in_room(self, room_id, quarantined_by):
        """For a room loops through all events with media and quarantines
        the associated media
        """
        def _quarantine_media_in_room_txn(txn):
            local_mxcs, remote_mxcs = self._get_media_mxcs_in_room_txn(txn, room_id)
            total_media_quarantined = 0

            # Now update all the tables to set the quarantined_by flag

            txn.executemany("""
                UPDATE local_media_repository
                SET quarantined_by = ?
                WHERE media_id = ?
            """, ((quarantined_by, media_id) for media_id in local_mxcs))

            txn.executemany(
                """
                    UPDATE remote_media_cache
                    SET quarantined_by = ?
                    WHERE media_origin = ? AND media_id = ?
                """,
                (
                    (quarantined_by, origin, media_id)
                    for origin, media_id in remote_mxcs
                )
            )

            total_media_quarantined += len(local_mxcs)
            total_media_quarantined += len(remote_mxcs)

            return total_media_quarantined

        return self.runInteraction(
            "quarantine_media_in_room",
            _quarantine_media_in_room_txn,
        )
For a room loops through all events with media and quarantines
        the associated media
        
For a room loops through all events with media and quarantines
the associated media
For a room loops through all events with media and quarantines the associated media
def quarantine_media_ids_in_room(self, room_id, quarantined_by):
        def _quarantine_media_in_room_txn(txn):
            local_mxcs, remote_mxcs = self._get_media_mxcs_in_room_txn(txn, room_id)
            total_media_quarantined = 0
            txn.executemany("""
                UPDATE local_media_repository
                SET quarantined_by = ?
                WHERE media_id = ?
            """, ((quarantined_by, media_id) for media_id in local_mxcs))
            txn.executemany(
                """
                    UPDATE remote_media_cache
                    SET quarantined_by = ?
                    WHERE media_origin = ? AND media_id = ?
                """,
                (
                    (quarantined_by, origin, media_id)
                    for origin, media_id in remote_mxcs
                )
            )
            total_media_quarantined += len(local_mxcs)
            total_media_quarantined += len(remote_mxcs)
            return total_media_quarantined
        return self.runInteraction(
            "quarantine_media_in_room",
            _quarantine_media_in_room_txn,
        )
def quarantine_media_ids_in_room ( self , room_id , quarantined_by ) : def _quarantine_media_in_room_txn ( txn ) : local_mxcs , remote_mxcs = self . _get_media_mxcs_in_room_txn ( txn , room_id ) total_media_quarantined = 0 txn . executemany ( """
                UPDATE local_media_repository
                SET quarantined_by = ?
                WHERE media_id = ?
            """ , ( ( quarantined_by , media_id ) for media_id in local_mxcs ) ) txn . executemany ( """
                    UPDATE remote_media_cache
                    SET quarantined_by = ?
                    WHERE media_origin = ? AND media_id = ?
                """ , ( ( quarantined_by , origin , media_id ) for origin , media_id in remote_mxcs ) ) total_media_quarantined += len ( local_mxcs ) total_media_quarantined += len ( remote_mxcs ) return total_media_quarantined return self . runInteraction ( "quarantine_media_in_room" , _quarantine_media_in_room_txn , )
For a room loops through all events with media and quarantines
the associated media
For a room loops through all events with media and quarantines the associated media
"""For a room loops through all events with media and quarantines
        the associated media
        """ # Now update all the tables to set the quarantined_by flag
self
room_id
quarantined_by