diff libervia/backend/plugins/plugin_xep_0191.py @ 4270:0d7bb4df2343

Reformatted code base using black.
author Goffi <goffi@goffi.org>
date Wed, 19 Jun 2024 18:44:57 +0200
parents 4b842c1fb686
children
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_xep_0191.py	Tue Jun 18 12:06:45 2024 +0200
+++ b/libervia/backend/plugins/plugin_xep_0191.py	Wed Jun 19 18:44:57 2024 +0200
@@ -84,10 +84,7 @@
         return XEP_0191_Handler(self)
 
     @ensure_deferred
-    async def _block_list(
-        self,
-        profile_key=C.PROF_KEY_NONE
-    ) -> List[str]:
+    async def _block_list(self, profile_key=C.PROF_KEY_NONE) -> List[str]:
         client = self.host.get_client(profile_key)
         blocked_jids = await self.block_list(client)
         return [j.full() for j in blocked_jids]
@@ -113,11 +110,7 @@
 
         return blocked_jids
 
-    def _block(
-        self,
-        entities: List[str],
-        profile_key: str = C.PROF_KEY_NONE
-    ) -> str:
+    def _block(self, entities: List[str], profile_key: str = C.PROF_KEY_NONE) -> str:
         client = self.host.get_client(profile_key)
         return defer.ensureDeferred(
             self.block(client, [jid.JID(entity) for entity in entities])
@@ -132,15 +125,9 @@
             item_elt["jid"] = entity.full()
         await iq_elt.send()
 
-    def _unblock(
-        self,
-        entities: List[str],
-        profile_key: str = C.PROF_KEY_NONE
-    ) -> None:
+    def _unblock(self, entities: List[str], profile_key: str = C.PROF_KEY_NONE) -> None:
         client = self.host.get_client(profile_key)
-        return defer.ensureDeferred(
-            self.unblock(client, [jid.JID(e) for e in entities])
-        )
+        return defer.ensureDeferred(self.unblock(client, [jid.JID(e) for e in entities]))
 
     async def unblock(self, client: SatXMPPEntity, entities: List[jid.JID]) -> None:
         await self.host.check_feature(client, NS_BLOCKING)
@@ -192,15 +179,10 @@
 
     def connectionInitialized(self):
         self.xmlstream.addObserver(
-            IQ_BLOCK_PUSH,
-            self.plugin_parent.on_block_push,
-            client=self.parent
-
+            IQ_BLOCK_PUSH, self.plugin_parent.on_block_push, client=self.parent
         )
         self.xmlstream.addObserver(
-            IQ_UNBLOCK_PUSH,
-            self.plugin_parent.on_unblock_push,
-            client=self.parent
+            IQ_UNBLOCK_PUSH, self.plugin_parent.on_unblock_push, client=self.parent
         )
 
     def getDiscoInfo(self, requestor, service, nodeIdentifier=""):