summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-03-19 17:00:03 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2022-03-20 01:02:14 +0100
commit82ee250295f02ac2db61a1bbe045ab7686b1892c (patch)
tree4d4e44e52ac307815b92c988a7811184217ca3ba
parent53d38a81154a0cf5adbe798af6a9af739079e65b (diff)
downloadslixmpp-82ee250295f02ac2db61a1bbe045ab7686b1892c.tar.gz
slixmpp-82ee250295f02ac2db61a1bbe045ab7686b1892c.tar.bz2
slixmpp-82ee250295f02ac2db61a1bbe045ab7686b1892c.tar.xz
slixmpp-82ee250295f02ac2db61a1bbe045ab7686b1892c.zip
xep_0454: use staticmethods where possible
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/plugins/xep_0454/__init__.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/slixmpp/plugins/xep_0454/__init__.py b/slixmpp/plugins/xep_0454/__init__.py
index 99e9ff5f..cecde480 100644
--- a/slixmpp/plugins/xep_0454/__init__.py
+++ b/slixmpp/plugins/xep_0454/__init__.py
@@ -35,8 +35,8 @@ class XEP_0454(BasePlugin):
description = 'XEP-0454: OMEMO Media Sharing'
dependencies = {'xep_0363'}
- @classmethod
- def encrypt(cls, input_file: Optional[IO[bytes]] = None, filename: Optional[Path] = None) -> Tuple[bytes, str]:
+ @staticmethod
+ def encrypt(input_file: Optional[IO[bytes]] = None, filename: Optional[Path] = None) -> Tuple[bytes, str]:
"""
Encrypts file as specified in XEP-0454 for use in file sharing
@@ -71,8 +71,8 @@ class XEP_0454(BasePlugin):
fragment = aes_gcm_iv.hex() + aes_gcm_key.hex()
return (payload, fragment)
- @classmethod
- def decrypt(cls, input_file: IO[bytes], fragment: str) -> bytes:
+ @staticmethod
+ def decrypt(input_file: IO[bytes], fragment: str) -> bytes:
"""
Decrypts file-like.
@@ -111,8 +111,8 @@ class XEP_0454(BasePlugin):
return plain
- @classmethod
- def format_url(cls, url: str, fragment: str) -> str:
+ @staticmethod
+ def format_url(url: str, fragment: str) -> str:
"""Helper to format a HTTPS URL to an AESGCM URI"""
if not url.startswith('https://') or url.find('#') != -1:
raise InvalidURL