summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2017-01-05 11:26:30 +0000
committerMark Haines <mark.haines@matrix.org>2017-01-05 11:26:30 +0000
commitf784980d2b2bd3827bfef94b0360582b2ef228ba (patch)
tree0cd29eea7e4aa805c39f6a8f14acc6b09c040f0b /synapse/events
parentMerge pull request #1758 from matrix-org/markjh/fix_ban_propagation (diff)
downloadsynapse-f784980d2b2bd3827bfef94b0360582b2ef228ba.tar.xz
Only send events that originate on this server.
Or events that are sent via the federation "send_join" API.

This should match the behaviour from before v0.18.5 and #1635 landed.
Diffstat (limited to 'synapse/events')
-rw-r--r--synapse/events/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index bcb8f33a58..8c71aeb5e4 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -36,6 +36,15 @@ class _EventInternalMetadata(object):
     def is_invite_from_remote(self):
         return getattr(self, "invite_from_remote", False)
 
+    def get_send_on_behalf_of(self):
+        """Whether this server should send the event on behalf of another server.
+        This is used by the federation "send_join" API to forward the initial join
+        event for a server in the room.
+
+        returns a str with the name of the server this event is sent on behalf of.
+        """
+        return getattr(self, "get_send_on_behalf_of", None)
+
 
 def _event_dict_property(key):
     def getter(self):