diff --git a/src/common/contacts.py b/src/common/contacts.py index bbe458e5b..5fac855bc 100644 --- a/src/common/contacts.py +++ b/src/common/contacts.py @@ -219,7 +219,13 @@ class Contacts: def contact_from_gc_contact(self, gc_contact): '''Create a Contact instance from a GC_Contact instance''' - return Contact(jid = gc_contact.get_full_jid(), name = gc_contact.name, + if gc_contact.jid: + jid = gc_contact.jid + resource = gc_contact.resource + else: + jid = gc_contact.get_full_jid() + resource = '' + return Contact(jid = jid, resource = resource, name = gc_contact.name, groups = ['none'], show = gc_contact.show, status = gc_contact.status, sub = 'none') diff --git a/src/groupchat_window.py b/src/groupchat_window.py index ebd9512d4..10fb8444a 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -1162,13 +1162,12 @@ current room topic.') % command, room_jid) def on_info(self, widget, room_jid, nick): '''Call vcard_information_window class to display user's information''' c = gajim.contacts.get_gc_contact(self.account, room_jid, nick) - jid = c.get_full_jid() - if gajim.interface.instances[self.account]['infos'].has_key(jid): - gajim.interface.instances[self.account]['infos'][jid].window.present() + # we create a Contact instance + c2 = gajim.contacts.contact_from_gc_contact(c) + if gajim.interface.instances[self.account]['infos'].has_key(c2.jid): + gajim.interface.instances[self.account]['infos'][c2.jid].window.present() else: - # we create a Contact instance - c2 = gajim.contacts.contact_from_gc_contact(c) - gajim.interface.instances[self.account]['infos'][jid] = \ + gajim.interface.instances[self.account]['infos'][c2.jid] = \ vcard.VcardWindow(c2, self.account, False) def on_history(self, widget, room_jid, nick):