Skip to content
Snippets Groups Projects
Commit 7ece7dba authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Pull correct security catalog for private messages

parent 14bad789
No related branches found
No related tags found
No related merge requests found
...@@ -179,13 +179,21 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): ...@@ -179,13 +179,21 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
# text to show is in in first column of liststore # text to show is in in first column of liststore
self.seclabel_combo.add_attribute(cell, 'text', 0) self.seclabel_combo.add_attribute(cell, 'text', 0)
con = app.connections[self.account] 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: 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): def _sec_labels_received(self, event):
if event.account != self.account: if event.account != self.account:
return 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 return
model = self.seclabel_combo.get_model() model = self.seclabel_combo.get_model()
model.clear() model.clear()
...@@ -765,7 +773,10 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): ...@@ -765,7 +773,10 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
return return
con = app.connections[self.account] 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 labels, label_list, _ = catalog
lname = label_list[idx] lname = label_list[idx]
label = labels[lname] label = labels[lname]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment