Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
poezio
poezio
Commits
ff947825
Commit
ff947825
authored
Nov 14, 2013
by
mathieui
Browse files
Add a /password command in the RosterTab
Thanks to Florob for the initial input
parent
0c507859
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/source/commands.rst
View file @
ff947825
...
...
@@ -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>``
...
...
src/connection.py
View file @
ff947825
...
...
@@ -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'
)
...
...
src/tabs.py
View file @
ff947825
...
...
@@ -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]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment