mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge pull request #442 from matrix-org/markjh/missing_prev_content
Check whether prev_content or prev_sender is set …
This commit is contained in:
commit
6051266924
@ -354,17 +354,20 @@ class SyncRestServlet(RestServlet):
|
||||
logger.debug("Replacing %s with %s in state dict",
|
||||
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]
|
||||
else:
|
||||
result[event_key] = FrozenEvent({
|
||||
"type": timeline_event.type,
|
||||
"state_key": timeline_event.state_key,
|
||||
"content": timeline_event.unsigned['prev_content'],
|
||||
"sender": timeline_event.unsigned['prev_sender'],
|
||||
"content": prev_content,
|
||||
"sender": prev_sender,
|
||||
"event_id": prev_event_id,
|
||||
"room_id": timeline_event.room_id,
|
||||
})
|
||||
|
||||
logger.debug("New value: %r", result.get(event_key))
|
||||
|
||||
return result
|
||||
|
Loading…
Reference in New Issue
Block a user