summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-06 17:11:55 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-06 17:11:55 +0100
commitaa78a454fb4b2f2f90e84eb07a911ab60a8da1a0 (patch)
tree5e87b614152ffc1bd9e2fff28afb3e93322de001 /src/tabs.py
parent200019574d66c1a04d25e23eb0a0fcda7c25f445 (diff)
parent8b8128c416001d520b5b5a2028849def6e6170e4 (diff)
downloadpoezio-aa78a454fb4b2f2f90e84eb07a911ab60a8da1a0.tar.gz
poezio-aa78a454fb4b2f2f90e84eb07a911ab60a8da1a0.tar.bz2
poezio-aa78a454fb4b2f2f90e84eb07a911ab60a8da1a0.tar.xz
poezio-aa78a454fb4b2f2f90e84eb07a911ab60a8da1a0.zip
Merge branch 'master' of https://git.louiz.org/poezio
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py13
1 files changed, 13 insertions, 0 deletions
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()