mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-07 11:42:11 -04:00
Allow rejecting invites
This is done by using the same /leave flow as you would use if you had already accepted the invite and wanted to leave.
This commit is contained in:
parent
9261ef3a15
commit
137fafce4e
8 changed files with 353 additions and 93 deletions
|
@ -267,6 +267,20 @@ class FederationServer(FederationBase):
|
|||
],
|
||||
}))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_make_leave_request(self, room_id, user_id):
|
||||
pdu = yield self.handler.on_make_leave_request(room_id, user_id)
|
||||
time_now = self._clock.time_msec()
|
||||
defer.returnValue({"event": pdu.get_pdu_json(time_now)})
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_send_leave_request(self, origin, content):
|
||||
logger.debug("on_send_leave_request: content: %s", content)
|
||||
pdu = self.event_from_pdu_json(content)
|
||||
logger.debug("on_send_leave_request: pdu sigs: %s", pdu.signatures)
|
||||
yield self.handler.on_send_leave_request(origin, pdu)
|
||||
defer.returnValue((200, {}))
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def on_event_auth(self, origin, room_id, event_id):
|
||||
time_now = self._clock.time_msec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue