GNOME Bugzilla – Bug 420012
Evolution prevents e_contact_set() from working for IM screennames
Last modified: 2015-06-04 19:22:17 UTC
Please describe the problem: Evolution and an external program using Evolution Data Server's EContact objects can each handle IM screennames fine on their own. But my external program cannot correctly set some IM screenname fields modified through Evolution. Steps to reproduce: 1. Make a new contact "Foo Bar" in Evolution 2. In a separate program, run the code /* contact <- EContact* of "Foo Bar" */ e_contact_set (contact, E_CONTACT_IM_AIM_HOME_1, (gpointer) "aim-home-A"); e_contact_set (contact, E_CONTACT_IM_AIM_HOME_2, (gpointer) "aim-home-B"); if (e_book_commit_contact (pb->book, contact, &error) == FALSE) { /* I haven't seen this block execute during actual program execution */ g_warning ("Could not commit changes to address book, %s", error ? error->message : "no error given"); g_clear_error (&error); } 3. Print the VCard of "Foo Bar": ... X-AIM;TYPE=HOME:aim-home-A X-AIM;TYPE=HOME:aim-home-B ... 4. Observe that Evolution will read Foo Bar's AIM screennames as expected. 5. Open Foo Bar in the Evolution Contact Editor. Make the following changes in the appropriate GtkEntry widgets at the bottom of the dialog: "aim-home-A" -> "aim-home-C" "aim-home-B" -> "aim-home-D" 5. Print the VCard of "Foo Bar": ... X-AIM;TYPE=HOME;X-EVOLUTION-UI-SLOT=1:aim-home-C X-AIM;TYPE=HOME;X-EVOLUTION-UI-SLOT=2:aim-home-D ... 6. Re-execute the code in Step 2. 7. Print the VCard of "Foo Bar": ... X-AIM;TYPE=HOME;X-EVOLUTION-UI-SLOT=1:aim-home-B X-AIM;TYPE=HOME;X-EVOLUTION-UI-SLOT=2:aim-home-D ... Actual results: Notice in Step 7. that "aim-home-B" should be in "SLOT=2", but more importantly, that "aim-home-D" has remained and "aim-home-A" was not saved. The behavior seems consistent for every protocol and "type" (home/work) and extends to the *_3 fields (but I only used two in this example for simplicity). Expected results: Using e_contact_set() to set a contact field will change that field, and only that field. Does this happen every time? Yes. Other information: My program uses a single function to set most of the simple EContact fields (phone, email, IM names, Web URLS). I only have problems with the IM fields.
I think this is a consequence of the multi fields in contact. e_contact_set_property() in evolution-data-server/addressbook/libebook/e-contact.c contains some explanation why this is a difficult problem. A "quick fix" would probably lead to some other regression.
Seeing the comments in evolution-data-server/addressbook/libebook/e-contact.c this is likely still an issue in 3.5. Bumping version.
Created attachment 304611 [details] vcard-aim.c I just tested this in 3.12.11 and even there it works properly, thus it was fixed meanwhile. I' marking it as such.