From 8b8128c416001d520b5b5a2028849def6e6170e4 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 6 Nov 2011 16:26:27 +0100 Subject: Fixes #2286 (with /info) --- src/tabs.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/tabs.py') diff --git a/src/tabs.py b/src/tabs.py index 1209038c..b4e0cf1d 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1859,6 +1859,7 @@ class ConversationTab(ChatTab): self.commands['unquery'] = (self.command_unquery, _("Usage: /unquery\nUnquery: close the tab"), None) self.commands['close'] = (self.command_unquery, _("Usage: /close\Close: close the tab"), None) self.commands['version'] = (self.command_version, _('Usage: /version\nVersion: get the software version of the current interlocutor (usually its XMPP client and Operating System)'), None) + self.commands['info'] = (self.command_info, _('Usage: /info\nInfo: get the status of the contact.'), None) self.resize() def completion(self): @@ -1882,6 +1883,18 @@ class ConversationTab(ChatTab): self.text_win.refresh() self.input.refresh() + def command_info(self, arg): + contact = roster.get_contact_by_jid(self.get_name()) + jid = JID(self.get_name()) + if jid.resource: + resource = contact.get_resource_by_fulljid(jid.full) + else: + resource = contact.get_highest_priority_resource() + if resource: + self._text_buffer.add_message("\x195}Status: %s\x193}" %resource.get_status(), None, None, None, None, None) + self.refresh() + self.core.doupdate() + def command_unquery(self, arg): self.core.close_tab() -- cgit v1.2.3 From 7d861ee88514b38081f748a2b9f844eb56c6c349 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 6 Nov 2011 17:31:56 +0100 Subject: Fix another thing related to Room removale --- src/tabs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tabs.py') diff --git a/src/tabs.py b/src/tabs.py index b4e0cf1d..79412158 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -305,7 +305,7 @@ class ChatTab(Tab): # build the list of the recent words char_we_dont_want = string.punctuation+' ' words = list() - for msg in self.messages[:-40:-1]: + for msg in self._text_buffer.messages[:-40:-1]: if not msg: continue txt = xhtml.clean_text(msg.txt) @@ -494,7 +494,7 @@ class MucTab(ChatTab): """ /clear """ - self.messages = [] + self._text_buffer.messages = [] self.text_win.rebuild_everything(self._text_buffer) self.refresh() self.core.doupdate() -- cgit v1.2.3