delete_session: new API

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-03-24 19:51:23 +01:00
parent 284f49714e
commit 48b0610f89
2 changed files with 8 additions and 1 deletions

View file

@ -2,6 +2,7 @@ Version XXX:
2022-XX-XX Maxime “pep” Buquet <pep@bouah.net>
* Improvements:
- Added py.typed to the repository for static type checking tools
- New delete_session method
Version 0.6.1:
2022-03-14 Maxime “pep” Buquet <pep@bouah.net>
* Improvements:

View file

@ -11,7 +11,7 @@
import logging
from typing import Any, Dict, List, Optional, Set, Tuple, Union
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
import os
import json
@ -612,6 +612,12 @@ class XEP_0384(BasePlugin):
msg.enable('store')
return msg
async def delete_session(self, jid: JID, device_id: int) -> None:
"""
Delete the session for the provided jid/device_id pair.
"""
await self._omemo().deleteSession(jid.bare, device_id)
async def trust(self, jid: JID, device_id: int, ik: bytes) -> None:
await self._omemo().setTrust(jid.bare, device_id, ik, True)