don't show "file-send-real-jid-is-known-warning" dialog when contact is known. see #3948

This commit is contained in:
Yann Leboulanger 2009-04-07 11:08:12 +00:00
parent 3f9965972a
commit 2fc1532104
1 changed files with 12 additions and 9 deletions

View File

@ -1010,15 +1010,18 @@ class GroupchatControl(ChatControlBase):
self_contact = gajim.contacts.get_gc_contact(self.account, self.room_jid, self_contact = gajim.contacts.get_gc_contact(self.account, self.room_jid,
self.nick) self.nick)
if self.is_anonymous and gc_contact.affiliation not in ['admin', 'owner']\ if self.is_anonymous and gc_contact.affiliation not in ['admin', 'owner']\
and self_contact.affiliation in ['admin', 'owner']: and self_contact.affiliation in ['admin', 'owner'] and \
prim_text = _('Really send file?') gc_contact.jid not in gajim.contacts.get_jid_list(self.account):
sec_text = _('If you send a file to %s, he/she will know your real ' contact = gajim.contacts.get_contact(self.account, gc_contact.jid)
'Jabber ID.') % gc_contact.name if not contact or contact.sub not in ('both', 'to'):
dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text, prim_text = _('Really send file?')
on_response_ok = (_on_send_files, gc_contact)) sec_text = _('If you send a file to %s, he/she will know your real '
dialog.popup() 'Jabber ID.') % gc_contact.name
else: dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text,
_on_send_files(gc_contact) on_response_ok = (_on_send_files, gc_contact))
dialog.popup()
return
_on_send_files(gc_contact)
def draw_contact(self, nick, selected=False, focus=False): def draw_contact(self, nick, selected=False, focus=False):
iter_ = self.get_contact_iter(nick) iter_ = self.get_contact_iter(nick)