diff sat/plugins/plugin_xep_0045.py @ 3911:8289ac1b34f4

plugin XEP-0384: Fully reworked to adjust to the reworked python-omemo: - support for both (modern) OMEMO under the `urn:xmpp:omemo:2` namespace and (legacy) OMEMO under the `eu.siacs.conversations.axolotl` namespace - maintains one identity across both versions of OMEMO - migrates data from the old plugin - includes more features for protocol stability - uses SCE for modern OMEMO - fully type-checked, linted and format-checked - added type hints to various pieces of backend code used by the plugin - added stubs for some Twisted APIs used by the plugin under stubs/ (use `export MYPYPATH=stubs/` before running mypy) - core (xmpp): enabled `send` trigger and made it an asyncPoint fix 375
author Syndace <me@syndace.dev>
date Tue, 23 Aug 2022 21:06:24 +0200
parents 813595f88612
children 32d714a8ea51
line wrap: on
line diff
--- a/sat/plugins/plugin_xep_0045.py	Thu Sep 22 12:03:12 2022 +0200
+++ b/sat/plugins/plugin_xep_0045.py	Tue Aug 23 21:06:24 2022 +0200
@@ -26,6 +26,7 @@
 from twisted.python import failure
 
 from sat.core import exceptions
+from sat.core.xmpp import SatXMPPClient
 from sat.memory import memory
 
 import time
@@ -204,10 +205,10 @@
                 return False
         return True
 
-    def getRoom(self, client, room_jid):
+    def getRoom(self, client: SatXMPPClient, room_jid: jid.JID) -> muc.Room:
         """Retrieve Room instance from its jid
 
-        @param room_jid(jid.JID): jid of the room
+        @param room_jid: jid of the room
         @raise exceptions.NotFound: the room has not been joined
         """
         try:
@@ -223,10 +224,10 @@
         if room_jid not in client._muc_client.joined_rooms:
             raise exceptions.NotFound(_("This room has not been joined"))
 
-    def isJoinedRoom(self, client, room_jid):
+    def isJoinedRoom(self, client: SatXMPPClient, room_jid: jid.JID) -> bool:
         """Tell if a jid is a known and joined room
 
-        @room_jid(jid.JID): jid of the room
+        @room_jid: jid of the room
         """
         try:
             self.checkRoomJoined(client, room_jid)