Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
poezio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
204
Issues
204
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poezio
poezio
Commits
1ef7d588
Commit
1ef7d588
authored
Sep 02, 2010
by
louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little cleanup on user status change
parent
91bb99a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
27 deletions
+33
-27
src/gui.py
src/gui.py
+33
-27
No files found.
src/gui.py
View file @
1ef7d588
...
...
@@ -239,33 +239,7 @@ class Gui(object):
self
.
on_user_leave_groupchat
(
room
,
user
,
jid
,
status
,
from_nick
,
from_room
)
# status change
else
:
# build the message
msg
=
_
(
'%s changed his/her status: '
)
%
from_nick
if
affiliation
!=
user
.
affiliation
:
msg
+=
_
(
'affiliation: %s,'
)
%
affiliation
if
role
!=
user
.
role
:
msg
+=
_
(
'role: %s,'
)
%
role
if
show
!=
user
.
show
and
show
in
SHOW_NAME
.
keys
():
msg
+=
_
(
'show: %s,'
)
%
SHOW_NAME
[
show
]
if
status
!=
user
.
status
:
msg
+=
_
(
'status: %s,'
)
%
status
msg
=
msg
[:
-
1
]
# remove the last ","
hide_status_change
=
config
.
get
(
'hide_status_change'
,
-
1
)
if
config
.
get
(
'hide_status_change'
,
-
1
)
>=
-
1
else
-
1
if
(
hide_status_change
==
-
1
or
\
user
.
has_talked_since
(
hide_status_change
)
or
\
user
.
nick
==
room
.
own_nick
)
\
and
\
(
affiliation
!=
user
.
affiliation
or
\
role
!=
user
.
role
or
\
show
!=
user
.
show
or
\
status
!=
user
.
status
):
# display the message in the room
self
.
add_message_to_room
(
room
,
msg
)
private_room
=
self
.
get_room_by_name
(
'%s/%s'
%
(
from_room
,
from_nick
))
if
private_room
:
# display the message in private
self
.
add_message_to_room
(
private_room
,
msg
)
# finally, effectively change the user status
user
.
update
(
affiliation
,
show
,
status
,
role
)
self
.
on_user_change_status
(
room
,
user
,
from_nick
,
from_room
,
affiliation
,
role
,
show
,
status
)
if
room
==
self
.
current_room
():
self
.
window
.
user_win
.
refresh
(
room
.
users
)
self
.
window
.
input
.
refresh
()
...
...
@@ -349,6 +323,38 @@ class Gui(object):
else
:
self
.
add_message_to_room
(
private_room
,
_
(
'%(spec)s [%(nick)s] has left the room (%(status)s)'
)
%
{
'nick'
:
from_nick
,
'spec'
:
theme
.
CHAR_QUIT
,
'status'
:
status
},
colorized
=
True
)
def
on_user_change_status
(
self
,
room
,
user
,
from_nick
,
from_room
,
affiliation
,
role
,
show
,
status
):
"""
When an user changes her status
"""
# build the message
msg
=
_
(
'%s changed his/her status: '
)
%
from_nick
if
affiliation
!=
user
.
affiliation
:
msg
+=
_
(
'affiliation: %s,'
)
%
affiliation
if
role
!=
user
.
role
:
msg
+=
_
(
'role: %s,'
)
%
role
if
show
!=
user
.
show
and
show
in
SHOW_NAME
.
keys
():
msg
+=
_
(
'show: %s,'
)
%
SHOW_NAME
[
show
]
if
status
!=
user
.
status
:
msg
+=
_
(
'status: %s,'
)
%
status
msg
=
msg
[:
-
1
]
# remove the last ","
hide_status_change
=
config
.
get
(
'hide_status_change'
,
-
1
)
if
config
.
get
(
'hide_status_change'
,
-
1
)
>=
-
1
else
-
1
if
(
hide_status_change
==
-
1
or
\
user
.
has_talked_since
(
hide_status_change
)
or
\
user
.
nick
==
room
.
own_nick
)
\
and
\
(
affiliation
!=
user
.
affiliation
or
\
role
!=
user
.
role
or
\
show
!=
user
.
show
or
\
status
!=
user
.
status
):
# display the message in the room
self
.
add_message_to_room
(
room
,
msg
)
private_room
=
self
.
get_room_by_name
(
'%s/%s'
%
(
from_room
,
from_nick
))
if
private_room
:
# display the message in private
self
.
add_message_to_room
(
private_room
,
msg
)
# finally, effectively change the user status
user
.
update
(
affiliation
,
show
,
status
,
role
)
def
on_message
(
self
,
message
):
"""
When receiving private message from a muc OR a normal message
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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