Commit 5af79671 authored by Philipp Hörist's avatar Philipp Hörist

Find correct contact on private message

get_contact() returns also a contact if only the bare jid matches,
which for private messages is the groupchat contact object.
parent 1c09b507
......@@ -79,11 +79,13 @@ class ChatControlSession:
"""
if obj.session != self:
return
contact = app.contacts.get_contact(self.conn.name, obj.jid,
obj.resource)
if not contact:
contact = app.contacts.get_gc_contact(self.conn.name, obj.jid,
obj.resource)
if obj.muc_pm:
contact = app.contacts.get_gc_contact(
self.conn.name, obj.jid, obj.resource)
else:
contact = app.contacts.get_contact(
self.conn.name, obj.jid, obj.resource)
if self.resource != obj.resource:
self.resource = obj.resource
if self.control:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment