Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def edit_own_details(self, account):
jid = gajim.get_jid_from_account(account)
if not self.instances[account]['infos'].has_key(jid):
self.instances[account]['infos'][jid] = \
vcard.VcardWindow(jid, account, True)
gajim.connections[account].request_vcard(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)
# 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:
gajim.interface.instances[self.account]['infos'][c2.jid] = \
vcard.VcardWindow(c2, self.account, False)
def on_information_button_clicked(self, widget):
(model, iter) = self.result_treeview.get_selection().get_selected()
if not iter:
return
jid = model[iter][self.jid_column]
if gajim.interface.instances[self.account]['infos'].has_key(jid):
gajim.interface.instances[self.account]['infos'][jid].window.present()
else:
contact = gajim.contacts.create_contact(jid = jid, name='', groups=[],
show='', status='', sub='', ask='', resource='', priority=0,
keyID='', our_chatstate=None, chatstate=None)
gajim.interface.instances[self.account]['infos'][jid] = \
vcard.VcardWindow(contact, self.account)
def on_info(self, widget, contact, account):
'''Call vcard_information_window class to display contact's information'''
info = gajim.interface.instances[account]['infos']
if info.has_key(contact.jid):
info[contact.jid].window.present()
else:
info[contact.jid] = vcard.VcardWindow(contact, account)
def on_info(self, widget, contact, account):
'''Call vcard_information_window class to display contact's information'''
info = gajim.interface.instances[account]['infos']
if info.has_key(contact.jid):
info[contact.jid].window.present()
else:
info[contact.jid] = vcard.VcardWindow(contact, account)
def on_info(self, widget, nick):
'''Call vcard_information_window class to display user's information'''
c = gajim.contacts.get_gc_contact(self.account, self.room_jid, nick)
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:
gajim.interface.instances[self.account]['infos'][c2.jid] = \
vcard.VcardWindow(c2, self.account, c)
'''Call vcard_information_window class to display user's information'''
c = gajim.contacts.get_gc_contact(self.account, room_jid, nick)
if c.jid and c.resource:
# on GC, we know resource only if we're mod and up
jid = c.jid
fjid = c.jid + '/' + c.resource
else:
fjid = gajim.construct_fjid(room_jid, nick)
jid = fjid
if gajim.interface.instances[self.account]['infos'].has_key(jid):
gajim.interface.instances[self.account]['infos'][jid].window.present()
else:
# we copy contact because c.jid must contain the fakeJid for vcard
c2 = gajim.contacts.contact_from_gc_contact(c)
gajim.interface.instances[self.account]['infos'][jid] = \
vcard.VcardWindow(c2, self.account, False)
def on_info(self, widget, contact, account):
'''Call vcard_information_window class to display contact's information'''
info = gajim.interface.instances[account]['infos']
if info.has_key(contact.jid):
info[contact.jid].window.present()
else:
info[contact.jid] = vcard.VcardWindow(contact, account)