Skip to content
Snippets Groups Projects
Commit 7b102e48 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

fix TB when getting chatstate from contact not in roster of offline storaged chatstate

parent 5957e968
No related branches found
No related tags found
No related merge requests found
...@@ -518,22 +518,22 @@ class Interface: ...@@ -518,22 +518,22 @@ class Interface:
contact = contact[0] contact = contact[0]
if contact: if contact:
contact.composing_jep = composing_jep contact.composing_jep = composing_jep
if chat_control and chat_control.type_id == message_control.TYPE_CHAT: if chat_control and chat_control.type_id == message_control.TYPE_CHAT:
if chatstate is not None: if chatstate is not None:
# other peer sent us reply, so he supports jep85 or jep22 # other peer sent us reply, so he supports jep85 or jep22
contact.chatstate = chatstate
if contact.our_chatstate == 'ask': # we were jep85 disco?
contact.our_chatstate = 'active' # no more
chat_control.handle_incoming_chatstate()
elif contact.chatstate != 'active':
# got no valid jep85 answer, peer does not support it
contact.chatstate = False
elif chatstate == 'active':
# Brand new message, incoming.
contact.our_chatstate = chatstate
contact.chatstate = chatstate contact.chatstate = chatstate
if contact.our_chatstate == 'ask': # we were jep85 disco? if msg_id: # Do not overwrite an existing msg_id with None
contact.our_chatstate = 'active' # no more contact.msg_id = msg_id
chat_control.handle_incoming_chatstate()
elif contact.chatstate != 'active':
# got no valid jep85 answer, peer does not support it
contact.chatstate = False
elif contact and chatstate == 'active':
# Brand new message, incoming.
contact.our_chatstate = chatstate
contact.chatstate = chatstate
if msg_id: # Do not overwrite an existing msg_id with None
contact.msg_id = msg_id
# THIS MUST BE AFTER chatstates handling # THIS MUST BE AFTER chatstates handling
# AND BEFORE playsound (else we here sounding on chatstates!) # AND BEFORE playsound (else we here sounding on chatstates!)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment