save vcard when we get it

This commit is contained in:
Yann Leboulanger 2005-10-30 16:46:50 +00:00
parent 47fbe4b3cb
commit 60d8a8e9b3
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@ class Connection:
return return
if vc.getTag('vCard').getNamespace() == common.xmpp.NS_VCARD: if vc.getTag('vCard').getNamespace() == common.xmpp.NS_VCARD:
card = vc.getChildren()[0] card = vc.getChildren()[0]
path_to_file = os.path.join(gajim.VCARDPATH, frm)
fil = open(path_to_file, 'w')
fil.write(str(card))
fil.close()
for info in card.getChildren(): for info in card.getChildren():
name = info.getName() name = info.getName()
if name in ('ADR', 'TEL', 'EMAIL'): # we can have several if name in ('ADR', 'TEL', 'EMAIL'): # we can have several