summary refs log tree commit diff
path: root/synapse/events
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2017-01-05 11:41:22 +0000
committerGitHub <noreply@github.com>2017-01-05 11:41:22 +0000
commit6028718b1a7142789a0f02fad2bba26ec4d69e9a (patch)
tree0cd29eea7e4aa805c39f6a8f14acc6b09c040f0b /synapse/events
parentMerge pull request #1758 from matrix-org/markjh/fix_ban_propagation (diff)
parentOnly send events that originate on this server. (diff)
downloadsynapse-6028718b1a7142789a0f02fad2bba26ec4d69e9a.tar.xz
Merge pull request #1764 from matrix-org/markjh/fix_send_pdu
Only send events that originate on this server.
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):