changeset 8b1276a8a6c3 in /home/hg/repos/gajim

author: Yann Leboulanger <aste...@lagaule.org>
branches: 
details:http://hg.gajim.org/gajim?cmd=changeset;node=8b1276a8a6c3
description: update control.contact when we get a message from another 
resource. Fixes #7919

diffstat:

 src/session.py |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 17a957a2f2b9 -r 8b1276a8a6c3 src/session.py
--- a/src/session.py    Tue May 12 09:41:58 2015 +0200
+++ b/src/session.py    Sun May 17 15:40:42 2015 +0200
@@ -65,10 +65,14 @@
         """
         if obj.session != self:
             return
+        contact = gajim.contacts.get_contact(self.conn.name, obj.jid,
+            obj.resource)
         if self.resource != obj.resource:
             self.resource = obj.resource
-            if self.control and self.control.resource:
-                self.control.change_resource(self.resource)
+            if self.control:
+                self.control.contact = contact
+                if self.control.resource:
+                    self.control.change_resource(self.resource)
 
         if obj.mtype == 'chat':
             if not obj.stanza.getTag('body') and obj.chatstate is None:
@@ -114,8 +118,6 @@
             obj.mtype = 'pm'
 
         # Handle chat states
-        contact = gajim.contacts.get_contact(self.conn.name, obj.jid,
-            obj.resource)
         if contact and (not obj.forwarded or not obj.sent):
             if self.control and self.control.type_id == \
             message_control.TYPE_CHAT:
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to