summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 79be7d58..7a968740 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)
@@ -497,7 +497,7 @@ class MucTab(ChatTab):
"""
/clear
"""
- self.messages = []
+ self._text_buffer.messages = []
self.text_win.rebuild_everything(self._text_buffer)
self.refresh()
self.core.doupdate()
@@ -1218,7 +1218,7 @@ class PrivateTab(ChatTab):
msg['chat_state'] = needed
self.core.events.trigger('private_say', msg)
msg.send()
- self.core.add_message_to_text_buffer(self._text_buffer, line, None, self.core.own_nick or self.own_nick)
+ self.core.add_message_to_text_buffer(self._text_buffer, xhtml.convert_simple_to_full_colors(line), None, self.core.own_nick or self.own_nick)
self.cancel_paused_delay()
self.text_win.refresh()
self.input.refresh()
@@ -1580,7 +1580,6 @@ class RosterInfoTab(Tab):
self.command_add(jid.lstrip('\n'))
self.core.information('Contacts imported from %s' % filepath, 'Info')
-
def command_export(self, arg):
"""
Export the contacts
@@ -1864,6 +1863,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,12 +1882,24 @@ class ConversationTab(ChatTab):
msg['chat_state'] = needed
self.core.events.trigger('conversation_say', msg)
msg.send()
- self.core.add_message_to_text_buffer(self._text_buffer, line, None, self.core.own_nick)
+ self.core.add_message_to_text_buffer(self._text_buffer, xhtml.convert_simple_to_full_colors(line), None, self.core.own_nick)
logger.log_message(JID(self.get_name()).bare, self.core.own_nick, line)
self.cancel_paused_delay()
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()