mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Implement invite part of invite join dance
This commit is contained in:
parent
328dab2463
commit
d2fb2b8095
4 changed files with 74 additions and 21 deletions
|
@ -56,7 +56,8 @@ class BaseHandler(object):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def _on_new_room_event(self, event, snapshot, extra_destinations=[],
|
||||
extra_users=[], suppress_auth=False):
|
||||
extra_users=[], suppress_auth=False,
|
||||
do_invite_host=None):
|
||||
yield run_on_reactor()
|
||||
|
||||
snapshot.fill_out_prev_events(event)
|
||||
|
@ -80,6 +81,16 @@ class BaseHandler(object):
|
|||
else:
|
||||
logger.debug("Suppressed auth.")
|
||||
|
||||
if do_invite_host:
|
||||
federation_handler = self.hs.get_handlers().federation_handler
|
||||
invite_event = yield federation_handler.send_invite(
|
||||
do_invite_host,
|
||||
event
|
||||
)
|
||||
|
||||
# FIXME: We need to check if the remote changed anything else
|
||||
event.signatures = invite_event.signatures
|
||||
|
||||
yield self.store.persist_event(event)
|
||||
|
||||
destinations = set(extra_destinations)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue