'Handles new presence invites.'

@defer.inlineCallbacks
def invite_presence(self, observed_user, observer_user):

    if (not self.is_mine(observed_user)):
        raise SynapseError(400, 'User    is    not    hosted    on    this    Home    Server')
    if self.is_mine(observer_user):
        (yield self.accept_presence(observed_user, observer_user))
    else:
        self.federation.send_edu(destination=observer_user.domain, edu_type='m.presence_accept', content={'observed_user': observed_user.to_string(), 'observer_user': observer_user.to_string()})
        state_dict = (yield self.get_state(observed_user, as_event=False))
        state_dict = format_user_presence_state(state_dict, self.clock.time_msec())
        self.federation.send_edu(destination=observer_user.domain, edu_type='m.presence', content={'push': [state_dict]})
