Fix public room joining by making sure replaces_state never points to itself.

This commit is contained in:
Erik Johnston 2014-12-11 15:56:01 +00:00
parent 9191292b0f
commit 0b04369238
3 changed files with 13 additions and 10 deletions

View file

@ -159,7 +159,8 @@ class StateHandler(object):
key = (event.type, event.state_key)
if key in context.current_state:
replaces = context.current_state[key]
event.unsigned["replaces_state"] = replaces.event_id
if replaces.event_id != event.event_id: # Paranoia check
event.unsigned["replaces_state"] = replaces.event_id
defer.returnValue([])