From 48b0610f89643fa35936b9e9354fe9a57ea01e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Thu, 24 Mar 2022 19:51:23 +0100 Subject: [PATCH] delete_session: new API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- ChangeLog | 1 + slixmpp_omemo/__init__.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fb7fe94..e2b786d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Version XXX: 2022-XX-XX Maxime “pep” Buquet * 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 * Improvements: diff --git a/slixmpp_omemo/__init__.py b/slixmpp_omemo/__init__.py index a60ebb2..113b001 100644 --- a/slixmpp_omemo/__init__.py +++ b/slixmpp_omemo/__init__.py @@ -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)