diff --git a/src/dialogs.py b/src/dialogs.py index d90e255d5..7a4a4b6a0 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -678,15 +678,14 @@ class SubscriptionRequestWindow: if gajim.interface.instances[self.account]['infos'].has_key(self.jid): gajim.interface.instances[self.account]['infos'][self.jid].window.present() else: + contact = gajim.contacts.create_contact(jid = self.jid, name='', + groups=[], show='', status='', sub='', ask='', resource='', + priority=5, keyID='', our_chatstate=None, chatstate=None) gajim.interface.instances[self.account]['infos'][self.jid] = \ - vcard.VcardWindow(self.jid, self.account, True) - #remove the publish / retrieve buttons - vcard_xml = gajim.interface.instances[self.account]['infos'][self.jid].xml - hbuttonbox = vcard_xml.get_widget('information_hbuttonbox') - children = hbuttonbox.get_children() - hbuttonbox.remove(children[0]) - hbuttonbox.remove(children[1]) - vcard_xml.get_widget('nickname_label').set_text(self.jid) + vcard.VcardWindow(contact, self.account) + # Remove jabber page + gajim.interface.instances[self.account]['infos'][self.jid].xml.\ + get_widget('information_notebook').remove_page(0) gajim.connections[self.account].request_vcard(self.jid) def on_deny_button_clicked(self, widget): diff --git a/src/vcard.py b/src/vcard.py index b76382f3b..8cde0348b 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -88,7 +88,7 @@ class VcardWindow: self.publish_button.set_no_show_all(True) self.retrieve_button.set_no_show_all(True) - self.contact = contact #don't use it if vcard is true + self.contact = contact # don't use it if vcard is true self.account = account self.vcard = vcard self.avatar_mime_type = None @@ -137,6 +137,11 @@ class VcardWindow: return # update contact.name if it's not '' name_entry = self.xml.get_widget('nickname_entry') + if not name_entry: + # This can happen when we don't show jabber page. For exemple when we + # show the vcard of a contact that request our subscription + self.window.destroy() + return new_name = name_entry.get_text().decode('utf-8') if new_name != self.contact.name and new_name != '': self.contact.name = new_name