summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-01-26 13:57:31 +0000
committerGitHub <noreply@github.com>2021-01-26 13:57:31 +0000
commitdd8da8c5f6ac525a7456437913a03f68d4504605 (patch)
treebdb8f0272ab4a4034091c9bd428ed7390bbb92d8 /synapse/handlers/federation.py
parentTry to recover from unknown encodings when previewing media. (#9164) (diff)
downloadsynapse-dd8da8c5f6ac525a7456437913a03f68d4504605.tar.xz
Precompute joined hosts and store in Redis (#9198)
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index fd8de8696d..b6dc7f99b6 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -2093,6 +2093,11 @@ class FederationHandler(BaseHandler):
         if event.type == EventTypes.GuestAccess and not context.rejected:
             await self.maybe_kick_guest_users(event)
 
+        # If we are going to send this event over federation we precaclculate
+        # the joined hosts.
+        if event.internal_metadata.get_send_on_behalf_of():
+            await self.event_creation_handler.cache_joined_hosts_for_event(event)
+
         return context
 
     async def _check_for_soft_fail(