Author: asterix
Date: 2007-09-13 00:06:07 +0200 (Thu, 13 Sep 2007)
New Revision: 8807
Modified:
trunk/src/gajim.py
Log:
accept file transfert request from contact not in our roster
Modified: trunk/src/gajim.py
===================================================================
--- trunk/src/gajim.py 2007-09-12 14:44:45 UTC (rev 8806)
+++ trunk/src/gajim.py 2007-09-12 22:06:07 UTC (rev 8807)
@@ -1648,7 +1648,16 @@
def handle_event_file_request(self, account, array):
jid = array[0]
if jid not in gajim.contacts.get_jid_list(account):
- return
+ keyID = ''
+ attached_keys = gajim.config.get_per('accounts', account,
+ 'attached_gpg_keys').split()
+ if jid in attached_keys:
+ keyID = attached_keys[attached_keys.index(jid) + 1]
+ contact = gajim.contacts.create_contact(jid = jid, name = '',
+ groups = [_('Not in Roster')], show = 'not in roster', status = '',
+ sub = 'none', keyID = keyID)
+ gajim.contacts.add_contact(account, contact)
+ self.roster.add_contact_to_roster(contact.jid, account)
file_props = array[1]
contact = gajim.contacts.get_first_contact_from_jid(account, jid)