summaryrefslogtreecommitdiff
path: root/poezio/core
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2022-02-15 22:43:10 +0100
committerMaxime Buquet <pep@bouah.net>2022-03-23 15:38:00 +0100
commit6174ca70d9bc36fde9d0a0c08ccb67e874a4711c (patch)
tree45cd819c9599a75c9af2dd0739dd7d03b8ba2060 /poezio/core
parentd6de6dccfa4b832a84edd394bee4f92a00069277 (diff)
downloadpoezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.gz
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.bz2
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.tar.xz
poezio-6174ca70d9bc36fde9d0a0c08ccb67e874a4711c.zip
internal: make command_say async
Diffstat (limited to 'poezio/core')
-rw-r--r--poezio/core/commands.py4
-rw-r--r--poezio/core/core.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index 9ad5a78c..f4662021 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -1283,7 +1283,7 @@ class CommandCore:
list(self.core.plugin_manager.plugins.keys())), 'Info')
@command_args_parser.quoted(1, 1)
- def message(self, args):
+ async def message(self, args):
"""
/message <jid> [message]
"""
@@ -1313,7 +1313,7 @@ class CommandCore:
else:
self.core.focus_tab(tab)
if len(args) == 2:
- tab.command_say(args[1])
+ await tab.command_say(args[1])
@command_args_parser.ignored
def xml_tab(self):
diff --git a/poezio/core/core.py b/poezio/core/core.py
index bc57024c..0c71b566 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -906,7 +906,9 @@ class Core:
"""
if not isinstance(self.tabs.current_tab, ChatTab):
return False
- self.tabs.current_tab.command_say(msg)
+ asyncio.ensure_future(
+ self.tabs.current_tab.command_say(msg)
+ )
return True
async def invite(self, jid: JID, room: JID, reason: Optional[str] = None, force_mediated: bool = False) -> bool: