TpConnection:self-contact should be guaranteed to always have factory features prepared. It is already part of TP_CONNECTION_FEATURE_CORE to fetch the self TpContact but with 0 feature. Nowadays it does not cost more to prepare all needed features with GetContactAttributes.
Here is proposed fix: http://cgit.collabora.com/git/user/xclaesse/telepathy-glib.git/log/?h=self-contact It is a bit more complex than expected because we have to make sure the self contact is fetched late in connection's introspection so it has attribute ifaces.
(In reply to comment #1) > It is a bit more complex than expected because we have to make sure the self > contact is fetched late in connection's introspection so it has attribute > ifaces. Actually, you're allowed to blindly pass all the interfaces you want to GetContactAttributes() these days—but I guess tp-glib client side hasn't been updated to take advantage of that. (Or am I misunderstanding?) http://telepathy.freedesktop.org/spec/Connection_Interface_Contacts.html#Method:GetContactAttributes + /* FIXME: We should use tp_simple_client_factory_dup_contact(), but that would This function doesn't exist. (It is also mentioned in an existing comment in contact.c; perhaps you'd like to fix that at the same time.) The branch looks fine, functionally speaking: perhaps a test case would be nice?
(In reply to comment #2) > (In reply to comment #1) > > It is a bit more complex than expected because we have to make sure the self > > contact is fetched late in connection's introspection so it has attribute > > ifaces. > > Actually, you're allowed to blindly pass all the interfaces you want to > GetContactAttributes() these days—but I guess tp-glib client side hasn't been > updated to take advantage of that. (Or am I misunderstanding?) That would simplify stuff I guess. But atm in contacts_bind_to_signals() it ignore features wanted that does not have known interface. Actually this make me realize a possible race with contact-list feature: if I get ContactListState going to SUCCESS before the TpConnection got its contact attribute interfaces, it won't prepare all features on roster contacts. > + /* FIXME: We should use tp_simple_client_factory_dup_contact(), but that > would > > This function doesn't exist. (It is also mentioned in an existing comment in > contact.c; perhaps you'd like to fix that at the same time.) fixed > The branch looks fine, functionally speaking: perhaps a test case would be > nice? added Branch updated
(In reply to comment #3) > That would simplify stuff I guess. But atm in contacts_bind_to_signals() it > ignore features wanted that does not have known interface. Yeah, I don't think it needs changing before merging this branch. > Actually this make me realize a possible race with contact-list feature: if I > get ContactListState going to SUCCESS before the TpConnection got its contact > attribute interfaces, it won't prepare all features on roster contacts. This isn't a new issue introduced by this branch, right? Have you filed a bug for this?
thanks, merged.
(In reply to comment #4) > (In reply to comment #3) > > Actually this make me realize a possible race with contact-list feature: if I > > get ContactListState going to SUCCESS before the TpConnection got its contact > > attribute interfaces, it won't prepare all features on roster contacts. > > This isn't a new issue introduced by this branch, right? Have you filed a bug > for this? That's not new, reported to bug #40797
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.