[Evolution-hackers] Adding an email address to an EContact



Howdy -

I'm trying to write some C that adds an email address to an existing
EContact; here's what I've got:

EContact* ev_contact = E_CONTACT(get_contact());
EVCardAttribute* attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_TYPE), "WORK");
e_vcard_attribute_add_param_with_value (attr, e_vcard_attribute_param_new (EVC_X_DEST_EMAIL), "tom foo bar");
GList* email_attrs = g_list_append(NULL, attr);
e_contact_set_attributes (ev_contact, E_CONTACT_EMAIL, email_attrs)

That doesn't seem to do the trick, though... I must be doing something
wrong.  I've looked around the source code for a bit but I only seem to
be able to find examples of importing via the VCard format.  

Any help would be appreciated,

Thanks,

Tom




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