mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 08:33:48 +01:00
Fixup and add some logging
This commit is contained in:
parent
5257a2fb1c
commit
72a2708ac6
1 changed files with 9 additions and 1 deletions
|
@ -122,7 +122,7 @@ class DeactivateAccountHandler(BaseHandler):
|
|||
|
||||
# Reject all pending invites for the user, so that it doesn't show up in the
|
||||
# invitees list of rooms.
|
||||
self._reject_pending_invites_for_user(user_id)
|
||||
yield self._reject_pending_invites_for_user(user_id)
|
||||
|
||||
# Remove all information on the user from the account_validity table.
|
||||
if self._account_validity_enabled:
|
||||
|
@ -133,6 +133,7 @@ class DeactivateAccountHandler(BaseHandler):
|
|||
|
||||
return identity_server_supports_unbinding
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def _reject_pending_invites_for_user(self, user_id):
|
||||
"""Reject pending invites addressed to a given user ID.
|
||||
|
||||
|
@ -142,6 +143,8 @@ class DeactivateAccountHandler(BaseHandler):
|
|||
user = UserID.from_string(user_id)
|
||||
pending_invites = yield self.store.get_invited_rooms_for_user(user_id)
|
||||
|
||||
logger.info(pending_invites)
|
||||
|
||||
for room in pending_invites:
|
||||
try:
|
||||
yield self._room_member_handler.update_membership(
|
||||
|
@ -152,6 +155,11 @@ class DeactivateAccountHandler(BaseHandler):
|
|||
ratelimit=False,
|
||||
require_consent=False,
|
||||
)
|
||||
logger.info(
|
||||
"Rejected invite for user %r in room %r",
|
||||
user_id,
|
||||
room.room_id,
|
||||
)
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Failed to reject invite for user %r in room %r:"
|
||||
|
|
Loading…
Reference in a new issue