update Contact instance in privateChatControl. see #4292
This commit is contained in:
parent
b9db39e0a9
commit
7d3bff5b58
|
@ -228,12 +228,14 @@ class ConnectionCaps(object):
|
|||
# we will put these into proper Contact object and ask
|
||||
# for disco... so that disco will learn how to interpret
|
||||
# these caps
|
||||
pm_ctrl = None
|
||||
jid = helpers.get_full_jid_from_iq(presence)
|
||||
contact = gajim.contacts.get_contact_from_full_jid(self.name, jid)
|
||||
if contact is None:
|
||||
room_jid, nick = gajim.get_room_and_nick_from_fjid(jid)
|
||||
contact = gajim.contacts.get_gc_contact(
|
||||
self.name, room_jid, nick)
|
||||
pm_ctrl = gajim.interface.msg_win_mgr.get_control(jid, self.name)
|
||||
if contact is None:
|
||||
# TODO: a way to put contact not-in-roster
|
||||
# into Contacts
|
||||
|
@ -267,6 +269,8 @@ class ConnectionCaps(object):
|
|||
contact.caps_node = node
|
||||
contact.caps_hash_method = hash_method
|
||||
contact.caps_hash = hash
|
||||
if pm_ctrl:
|
||||
pm_ctrl.update_contact()
|
||||
|
||||
def _capsDiscoCB(self, jid, node, identities, features, dataforms):
|
||||
contact = gajim.contacts.get_contact_from_full_jid(self.name, jid)
|
||||
|
|
|
@ -162,6 +162,9 @@ class PrivateChatControl(ChatControl):
|
|||
self.got_connected()
|
||||
ChatControl.update_ui(self)
|
||||
|
||||
def update_contact(self):
|
||||
self.contact = gajim.contacts.contact_from_gc_contact(self.gc_contact)
|
||||
|
||||
|
||||
class GroupchatControl(ChatControlBase):
|
||||
TYPE_ID = message_control.TYPE_GC
|
||||
|
|
Loading…
Reference in New Issue