If a simple app wants to just offers UI to add contacts, it needs to prepare TP_CONNECTION_FEATURE_CONTACT_LIST to grab the "can-change-contact-list" GObject property. This will also prepare all the contacts of the contact list which is a bit unfortunate. This is also a problem when starting to port Empathy to the new API. I need this property but not the full contact list as Folks prepares it for me. And while Folks doesn't use the new API, that means I'll have to prepare everything a second time for no reason.
Created attachment 53100 [details] [review] contact-list-client: make test path clearer
Created attachment 53102 [details] [review] test that contact list properties are set
Created attachment 53103 [details] [review] Add TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES This feature is now a dependency on TP_CONNECTION_FEATURE_CONTACT_LIST so it will be automatically prepared when preparing TP_CONNECTION_FEATURE_CONTACT_LIST (so we don't break existing code)
Comment on attachment 53103 [details] [review] Add TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES Review of attachment 53103 [details] [review]: ----------------------------------------------------------------- ::: telepathy-glib/connection-contact-list.c @@ +423,4 @@ > return; > } > > + /* Contacts will be prepared once the contact list has been fetched. I would add that it refers to fetching contacts in CM from server,and not client from CM. @@ +644,5 @@ > * Expands to a call to a function that returns a #GQuark representing the > * "contact-list" feature. > * > + * When this feature is prepared, the > + * TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES has been prepared, so the add a % before TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES ::: telepathy-glib/connection.c @@ +1663,5 @@ > need_contact_list[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST; > need_contact_list[1] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS; > features[FEAT_CONTACT_LIST].interfaces_needed = need_contact_list; > + need_contact_list_props[0] = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES; > + features[FEAT_CONTACT_LIST].depends_on = need_contact_list_props; Seems we use names need_foo to set interfaces_needed, but here you use need_contact_list_props for depends_on. I would rename it to depends_contact_list, meaning the features contact_list depends on. no?
(In reply to comment #4) > > + /* Contacts will be prepared once the contact list has been fetched. > > I would add that it refers to fetching contacts in CM from server,and not > client from CM. done. > @@ +644,5 @@ > > * Expands to a call to a function that returns a #GQuark representing the > > * "contact-list" feature. > > * > > + * When this feature is prepared, the > > + * TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES has been prepared, so the > > add a % before TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES done. > ::: telepathy-glib/connection.c > @@ +1663,5 @@ > > need_contact_list[0] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_LIST; > > need_contact_list[1] = TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACTS; > > features[FEAT_CONTACT_LIST].interfaces_needed = need_contact_list; > > + need_contact_list_props[0] = TP_CONNECTION_FEATURE_CONTACT_LIST_PROPERTIES; > > + features[FEAT_CONTACT_LIST].depends_on = need_contact_list_props; > > Seems we use names need_foo to set interfaces_needed, but here you use > need_contact_list_props for depends_on. I would rename it to > depends_contact_list, meaning the features contact_list depends on. no? Good point; I renamed it. Fixes are in http://cgit.collabora.com/git/user/cassidy/telepathy-glib/log/?h=contact-list-prop-42546 I'll squash them before merging if that's ok.
perfect, +1.
Merged to master; will be in 0.17.0.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.