mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-01 18:46:11 -04:00
replace user_id with sender
This commit is contained in:
parent
97c7c34f6f
commit
c5eabe3143
4 changed files with 11 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue