mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-02-26 01:21:09 -05:00
client: Use the nio provided method to find a SAS object.
This commit is contained in:
parent
46ff19ea3c
commit
5ef5551977
@ -151,19 +151,15 @@ class PanClient(AsyncClient):
|
|||||||
user_id = message.user_id
|
user_id = message.user_id
|
||||||
device_id = message.device_id
|
device_id = message.device_id
|
||||||
|
|
||||||
sas = None
|
sas = self.get_active_sas(user_id, device_id)
|
||||||
|
|
||||||
for s in self.key_verifications.values():
|
|
||||||
device = s.other_olm_device
|
|
||||||
if device.user_id == user_id and device.id == device_id:
|
|
||||||
sas = s
|
|
||||||
break
|
|
||||||
|
|
||||||
if not sas:
|
if not sas:
|
||||||
|
self.send_info("No such verification process found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.accept_short_auth_string(sas.transaction_id)
|
await self.accept_short_auth_string(sas.transaction_id)
|
||||||
|
|
||||||
|
device = sas.other_olm_device
|
||||||
if sas.verified:
|
if sas.verified:
|
||||||
await self.send_info(f"Device {device.id} of user {device.user_id}"
|
await self.send_info(f"Device {device.id} of user {device.user_id}"
|
||||||
f" succesfully verified.")
|
f" succesfully verified.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user