summaryrefslogtreecommitdiff
path: root/poezio/core/commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'poezio/core/commands.py')
-rw-r--r--poezio/core/commands.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index f301e801..86df9a93 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -6,6 +6,7 @@ import logging
log = logging.getLogger(__name__)
+import asyncio
from xml.etree import cElementTree as ET
from slixmpp.exceptions import XMPPError
@@ -764,17 +765,21 @@ class CommandCore:
self.core.information('Invited %s to %s' % (to.bare, room), 'Info')
@command_args_parser.quoted(1, 0)
- def impromptu(self, args):
+ def impromptu(self, args: str) -> None:
"""/impromptu <jid> [<jid> ...]"""
if args is None:
return self.help('impromptu')
- jids = []
+ jids = set()
+ current_tab = self.core.tabs.current_tab
+ if isinstance(current_tab, tabs.ConversationTab):
+ jids.add(current_tab.general_jid)
+
for jid in common.shell_split(' '.join(args)):
- jids.append(safeJID(jid).bare)
+ jids.add(safeJID(jid).bare)
- self.core.impromptu(jids)
+ asyncio.ensure_future(self.core.impromptu(jids))
self.core.information('Invited %s to a random room' % (' '.join(jids)), 'Info')
@command_args_parser.quoted(1, 1, [''])