Add a /password command in the RosterTab
Thanks to Florob for the initial input
This commit is contained in:
parent
0c507859fb
commit
ff9478259d
3 changed files with 27 additions and 0 deletions
|
@ -440,6 +440,11 @@ Roster tab commands
|
|||
|
||||
Set the given JID’s name in your roster.
|
||||
|
||||
/password
|
||||
**Usage:** ``/password <password>``
|
||||
|
||||
Change your password.
|
||||
|
||||
/groupadd
|
||||
**Usage:** ``/groupadd <jid> <group>``
|
||||
|
||||
|
|
|
@ -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')
|
||||
|
|
19
src/tabs.py
19
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]
|
||||
|
|
Loading…
Reference in a new issue