The previous code called e_contact_get_attributes() which returns
a copy of the attributes, and tried to remove it with
e_vcard_remove_attribute () which matches on pointer values, so
it always failed.
/* First let's remove everything */
foreach (var field_id in im_eds_map.get_values ())
{
- /* Technically it's a (transfer full) list, but remove_attribute()
- * swallows ownership. */
- GLib.List<unowned VCardAttribute> attrs =
- contact.get_attributes (field_id);
- foreach (var attr in attrs)
- {
- contact.remove_attribute (attr);
- }
+ contact.remove_attributes (null, E.Contact.vcard_attribute (field_id));
}
foreach (var proto in im_fds.get_keys ())