mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Combine the prev content tests
This commit is contained in:
parent
834924248f
commit
070e28e203
@ -354,22 +354,20 @@ class SyncRestServlet(RestServlet):
|
|||||||
logger.debug("Replacing %s with %s in state dict",
|
logger.debug("Replacing %s with %s in state dict",
|
||||||
timeline_event.event_id, prev_event_id)
|
timeline_event.event_id, prev_event_id)
|
||||||
|
|
||||||
if prev_event_id is None:
|
prev_content = timeline_event.unsigned.get('prev_content')
|
||||||
|
prev_sender = timeline_event.unsigned.get('prev_sender')
|
||||||
|
if prev_event_id is None or not prev_content or not prev_sender:
|
||||||
del result[event_key]
|
del result[event_key]
|
||||||
else:
|
else:
|
||||||
prev_content = timeline_event.unsigned.get('prev_content')
|
result[event_key] = FrozenEvent({
|
||||||
prev_sender = timeline_event.unsigned.get('prev_sender')
|
"type": timeline_event.type,
|
||||||
if prev_content and prev_sender:
|
"state_key": timeline_event.state_key,
|
||||||
result[event_key] = FrozenEvent({
|
"content": prev_content,
|
||||||
"type": timeline_event.type,
|
"sender": prev_sender,
|
||||||
"state_key": timeline_event.state_key,
|
"event_id": prev_event_id,
|
||||||
"content": prev_content,
|
"room_id": timeline_event.room_id,
|
||||||
"sender": prev_sender,
|
})
|
||||||
"event_id": prev_event_id,
|
|
||||||
"room_id": timeline_event.room_id,
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
del result[event_key]
|
|
||||||
logger.debug("New value: %r", result.get(event_key))
|
logger.debug("New value: %r", result.get(event_key))
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user