GNOME Bugzilla – Bug 630421
Empathy fails to support multiple TEL fields in ContactInfo
Last modified: 2011-08-29 10:12:43 UTC
If a CM supports multiple different telephone fields for the ContactInfo interface, empathy does not support them properly. For example: - CM returns 3 different telephone fields in ContactInfo.SupportedFields - TEL TYPE=HOME - TEL TYPE=WORK - TEL TYPE=CELL - In empathy, open personal details (Edit > Personal Information) - empathy queries the CM for ContactInfo - the CM returns only a single TEL field with TYPE=HOME - empathy displays 3 different "Phone Number:" fields, all containing the same phone number returned for TYPE=HOME - When closing the "Personal Information" dialog, empathy calls SetContactInfo to set the user's ContactInfo - Since the home phone number is displayed in all three fields, the home phone number ends up being saved to the work and mobile phone numbers as well.
Could you test with this branch please? http://git.Collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/contact-info-630421
It does seem to fix my particular issue, but after looking at the code I don't think it's a complete fix. For instance: - field_spec_match_field() seems to assume that spec->flags == TP_CONTACT_INFO_FIELD_FLAG_PARAMETERS_EXACT when matching fields. If the flag is not specified, there might be more or less parameters in field->parameters than there are in spec->parameters. - Even in the case that there are the same number of parameters in each list, field_spec_match_field() assumes that both field->parameters and spec->parameters are sorted in the same order. I'm not sure that this is a valid assumption.
Right, I think we should just refactor this code to make it work in the other way. We should iterate over the fields returned by tp_contact_get_contact_info() and then add those from tp_connection_get_contact_info_supported_fields() which have not be set previoulsy. But that's a big enough refactoring to not backport it to 2.32 so this specific bug won't be solved in 2.32.
Created attachment 172835 [details] [review] http://git.Collabora.co.uk/?p=user/cassidy/empathy;a=shortlog;h=refs/heads/contact-info-630421 libempathy-gtk/empathy-contact-widget.c | 152 ++++++++++++++++++++++--------- 1 files changed, 107 insertions(+), 45 deletions(-)
Here is a new version, can you take a look please?
Review of attachment 172835 [details] [review]: Code looks fine. Didn't comprehensively test it.
Thanks; merged to master. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.