fix TB when getting chatstate from contact not in roster of offline storaged chatstate
This commit is contained in:
parent
5957e968d7
commit
7b102e4813
30
src/gajim.py
30
src/gajim.py
|
@ -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!)
|
||||||
|
|
Loading…
Reference in New Issue