diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-11-19 16:38:40 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-11-19 16:38:40 +0000 |
commit | c5eabe3143bc3398961ed80da041f28e545386bf (patch) | |
tree | df8ab480f1df3ddb2e05cefb741f10ed990d37fc /synapse/api/events | |
parent | Preserve logging context in a few more places, drop the logging context after... (diff) | |
download | synapse-c5eabe3143bc3398961ed80da041f28e545386bf.tar.xz |
replace user_id with sender
Diffstat (limited to 'synapse/api/events')
-rw-r--r-- | synapse/api/events/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/api/events/__init__.py b/synapse/api/events/__init__.py index 0019789dd1..a01c4a1351 100644 --- a/synapse/api/events/__init__.py +++ b/synapse/api/events/__init__.py @@ -119,7 +119,7 @@ class SynapseEvent(JsonEncodedObject): def get_pdu_json(self, time_now=None): pdu_json = self.get_full_dict() - pdu_json.pop("destination", None) + pdu_json.pop("destinations", None) pdu_json.pop("outlier", None) pdu_json.pop("replaces_state", None) pdu_json.pop("redacted", None) @@ -132,6 +132,8 @@ class SynapseEvent(JsonEncodedObject): age = time_now - pdu_json["age_ts"] pdu_json.setdefault("unsigned", {})["age"] = int(age) del pdu_json["age_ts"] + user_id = pdu_json.pop("user_id") + pdu_json["sender"] = user_id return pdu_json |