Correctly handle receiving 'missing' Pdus from federation, rather than just discarding them.

This commit is contained in:
Erik Johnston 2014-09-15 16:40:44 +01:00
parent e639a3516d
commit 59516a8bb1
3 changed files with 18 additions and 13 deletions

View file

@ -100,17 +100,11 @@ class FederationHandler(BaseHandler):
is_new_state = yield self.state_handler.handle_new_state(
pdu
)
if not is_new_state:
return
else:
is_new_state = False
# TODO: Implement something in federation that allows us to
# respond to PDU.
if hasattr(event, "state_key") and not is_new_state:
logger.debug("Ignoring old state: %s", event.event_id)
return
target_is_mine = False
if hasattr(event, "target_host"):
target_is_mine = event.target_host == self.hs.hostname
@ -141,7 +135,11 @@ class FederationHandler(BaseHandler):
else:
with (yield self.room_lock.lock(event.room_id)):
yield self.store.persist_event(event, backfilled)
yield self.store.persist_event(
event,
backfilled,
is_new_state=is_new_state
)
room = yield self.store.get_room(event.room_id)