summaryrefslogtreecommitdiff
path: root/src/core/commands.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2014-04-26 14:05:28 +0200
committermathieui <mathieui@mathieui.net>2014-04-26 14:05:28 +0200
commit1f0ff4f0c30f5326e1b36ff03ebf83ac85239e89 (patch)
tree77aa90b2a0a7b3a8fec744b7c45f817ccd593e62 /src/core/commands.py
parent4c4e2083a6f4cab94b5cf63620e7a1be66c82817 (diff)
downloadpoezio-1f0ff4f0c30f5326e1b36ff03ebf83ac85239e89.tar.gz
poezio-1f0ff4f0c30f5326e1b36ff03ebf83ac85239e89.tar.bz2
poezio-1f0ff4f0c30f5326e1b36ff03ebf83ac85239e89.tar.xz
poezio-1f0ff4f0c30f5326e1b36ff03ebf83ac85239e89.zip
Fix #2444 (implement room destroy)
- destroy the current room if no parameter - destroy the room given as a parameter if any - no reason or alt room because it would be ambiguous in a command (implementation ideas welcome)
Diffstat (limited to 'src/core/commands.py')
-rw-r--r--src/core/commands.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/commands.py b/src/core/commands.py
index 8b753b18..0815a80e 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -815,6 +815,18 @@ def command_quit(self, arg=''):
self.reset_curses()
sys.exit()
+def command_destroy_room(self, arg=''):
+ """
+ /destroy_room [JID]
+ """
+ room = safeJID(arg).bare
+ if room:
+ muc.destroy_room(self.xmpp, room)
+ elif isinstance(self.current_tab(), tabs.MucTab) and not arg:
+ muc.destroy_room(self.xmpp, self.current_tab().general_jid)
+ else:
+ self.information(_('Invalid JID: "%s"') % arg, _('Error'))
+
def command_bind(self, arg):
"""
Bind a key.