From fc765088f7ce71f921c8d45fb43e62c17609cd41 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Mon, 22 Aug 2011 12:31:24 +0200
Subject: [PATCH] fix chat tab finding when we get a pm

---
 src/message_window.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/message_window.py b/src/message_window.py
index b3f0593ac3..eeae4bbcd1 100644
--- a/src/message_window.py
+++ b/src/message_window.py
@@ -1096,14 +1096,14 @@ class MessageWindowMgr(gobject.GObject):
         """
         fjid = jid
         if resource:
-            jid += '/' + resource
+            fjid += '/' + resource
         ctrl = self.get_control(fjid, account)
         if ctrl:
             return ctrl
         win = self.get_window(jid, account)
         if win:
             ctrl = win.get_control(jid, account)
-            if not ctrl.resource:
+            if not ctrl.resource and ctrl.type_id != message_control.TYPE_GC:
                 return ctrl
         return None
 
-- 
GitLab