Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
6a50a96b
Commit
6a50a96b
authored
14 years ago
by
Alexander Cherniuk
Browse files
Options
Downloads
Patches
Plain Diff
Reimplemented the /names command
parent
99aa440f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/command_system/implementation/standard.py
+18
-17
18 additions, 17 deletions
src/command_system/implementation/standard.py
with
18 additions
and
17 deletions
src/command_system/implementation/standard.py
+
18
−
17
View file @
6a50a96b
...
...
@@ -224,7 +224,7 @@ class StandardChatCommands(CommandContainer):
"""
AUTOMATIC
=
True
HOSTS
=
(
ChatCommands
,
)
HOSTS
=
ChatCommands
,
class
StandardPrivateChatCommands
(
CommandContainer
):
"""
...
...
@@ -233,7 +233,7 @@ class StandardPrivateChatCommands(CommandContainer):
"""
AUTOMATIC
=
True
HOSTS
=
(
PrivateChatCommands
,
)
HOSTS
=
PrivateChatCommands
,
class
StandardGroupChatCommands
(
CommandContainer
):
"""
...
...
@@ -242,7 +242,7 @@ class StandardGroupChatCommands(CommandContainer):
"""
AUTOMATIC
=
True
HOSTS
=
(
GroupChatCommands
,
)
HOSTS
=
GroupChatCommands
,
@command
(
raw
=
True
)
@doc
(
_
(
"
Change your nickname in a group chat
"
))
...
...
@@ -330,23 +330,24 @@ class StandardGroupChatCommands(CommandContainer):
@command
@doc
(
_
(
"
Display names of all group chat occupants
"
))
def
names
(
self
,
verbose
=
False
):
g
et_contact
=
lambda
nick
:
gajim
.
contacts
.
get_gc_contact
(
self
.
account
,
self
.
room_jid
,
nick
)
nicks
=
gajim
.
contacts
.
get_nick_list
(
self
.
account
,
self
.
room_jid
)
g
gc
=
gajim
.
contacts
.
get_gc_contact
gnl
=
gajim
.
contacts
.
get_nick_list
# First we do alpha-numeric sort and then role-based one.
nicks
.
sort
()
nicks
.
sort
(
key
=
lambda
nick
:
get_
cont
act
(
nick
).
role
)
get_contact
=
lambda
nick
:
ggc
(
self
.
account
,
self
.
room_jid
,
nick
)
get_role
=
lambda
nick
:
get_contact
(
nick
).
role
nicks
=
gnl
(
self
.
ac
co
u
nt
,
self
.
room_jid
)
if
verbose
:
for
nick
in
nicks
:
contact
=
get_contact
(
nick
)
nicks
=
sorted
(
nicks
)
nicks
=
sorted
(
nicks
,
key
=
get_role
)
role
=
helpers
.
get_uf_role
(
contact
.
role
)
affiliation
=
helpers
.
get_uf_affiliation
(
contact
.
affiliation
)
if
not
verbose
:
return
"
,
"
.
join
(
nicks
)
self
.
echo
(
"
%s - %s - %s
"
%
(
nick
,
role
,
affiliation
))
else
:
return
'
,
'
.
join
(
nicks
)
for
nick
in
nicks
:
contact
=
get_contact
(
nick
)
role
=
helpers
.
get_uf_role
(
contact
.
role
)
affiliation
=
helpers
.
get_uf_affiliation
(
contact
.
affiliation
)
self
.
echo
(
"
%s - %s - %s
"
%
(
nick
,
role
,
affiliation
))
@command
(
'
ignore
'
,
raw
=
True
)
@doc
(
_
(
"
Forbid an occupant to send you public or private messages
"
))
...
...
@@ -356,4 +357,4 @@ class StandardGroupChatCommands(CommandContainer):
@command
(
'
unignore
'
,
raw
=
True
)
@doc
(
_
(
"
Allow an occupant to send you public or private messages
"
))
def
unblock
(
self
,
who
):
self
.
on_unblock
(
None
,
who
)
self
.
on_unblock
(
None
,
who
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment