summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPaul Evans <leonerd@leonerd.org.uk>2015-12-11 15:29:27 +0000
committerPaul Evans <leonerd@leonerd.org.uk>2015-12-11 15:29:27 +0000
commite738920156edf987e8829dddad0c12ac05b77934 (patch)
tree66d1cb113e686bfffa68b9a782a6c0ec2f8ba338 /synapse
parentthrowaway 1-liner for generating password hashes (diff)
parentEnsure that the event that gets persisted is the one that was signed (diff)
downloadsynapse-e738920156edf987e8829dddad0c12ac05b77934.tar.xz
Merge pull request #433 from matrix-org/paul/tiny-fixes
Ensure that the event that gets persisted is the one that was signed
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/federation.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 2855f2d7c3..e7ad48c948 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -596,7 +596,7 @@ class FederationHandler(BaseHandler):
         handled_events = set()
 
         try:
-            new_event = self._sign_event(event)
+            event = self._sign_event(event)
             # Try the host we successfully got a response to /make_join/
             # request first.
             try:
@@ -604,7 +604,7 @@ class FederationHandler(BaseHandler):
                 target_hosts.insert(0, origin)
             except ValueError:
                 pass
-            ret = yield self.replication_layer.send_join(target_hosts, new_event)
+            ret = yield self.replication_layer.send_join(target_hosts, event)
 
             origin = ret["origin"]
             state = ret["state"]
@@ -613,12 +613,12 @@ class FederationHandler(BaseHandler):
 
             handled_events.update([s.event_id for s in state])
             handled_events.update([a.event_id for a in auth_chain])
-            handled_events.add(new_event.event_id)
+            handled_events.add(event.event_id)
 
             logger.debug("do_invite_join auth_chain: %s", auth_chain)
             logger.debug("do_invite_join state: %s", state)
 
-            logger.debug("do_invite_join event: %s", new_event)
+            logger.debug("do_invite_join event: %s", event)
 
             try:
                 yield self.store.store_room(
@@ -636,14 +636,14 @@ class FederationHandler(BaseHandler):
 
             with PreserveLoggingContext():
                 d = self.notifier.on_new_room_event(
-                    new_event, event_stream_id, max_stream_id,
+                    event, event_stream_id, max_stream_id,
                     extra_users=[joinee]
                 )
 
             def log_failure(f):
                 logger.warn(
                     "Failed to notify about %s: %s",
-                    new_event.event_id, f.value
+                    event.event_id, f.value
                 )
 
             d.addErrback(log_failure)