diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2020-04-12 16:45:21 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2020-04-12 16:45:21 +0200 |
commit | 57553abc0a29e008dc8f683439ea70004c254c98 (patch) | |
tree | 24dcfb1ec4e1f34acfba2e1caeb899c8db258c34 /plugins/embed.py | |
parent | a72152c462fafac8a0be57801b0835caf443cb8d (diff) | |
download | poezio-57553abc0a29e008dc8f683439ea70004c254c98.tar.gz poezio-57553abc0a29e008dc8f683439ea70004c254c98.tar.bz2 poezio-57553abc0a29e008dc8f683439ea70004c254c98.tar.xz poezio-57553abc0a29e008dc8f683439ea70004c254c98.zip |
plugins/upload: Use embed directly instead of populating input field
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'plugins/embed.py')
-rw-r--r-- | plugins/embed.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/embed.py b/plugins/embed.py index 9895a927..4226c420 100644 --- a/plugins/embed.py +++ b/plugins/embed.py @@ -28,14 +28,13 @@ class Plugin(BasePlugin): help='Embed an image url into the contact\'s client', usage='<image_url>') - def embed_image_url(self, args): + def embed_image_url(self, url): tab = self.api.current_tab() message = self.core.xmpp.make_message(tab.jid) - message['body'] = args - message['oob']['url'] = args - if isinstance(tab, tabs.MucTab): - message['type'] = 'groupchat' - else: + message['body'] = url + message['oob']['url'] = url + message['type'] = 'groupchat' + if not isinstance(tab, tabs.MucTab): message['type'] = 'chat' tab.add_message( message['body'], @@ -46,3 +45,6 @@ class Plugin(BasePlugin): typ=1, ) message.send() + # TODO: Fix refreshing. The following doesn't work. + tab.refresh() + self.core.tab_win.refresh() |