diff options
author | mathieui <mathieui@mathieui.net> | 2021-03-26 11:50:29 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-02 17:44:36 +0200 |
commit | d0551c09ba8f5370ab3f40a9359687d5d7ed40bf (patch) | |
tree | 4fccbb5f489981a29c27596a45639e39319d8dbe /plugins/b64.py | |
parent | d27895e04e9100e9368a81756c0d679155a571d8 (diff) | |
download | poezio-d0551c09ba8f5370ab3f40a9359687d5d7ed40bf.tar.gz poezio-d0551c09ba8f5370ab3f40a9359687d5d7ed40bf.tar.bz2 poezio-d0551c09ba8f5370ab3f40a9359687d5d7ed40bf.tar.xz poezio-d0551c09ba8f5370ab3f40a9359687d5d7ed40bf.zip |
fix: typing issues in plugins
Diffstat (limited to 'plugins/b64.py')
-rw-r--r-- | plugins/b64.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/b64.py b/plugins/b64.py index d56ac5b3..1fec6123 100644 --- a/plugins/b64.py +++ b/plugins/b64.py @@ -24,7 +24,9 @@ This plugin also respects security guidelines listed in XEP-0419. from base64 import b64decode, b64encode from poezio.plugin_e2ee import E2EEPlugin -from slixmpp import Message +from poezio.tabs import ChatTab +from slixmpp import Message, JID +from typing import Optional class Plugin(E2EEPlugin): @@ -37,14 +39,14 @@ class Plugin(E2EEPlugin): # This encryption mechanism is using <body/> as a container replace_body_with_eme = False - def decrypt(self, message: Message, _tab) -> None: + async def decrypt(self, message: Message, jid: Optional[JID], _tab: ChatTab) -> None: """ Decrypt base64 """ body = message['body'] message['body'] = b64decode(body.encode()).decode() - def encrypt(self, message: Message, _tab) -> None: + async def encrypt(self, message: Message, jid: Optional[JID], _tab: ChatTab) -> None: """ Encrypt to base64 """ |