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
b7c23313
Commit
b7c23313
authored
Aug 25, 2016
by
mathieui
Browse files
Fix
#3217
(allow /groupadd "group" with selected row in the roster)
parent
e8aa8968
Changes
1
Hide whitespace changes
Inline
Side-by-side
poezio/tabs/rostertab.py
View file @
b7c23313
...
...
@@ -72,38 +72,38 @@ class RosterInfoTab(Tab):
desc
=
'Deny your presence to the provided JID (or the '
'selected contact in your roster), who is asking'
'you to be in his/here roster.'
,
shortdesc
=
'Deny a
n
user your presence.'
,
shortdesc
=
'Deny a user your presence.'
,
completion
=
self
.
completion_deny
)
self
.
register_command
(
'accept'
,
self
.
command_accept
,
usage
=
'[jid]'
,
desc
=
'Allow the provided JID (or the selected contact '
'in your roster), to see your presence.'
,
shortdesc
=
'Allow a
n
user your presence.'
,
shortdesc
=
'Allow a user your presence.'
,
completion
=
self
.
completion_deny
)
self
.
register_command
(
'add'
,
self
.
command_add
,
usage
=
'<jid>'
,
desc
=
'Add the specified JID to your roster, ask him to'
' allow you to see his presence, and allow him to'
' see your presence.'
,
shortdesc
=
'Add a
n
user to your roster.'
)
shortdesc
=
'Add a user to your roster.'
)
self
.
register_command
(
'name'
,
self
.
command_name
,
usage
=
'<jid> [name]'
,
shortdesc
=
'Set the given JID
\'
s name.'
,
completion
=
self
.
completion_name
)
self
.
register_command
(
'groupadd'
,
self
.
command_groupadd
,
usage
=
'<jid> <group>'
,
desc
=
'Add the given JID to the given group.'
,
shortdesc
=
'Add a
n
user to a group'
,
usage
=
'
[
<jid>
<group>]|
<group>'
,
desc
=
'Add the given JID
or selected line
to the given group.'
,
shortdesc
=
'Add a user to a group'
,
completion
=
self
.
completion_groupadd
)
self
.
register_command
(
'groupmove'
,
self
.
command_groupmove
,
usage
=
'<jid> <old group> <new group>'
,
desc
=
'Move the given JID from the old group to the new group.'
,
shortdesc
=
'Move a
n
user to another group.'
,
shortdesc
=
'Move a user to another group.'
,
completion
=
self
.
completion_groupmove
)
self
.
register_command
(
'groupremove'
,
self
.
command_groupremove
,
usage
=
'<jid> <group>'
,
desc
=
'Remove the given JID from the given group.'
,
shortdesc
=
'Remove a
n
user from a group.'
,
shortdesc
=
'Remove a user from a group.'
,
completion
=
self
.
completion_groupremove
)
self
.
register_command
(
'remove'
,
self
.
command_remove
,
usage
=
'[jid]'
,
...
...
@@ -111,7 +111,7 @@ class RosterInfoTab(Tab):
'will unsubscribe you from its presence, cancel '
'its subscription to yours, and remove the item '
'from your roster.'
,
shortdesc
=
'Remove a
n
user from your roster.'
,
shortdesc
=
'Remove a user from your roster.'
,
completion
=
self
.
completion_remove
)
self
.
register_command
(
'export'
,
self
.
command_export
,
usage
=
'[/path/to/file]'
,
...
...
@@ -664,15 +664,25 @@ class RosterInfoTab(Tab):
self
.
core
.
xmpp
.
update_roster
(
jid
,
name
=
name
,
groups
=
groups
,
subscription
=
subscription
,
callback
=
callback
)
@
command_args_parser
.
quoted
(
2
)
@
command_args_parser
.
quoted
(
1
,
1
)
def
command_groupadd
(
self
,
args
):
"""
Add the specified JID to the specified group
"""
if
args
is
None
:
return
self
.
core
.
command
.
help
(
'groupadd'
)
jid
=
safeJID
(
args
[
0
]).
bare
group
=
args
[
1
]
if
len
(
args
)
==
1
:
group
=
args
[
0
]
item
=
self
.
roster_win
.
selected_row
if
isinstance
(
item
,
Contact
):
jid
=
item
.
bare_jid
elif
isinstance
(
item
,
Resource
):
jid
=
item
.
jid
else
:
return
self
.
core
.
command
.
help
(
'groupadd'
)
else
:
jid
=
safeJID
(
args
[
0
]).
bare
group
=
args
[
1
]
contact
=
roster
[
jid
]
if
contact
is
None
:
...
...
Administrator
@root
mentioned in issue
#1702 (closed)
·
Aug 21, 2018
mentioned in issue
#1702 (closed)
mentioned in issue #1702
Toggle commit list
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