diff options
author | Mathieu Pasquet <mathieui@mathieui.net> | 2013-11-14 21:26:19 +0100 |
---|---|---|
committer | Mathieu Pasquet <mathieui@mathieui.net> | 2013-11-14 21:26:19 +0100 |
commit | ff9478259d91178e0c05fc3c2064cde4c514b410 (patch) | |
tree | ba303375fac06ecdee2517cce3bf96b1a57dfe44 /src | |
parent | 0c507859fb611bbec90ff7cc4abb7ff149b51153 (diff) | |
download | poezio-ff9478259d91178e0c05fc3c2064cde4c514b410.tar.gz poezio-ff9478259d91178e0c05fc3c2064cde4c514b410.tar.bz2 poezio-ff9478259d91178e0c05fc3c2064cde4c514b410.tar.xz poezio-ff9478259d91178e0c05fc3c2064cde4c514b410.zip |
Add a /password command in the RosterTab
Thanks to Florob for the initial input
Diffstat (limited to 'src')
-rw-r--r-- | src/connection.py | 3 | ||||
-rw-r--r-- | src/tabs.py | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/connection.py b/src/connection.py index d8746557..37385650 100644 --- a/src/connection.py +++ b/src/connection.py @@ -68,7 +68,10 @@ class Connection(sleekxmpp.ClientXMPP): self.register_plugin('xep_0045') self.register_plugin('xep_0048') self.register_plugin('xep_0060') + self.register_plugin('xep_0066') self.register_plugin('xep_0071') + self.register_plugin('xep_0077') + self.plugin['xep_0077'].create_account = False self.register_plugin('xep_0085') self.register_plugin('xep_0115') self.register_plugin('xep_0191') diff --git a/src/tabs.py b/src/tabs.py index 598cf82a..725cc8d8 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -2273,6 +2273,10 @@ class RosterInfoTab(Tab): desc=_('Informs you of the last activity of a JID.'), shortdesc=_('Get the activity of someone.'), completion=self.core.completion_last_activity) + self.register_command('password', self.command_password, + usage='<password>', + shortdesc=_('Change your password')) + self.resize() self.update_commands() self.update_keys() @@ -2465,6 +2469,21 @@ class RosterInfoTab(Tab): self.core.information_win.rebuild_everything(self.core.information_buffer) self.refresh() + def command_password(self, arg): + """ + /password <password> + """ + def callback(iq): + if iq['type'] == 'result': + self.core.information('Password updated', 'Account') + if config.get('password', ''): + config.silent_set('password', arg) + else: + self.core.information('Unable to change the password', 'Account') + self.core.xmpp.plugin['xep_0077'].change_password(arg, callback=callback) + + + def command_deny(self, arg): """ /deny [jid] |