Commit ff947825 authored by mathieui's avatar mathieui

Add a /password command in the RosterTab

Thanks to Florob for the initial input
parent 0c507859
...@@ -440,6 +440,11 @@ Roster tab commands ...@@ -440,6 +440,11 @@ Roster tab commands
Set the given JID’s name in your roster. Set the given JID’s name in your roster.
/password
**Usage:** ``/password <password>``
Change your password.
/groupadd /groupadd
**Usage:** ``/groupadd <jid> <group>`` **Usage:** ``/groupadd <jid> <group>``
......
...@@ -68,7 +68,10 @@ class Connection(sleekxmpp.ClientXMPP): ...@@ -68,7 +68,10 @@ class Connection(sleekxmpp.ClientXMPP):
self.register_plugin('xep_0045') self.register_plugin('xep_0045')
self.register_plugin('xep_0048') self.register_plugin('xep_0048')
self.register_plugin('xep_0060') self.register_plugin('xep_0060')
self.register_plugin('xep_0066')
self.register_plugin('xep_0071') 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_0085')
self.register_plugin('xep_0115') self.register_plugin('xep_0115')
self.register_plugin('xep_0191') self.register_plugin('xep_0191')
......
...@@ -2273,6 +2273,10 @@ class RosterInfoTab(Tab): ...@@ -2273,6 +2273,10 @@ class RosterInfoTab(Tab):
desc=_('Informs you of the last activity of a JID.'), desc=_('Informs you of the last activity of a JID.'),
shortdesc=_('Get the activity of someone.'), shortdesc=_('Get the activity of someone.'),
completion=self.core.completion_last_activity) completion=self.core.completion_last_activity)
self.register_command('password', self.command_password,
usage='<password>',
shortdesc=_('Change your password'))
self.resize() self.resize()
self.update_commands() self.update_commands()
self.update_keys() self.update_keys()
...@@ -2465,6 +2469,21 @@ class RosterInfoTab(Tab): ...@@ -2465,6 +2469,21 @@ class RosterInfoTab(Tab):
self.core.information_win.rebuild_everything(self.core.information_buffer) self.core.information_win.rebuild_everything(self.core.information_buffer)
self.refresh() 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): def command_deny(self, arg):
""" """
/deny [jid] /deny [jid]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment