From 5af796712778c86fe6c013459714572caa5470f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 9 Dec 2018 00:01:18 +0100 Subject: [PATCH] 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. --- gajim/session.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gajim/session.py b/gajim/session.py index 4880246a4..7ed573ed7 100644 --- a/gajim/session.py +++ b/gajim/session.py @@ -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: