Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Yann Leboulanger
gajim
Commits
b0497464
Commit
b0497464
authored
Oct 05, 2018
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUC: Make print_status affect the 333 status code
parent
4f1a3a32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
gajim/groupchat_control.py
gajim/groupchat_control.py
+16
-14
No files found.
gajim/groupchat_control.py
View file @
b0497464
...
...
@@ -1837,6 +1837,14 @@ class GroupchatControl(ChatControlBase):
simple_jid
=
app
.
get_jid_without_resource
(
obj
.
real_jid
)
nick_jid
+=
' (%s)'
%
simple_jid
con
=
app
.
connections
[
self
.
account
]
bookmarks
=
con
.
get_module
(
'Bookmarks'
).
bookmarks
bookmark
=
bookmarks
.
get
(
self
.
room_jid
,
None
)
if
bookmark
is
None
or
not
bookmark
[
'print_status'
]:
print_status
=
app
.
config
.
get
(
'print_status_in_muc'
)
else
:
print_status
=
bookmark
[
'print_status'
]
# status_code
# http://www.xmpp.org/extensions/xep-0045.html#registrar-statuscodes-\
# init
...
...
@@ -1884,13 +1892,14 @@ class GroupchatControl(ChatControlBase):
if
obj
.
status_code
:
if
'333'
in
obj
.
status_code
:
# Handle 333 before 307, some MUCs add both
if
obj
.
nick
==
self
.
nick
:
s
=
_
(
'%s kicked us due to an error'
%
self
.
room_jid
)
else
:
s
=
_
(
'%s has left due to an error'
%
nick
)
if
obj
.
reason
:
s
+=
' (%s)'
%
obj
.
reason
self
.
print_conversation
(
s
,
'info'
,
graphics
=
False
)
if
print_status
!=
'none'
:
if
obj
.
nick
==
self
.
nick
:
s
=
_
(
'%s kicked us due to an error'
%
self
.
room_jid
)
else
:
s
=
_
(
'%s has left due to an error'
%
nick
)
if
obj
.
reason
:
s
+=
' (%s)'
%
obj
.
reason
self
.
print_conversation
(
s
,
'info'
,
graphics
=
False
)
elif
'307'
in
obj
.
status_code
:
if
obj
.
actor
is
None
:
# do not print 'kicked by None'
s
=
_
(
'%(nick)s has been kicked: %(reason)s'
)
%
{
...
...
@@ -2051,13 +2060,6 @@ class GroupchatControl(ChatControlBase):
and
(
not
obj
.
status_code
or
'303'
not
in
obj
.
status_code
)
and
not
\
right_changed
:
st
=
''
con
=
app
.
connections
[
self
.
account
]
bookmarks
=
con
.
get_module
(
'Bookmarks'
).
bookmarks
bookmark
=
bookmarks
.
get
(
self
.
room_jid
,
None
)
if
bookmark
is
None
or
not
bookmark
[
'print_status'
]:
print_status
=
app
.
config
.
get
(
'print_status_in_muc'
)
else
:
print_status
=
bookmark
[
'print_status'
]
if
obj
.
show
==
'offline'
:
if
obj
.
nick
in
self
.
attention_list
:
...
...
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