summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-07-26 14:15:11 +0200
committermathieui <mathieui@mathieui.net>2012-07-26 14:15:11 +0200
commit8a0a100bf5ca919959cedf8f0f6a5b14367ba3e8 (patch)
tree6a05ed7f9117de2aab7292af1f2e25561de2af51
parent1c29b39a6e882a7e5dd262ed1f5602740bcdd199 (diff)
downloadpoezio-8a0a100bf5ca919959cedf8f0f6a5b14367ba3e8.tar.gz
poezio-8a0a100bf5ca919959cedf8f0f6a5b14367ba3e8.tar.bz2
poezio-8a0a100bf5ca919959cedf8f0f6a5b14367ba3e8.tar.xz
poezio-8a0a100bf5ca919959cedf8f0f6a5b14367ba3e8.zip
Add a /self command
-rw-r--r--doc/en/usage.txt4
-rw-r--r--src/core.py15
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/en/usage.txt b/doc/en/usage.txt
index 1758308c..cdcd3ba8 100644
--- a/doc/en/usage.txt
+++ b/doc/en/usage.txt
@@ -318,9 +318,11 @@ These commands work in *any* tab.
"/bind ^H KEY_UP" makes Control + h behave the same way as the Up key. See the
link:keys.html[key bindings documentation page] for more details.
- */runkey <key>*:: Execute the action defined for _key_. For example,
+*/runkey <key>*:: Execute the action defined for _key_. For example,
"/runkey KEY_PPAGE" will scroll up, or "/runkey ^N" will go to the next tab.
+*/self*:: Reminds you of who you are and what your status is.
+
NOTE: The following command will work everywhere, except in the Roster tab.
*/close*:: Close the tab.
diff --git a/src/core.py b/src/core.py
index 27b8c880..1bedf2ef 100644
--- a/src/core.py
+++ b/src/core.py
@@ -178,6 +178,7 @@ class Core(object):
'remove_bookmark': (self.command_remove_bookmark, _("Usage: /remove_bookmark [jid]\nRemove Bookmark: Remove the specified bookmark, or the bookmark on the current tab, if any."), self.completion_remove_bookmark),
'xml_tab': (self.command_xml_tab, _("Usage: /xml_tab\nXML Tab: Open an XML tab."), None),
'runkey': (self.command_runkey, _("Usage: /runkey <key>\nRunkey: Execute the action defined for <key>."), self.completion_runkey),
+ 'self': (self.command_self, _("Usage: /self\nSelf: Remind you of who you are."), None),
}
# We are invisible
@@ -2031,6 +2032,20 @@ class Core(object):
tab = tabs.XMLTab()
self.add_tab(tab, True)
+ def command_self(self, arg=None):
+ """
+ /self
+ """
+ status = self.get_status()
+ show, message = status.show, status.message
+ nick = self.own_nick
+ jid = self.xmpp.boundjid.full
+ info = 'Your JID is %s\nYour current status is "%s" (%s)\nYour default nickname is %s' % (
+ jid,
+ message,
+ show if show else 'available',
+ nick)
+ self.information(info, 'Info')
####################### XMPP Event Handlers ##################################