handle correctly messages from invisible resources
This commit is contained in:
parent
b2d4177962
commit
ae8c6e309e
|
@ -407,7 +407,8 @@ class Interface:
|
||||||
contact1 = gajim.contacts.copy_contact(contact1)
|
contact1 = gajim.contacts.copy_contact(contact1)
|
||||||
lcontact.append(contact1)
|
lcontact.append(contact1)
|
||||||
contact1.resource = resource
|
contact1.resource = resource
|
||||||
if contact1.jid.find('@') > 0 and len(lcontact) == 1: # It's not an agent
|
if contact1.jid.find('@') > 0 and len(lcontact) == 1:
|
||||||
|
# It's not an agent
|
||||||
if old_show == 0 and new_show > 1:
|
if old_show == 0 and new_show > 1:
|
||||||
if not contact1.jid in gajim.newly_added[account]:
|
if not contact1.jid in gajim.newly_added[account]:
|
||||||
gajim.newly_added[account].append(contact1.jid)
|
gajim.newly_added[account].append(contact1.jid)
|
||||||
|
@ -538,7 +539,7 @@ class Interface:
|
||||||
chat_control = self.msg_win_mgr.get_control(jid, account)
|
chat_control = self.msg_win_mgr.get_control(jid, account)
|
||||||
|
|
||||||
# Handle chat states
|
# Handle chat states
|
||||||
contact = gajim.contacts.get_contact(account, jid)
|
contact = gajim.contacts.get_contact(account, jid, resource)
|
||||||
if contact and isinstance(contact, list):
|
if contact and isinstance(contact, list):
|
||||||
contact = contact[0]
|
contact = contact[0]
|
||||||
if contact:
|
if contact:
|
||||||
|
|
|
@ -2795,6 +2795,19 @@ _('If "%s" accepts this request you will know his or her status.') % jid)
|
||||||
highest_contact = gajim.contacts.get_contact_with_highest_priority(
|
highest_contact = gajim.contacts.get_contact_with_highest_priority(
|
||||||
account, jid)
|
account, jid)
|
||||||
if not contact:
|
if not contact:
|
||||||
|
# If there is another resource, it may be a message from an invisible
|
||||||
|
# resource
|
||||||
|
lcontact = gajim.contacts.get_contacts_from_jid(account, jid)
|
||||||
|
if (len(lcontact) != 1 or lcontact[0].show != 'offline') and \
|
||||||
|
jid.find('@') > 0:
|
||||||
|
contact = gajim.contacts.copy_contact(highest_contact)
|
||||||
|
contact.resource = resource
|
||||||
|
contact.priority = 0
|
||||||
|
contact.show = 'offline'
|
||||||
|
contact.status = ''
|
||||||
|
gajim.contacts.add_contact(account, contact)
|
||||||
|
|
||||||
|
else:
|
||||||
# Default to highest prio
|
# Default to highest prio
|
||||||
fjid = jid
|
fjid = jid
|
||||||
resource_for_chat = None
|
resource_for_chat = None
|
||||||
|
|
Loading…
Reference in New Issue