Philipp Hörist pushed to branch master at gajim / gajim

Commits:
5173ca41 by Philipp Hörist at 2018-10-04T12:27:45Z
Pull correct security catalog for private messages

- - - - -


1 changed file:

- gajim/chat_control_base.py


Changes:

=====================================
gajim/chat_control_base.py
=====================================
@@ -179,13 +179,21 @@ class ChatControlBase(MessageControl, 
ChatCommandProcessor, CommandTools):
         # text to show is in in first column of liststore
         self.seclabel_combo.add_attribute(cell, 'text', 0)
         con = app.connections[self.account]
+        jid = self.contact.jid
+        if self.TYPE_ID == 'pm':
+            jid = self.gc_contact.room_jid
         if con.get_module('SecLabels').supported:
-            con.get_module('SecLabels').request_catalog(self.contact.jid)
+            con.get_module('SecLabels').request_catalog(jid)
 
     def _sec_labels_received(self, event):
         if event.account != self.account:
             return
-        if event.jid != self.contact.jid:
+
+        jid = self.contact.jid
+        if self.TYPE_ID == 'pm':
+            jid = self.gc_contact.room_jid
+
+        if event.jid != jid:
             return
         model = self.seclabel_combo.get_model()
         model.clear()
@@ -765,7 +773,10 @@ class ChatControlBase(MessageControl, 
ChatCommandProcessor, CommandTools):
             return
 
         con = app.connections[self.account]
-        catalog = con.get_module('SecLabels').get_catalog(self.contact.jid)
+        jid = self.contact.jid
+        if self.TYPE_ID == 'pm':
+            jid = self.gc_contact.room_jid
+        catalog = con.get_module('SecLabels').get_catalog(jid)
         labels, label_list, _ = catalog
         lname = label_list[idx]
         label = labels[lname]



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/5173ca415a6ef8c519ad36213800420c9b4cab89

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/5173ca415a6ef8c519ad36213800420c9b4cab89
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to