[Evolution-hackers] ECard weirdness



Hi, 

I'm trying to modify Evolution so that when you send an email, the
recipients of the message are automatically added to your default
address book, if they're not already there. 

(I'm not suggesting that this should go into Evolution; it's just
something people at my company want. I'm aware of all the easy ways to
do this, like going into your sent folder and clicking on the
addresses.) 

In any case, I've put some stuff in mail-callbacks.c, in
composer_send_cb(). I'm creating a new ECard from a VCard string. I
search for the address using e_book_address_query_default(), and set the
callback from that to a function that adds my ECard to the address book,
using e_book_add(). This way I can add my ECard only if there isn't
already a contact with the same address. 

This only sort of works. Sometimes the email address doesn't get set
properly, sometimes it does. Sometimes Evolution segfaults (often in
e_book_get_vcard, which I run on my newly-created ECard for debug
output), sometimes it doesn't. I also noticed that the e-card test
program, when creating an ECard from a VCard, doesn't seem to get the
email addresses right. 

Is there a better way to make ECards? Should I make empty ones
(e_card_new("")) and then set all the properties? What are the
formatting rules for making ECards from VCards? I've seen it done with
"\r\n" and just "\n" newlines, and tried both of those; are there any
other requirements? 

Thanks, 
Peter




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]