diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commands.py | 12 | ||||
-rw-r--r-- | src/core/core.py | 8 |
2 files changed, 20 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. diff --git a/src/core/core.py b/src/core/core.py index 1fe00d2d..5313e89d 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -1639,6 +1639,13 @@ class Core(object): "tab."), shortdesc=_('Move a tab.'), completion=self.completion_move_tab) + self.register_command('destroy_room', self.command_destroy_room, + usage=_('[room JID]'), + desc=_('Try to destroy the room [room JID], or the current' + ' tab if it is a multi-user chat and [room JID] is ' + 'not given.'), + shortdesc=_('Destroy a room.'), + completion=None) self.register_command('show', self.command_status, usage=_('<availability> [status message]'), desc=_("Sets your availability and (optionally) your status " @@ -1856,6 +1863,7 @@ class Core(object): command_bookmark_local = commands.command_bookmark_local command_bookmark = commands.command_bookmark command_bookmarks = commands.command_bookmarks + command_destroy_room = commands.command_destroy_room command_remove_bookmark = commands.command_remove_bookmark command_set = commands.command_set command_server_cycle = commands.command_server_cycle |