open the vcard on the real jid in gc if we know it

This commit is contained in:
Yann Leboulanger 2006-01-08 00:17:05 +00:00
parent 044df9468f
commit d56a028423
2 changed files with 12 additions and 7 deletions

View File

@ -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')

View File

@ -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):