mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 11:34:20 -05:00
Move delete_threepid_session into RegistrationWorkerStore
This commit is contained in:
parent
5a7e9fdd84
commit
6ddda8152e
@ -668,6 +668,31 @@ class RegistrationWorkerStore(SQLBaseStore):
|
|||||||
"get_threepid_validation_session", get_threepid_validation_session_txn
|
"get_threepid_validation_session", get_threepid_validation_session_txn
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def delete_threepid_session(self, session_id):
|
||||||
|
"""Removes a threepid validation session from the database. This can
|
||||||
|
be done after validation has been performed and whatever action was
|
||||||
|
waiting on it has been carried out
|
||||||
|
|
||||||
|
Args:
|
||||||
|
session_id (str): The ID of the session to delete
|
||||||
|
"""
|
||||||
|
|
||||||
|
def delete_threepid_session_txn(txn):
|
||||||
|
self._simple_delete_txn(
|
||||||
|
txn,
|
||||||
|
table="threepid_validation_token",
|
||||||
|
keyvalues={"session_id": session_id},
|
||||||
|
)
|
||||||
|
self._simple_delete_txn(
|
||||||
|
txn,
|
||||||
|
table="threepid_validation_session",
|
||||||
|
keyvalues={"session_id": session_id},
|
||||||
|
)
|
||||||
|
|
||||||
|
return self.runInteraction(
|
||||||
|
"delete_threepid_session", delete_threepid_session_txn
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class RegistrationStore(
|
class RegistrationStore(
|
||||||
RegistrationWorkerStore, background_updates.BackgroundUpdateStore
|
RegistrationWorkerStore, background_updates.BackgroundUpdateStore
|
||||||
@ -1323,31 +1348,6 @@ class RegistrationStore(
|
|||||||
self.clock.time_msec(),
|
self.clock.time_msec(),
|
||||||
)
|
)
|
||||||
|
|
||||||
def delete_threepid_session(self, session_id):
|
|
||||||
"""Removes a threepid validation session from the database. This can
|
|
||||||
be done after validation has been performed and whatever action was
|
|
||||||
waiting on it has been carried out
|
|
||||||
|
|
||||||
Args:
|
|
||||||
session_id (str): The ID of the session to delete
|
|
||||||
"""
|
|
||||||
|
|
||||||
def delete_threepid_session_txn(txn):
|
|
||||||
self._simple_delete_txn(
|
|
||||||
txn,
|
|
||||||
table="threepid_validation_token",
|
|
||||||
keyvalues={"session_id": session_id},
|
|
||||||
)
|
|
||||||
self._simple_delete_txn(
|
|
||||||
txn,
|
|
||||||
table="threepid_validation_session",
|
|
||||||
keyvalues={"session_id": session_id},
|
|
||||||
)
|
|
||||||
|
|
||||||
return self.runInteraction(
|
|
||||||
"delete_threepid_session", delete_threepid_session_txn
|
|
||||||
)
|
|
||||||
|
|
||||||
def set_user_deactivated_status_txn(self, txn, user_id, deactivated):
|
def set_user_deactivated_status_txn(self, txn, user_id, deactivated):
|
||||||
self._simple_update_one_txn(
|
self._simple_update_one_txn(
|
||||||
txn=txn,
|
txn=txn,
|
||||||
|
Loading…
Reference in New Issue
Block a user