'Persist states in the database, poke the notifier and send to
interested remote servers'

@defer.inlineCallbacks
def _persist_and_notify(self, states):

    (stream_id, max_token) = (yield self.store.update_presence(states))
    parties = (yield get_interested_parties(self.store, states))
    (room_ids_to_states, users_to_states) = parties
    self.notifier.on_new_event('presence_key', stream_id, rooms=room_ids_to_states.keys(), users=[UserID.from_string(u) for u in users_to_states])
    self._push_to_remotes(states)
