From 30b9827a2766725f146a04bf00735748cde91fec Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 13 Nov 2011 14:31:11 +0100 Subject: [PATCH] Move /clear to the chattab instead of the muctab --- src/tabs.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/tabs.py b/src/tabs.py index 28bb90d2..5987007b 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -303,6 +303,8 @@ class ChatTab(Tab): _("""Usage: /say \nSay: Just send the message. Useful if you want your message to begin with a '/'."""), None) self.commands['xhtml'] = (self.command_xhtml, _("Usage: /xhtml \nXHTML: Send custom XHTML."), None) + self.commands['clear'] = (self.command_clear, + _('Usage: /clear\nClear: Clear the current buffer.'), None) self.chat_state = None self.update_commands() @@ -357,6 +359,15 @@ class ChatTab(Tab): self.refresh() msg.send() + def command_clear(self, args): + """ + /clear + """ + self._text_buffer.messages = [] + self.text_win.rebuild_everything(self._text_buffer) + self.refresh() + self.core.doupdate() + def send_chat_state(self, state, always_send=False): """ Send an empty chatstate message @@ -476,8 +487,6 @@ class MucTab(ChatTab): self.commands['configure'] = (self.command_configure, _('Usage: /configure\nConfigure: Configure the current room, through a form.'), None) self.commands['version'] = (self.command_version, _('Usage: /version \nVersion: Get the software version of the given JID or nick in room (usually its XMPP client and Operating System).'), None) self.commands['names'] = (self.command_names, _('Usage: /names\nNames: Get the list of the users in the room, and the list of the people assuming the different roles.'), None) - self.commands['clear'] = (self.command_clear, - _('Usage: /clear\nClear: Clear the current buffer.'), None) self.resize() self.update_commands() @@ -526,15 +535,6 @@ class MucTab(ChatTab): self.core.xmpp.plugin['xep_0045'].configureRoom(self.get_name(), form) self.core.close_tab() - def command_clear(self, args): - """ - /clear - """ - self._text_buffer.messages = [] - self.text_win.rebuild_everything(self._text_buffer) - self.refresh() - self.core.doupdate() - def command_cycle(self, arg): if self.joined: muc.leave_groupchat(self.core.xmpp, self.get_name(), self.own_nick, arg)