summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-02-27 13:15:40 +0100
committermathieui <mathieui@mathieui.net>2021-02-27 13:15:40 +0100
commit9c6e89d0e5714313d2891f1055254b535b4db49f (patch)
treee135ccf2ea17926b3389cf6a811166e7b5ba2992
parentf0508d8c83caffe59018bea0684356c3ba12e211 (diff)
downloadpoezio-9c6e89d0e5714313d2891f1055254b535b4db49f.tar.gz
poezio-9c6e89d0e5714313d2891f1055254b535b4db49f.tar.bz2
poezio-9c6e89d0e5714313d2891f1055254b535b4db49f.tar.xz
poezio-9c6e89d0e5714313d2891f1055254b535b4db49f.zip
plugins: make set_bob async
-rw-r--r--plugins/bob.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/bob.py b/plugins/bob.py
index 2d733e25..98c62901 100644
--- a/plugins/bob.py
+++ b/plugins/bob.py
@@ -47,7 +47,7 @@ class Plugin(BasePlugin):
short='Send a short image',
completion=self.completion_bob)
- def command_bob(self, filename):
+ async def command_bob(self, filename):
path = Path(expanduser(filename))
try:
size = path.stat().st_size
@@ -67,7 +67,7 @@ class Plugin(BasePlugin):
with open(path.as_posix(), 'rb') as file:
data = file.read()
max_age = self.config.get('max_age')
- cid = self.core.xmpp.plugin['xep_0231'].set_bob(
+ cid = await self.core.xmpp.plugin['xep_0231'].set_bob(
data, mime_type, max_age=max_age)
self.api.run_command(
'/xhtml <img src="cid:%s" alt="%s"/>' % (cid, path.name))