diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2023-05-05 15:06:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-05 15:06:22 +0100 |
commit | e46d5f3586025a491d11a31ce2be4c540c38d404 (patch) | |
tree | 1a0d9a7b99cf0d7a0e19143c588f4b077f559fad /synapse/storage/databases/main | |
parent | Allow running Complement integration tests via podman (#15543) (diff) | |
download | synapse-e46d5f3586025a491d11a31ce2be4c540c38d404.tar.xz |
Factor out an `is_mine_server_name` method (#15542)
Add an `is_mine_server_name` method, similar to `is_mine_id`. Ideally we would use this consistently, instead of sometimes comparing against `hs.hostname` and other times reaching into `hs.config.server.server_name`. Also fix a bug in the tests where `hs.hostname` would sometimes differ from `hs.config.server.server_name`. Signed-off-by: Sean Quah <seanq@matrix.org>
Diffstat (limited to 'synapse/storage/databases/main')
-rw-r--r-- | synapse/storage/databases/main/room.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/storage/databases/main/room.py b/synapse/storage/databases/main/room.py index dd7dbb6901..ca8be8c80d 100644 --- a/synapse/storage/databases/main/room.py +++ b/synapse/storage/databases/main/room.py @@ -996,7 +996,7 @@ class RoomWorkerStore(CacheInvalidationWorkerStore): If it is `None` media will be removed from quarantine """ logger.info("Quarantining media: %s/%s", server_name, media_id) - is_local = server_name == self.config.server.server_name + is_local = self.hs.is_mine_server_name(server_name) def _quarantine_media_by_id_txn(txn: LoggingTransaction) -> int: local_mxcs = [media_id] if is_local else [] |