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
gajim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
205
Issues
205
List
Boards
Labels
Service Desk
Milestones
Merge Requests
22
Merge Requests
22
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gajim
gajim
Commits
2a8d5739
Commit
2a8d5739
authored
Dec 09, 2018
by
Philipp Hörist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MUC: Identify subject change correctly
Fixes #9491
parent
5af79671
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
14 deletions
+13
-14
gajim/common/connection_handlers_events.py
gajim/common/connection_handlers_events.py
+0
-9
gajim/common/modules/message.py
gajim/common/modules/message.py
+9
-1
gajim/groupchat_control.py
gajim/groupchat_control.py
+2
-2
gajim/roster_window.py
gajim/roster_window.py
+2
-2
No files found.
gajim/common/connection_handlers_events.py
View file @
2a8d5739
...
...
@@ -432,15 +432,6 @@ def generate(self):
# message from server
self
.
nick
=
''
self
.
subject
=
self
.
stanza
.
getSubject
()
if
self
.
subject
is
not
None
:
app
.
nec
.
push_incoming_event
(
nec
.
NetworkEvent
(
'gc-subject-received'
,
nickname
=
self
.
msg_obj
.
resource
,
**
vars
(
self
.
msg_obj
)))
return
conditions
=
self
.
stanza
.
getStatusConditions
()
if
conditions
:
self
.
status_code
=
[]
...
...
gajim/common/modules/message.py
View file @
2a8d5739
...
...
@@ -227,7 +227,10 @@ def _on_message_decrypted(self, event):
subject
=
event
.
stanza
.
getSubject
()
groupchat
=
event
.
mtype
==
'groupchat'
muc_subject
=
subject
and
groupchat
# XEP-0045: only a message that contains a <subject/> but no <body/>
# element shall be considered a subject change for MUC purposes.
muc_subject
=
subject
and
groupchat
and
not
event
.
msgtxt
# Determine timestamps
if
groupchat
:
...
...
@@ -284,6 +287,11 @@ def _on_message_decrypted(self, event):
event
.
session
,
event
.
fjid
,
timestamp
)
return
if
muc_subject
:
app
.
nec
.
push_incoming_event
(
NetworkEvent
(
'gc-subject-received'
,
**
vars
(
event
)))
return
if
groupchat
:
app
.
nec
.
push_incoming_event
(
GcMessageReceivedEvent
(
None
,
...
...
gajim/groupchat_control.py
View file @
2a8d5739
...
...
@@ -1535,7 +1535,7 @@ def set_subject(self, subject):
self
.
draw_banner_text
()
def
_nec_gc_subject_received
(
self
,
event
):
if
event
.
conn
.
name
!=
self
.
account
:
if
event
.
account
!=
self
.
account
:
return
if
event
.
jid
!=
self
.
room_jid
:
return
...
...
@@ -1544,7 +1544,7 @@ def _nec_gc_subject_received(self, event):
return
self
.
set_subject
(
event
.
subject
)
text
=
_
(
'%(nick)s has set the subject to %(subject)s'
)
%
{
'nick'
:
event
.
nicknam
e
,
'subject'
:
event
.
subject
}
'nick'
:
event
.
resourc
e
,
'subject'
:
event
.
subject
}
if
event
.
delayed
:
date
=
time
.
strftime
(
'%d-%m-%Y %H:%M:%S'
,
...
...
gajim/roster_window.py
View file @
2a8d5739
...
...
@@ -2700,10 +2700,10 @@ def _nec_update_avatar(self, obj):
def
_nec_gc_subject_received
(
self
,
obj
):
contact
=
app
.
contacts
.
get_contact_with_highest_priority
(
obj
.
conn
.
name
,
obj
.
jid
)
obj
.
account
,
obj
.
jid
)
if
contact
:
contact
.
status
=
obj
.
subject
self
.
draw_contact
(
obj
.
jid
,
obj
.
conn
.
name
)
self
.
draw_contact
(
obj
.
jid
,
obj
.
account
)
def
_nec_metacontacts_received
(
self
,
obj
):
self
.
redraw_metacontacts
(
obj
.
conn
.
name
)
...
...
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