I'm adding tube support to a game and have to say that the barrier entry is still pretty big. If you want to get the list of contacts supporting a specific tube type you have to: - Instantiate and prepare an account manager - Iterate over the accounts and prepare them - Once an account is ready, get is connection and wait it's ready - Make an EnsureChannel() call per contact list channel. - Instantiate a TpChannel and wait it's ready. - Get the members and call GetContactCapabilities() - Iterate over the caps and call tp_connection_get_contacts_by_handle() with the handles supporting the desired tube. - Finally, you have the TpContacts supporting the tube! Each of these points is a separated function; and we don't even support updating yet! TpGlib should have a ContactMonitor object (or something like that) to which you pass the kind of channels you want to be supported, does all that boring job for you and returns a list of TpContact. It would also connect the needed signals and notify you when new contacts are added and removed.
First, we should have telepathy-qt4-style API for the contact lists (some views of a single merged list, in terms of TpContact objects); then we can add views that are filtered by capability. I'll clone this bug to represent the first part. I'd anticipate this being in terms of a caller-supplied predicate closure (function/user_data pair), which, given an aa{sv}, tells you whether it is acceptable or not; we could provide some sample predicates, like one each for stream and D-Bus tubes (with user_data = the tube service as a string).
Most of this is covered by bug #38142 and bug #26205, the remaining part is getting channel contacts and that's on bug #38248.
Let's make this dup of bug #38248 since it would fix this bug as well, and has a branch already. *** This bug has been marked as a duplicate of bug 38248 ***
This bug is not closed yet. Getting all the initial connections is indeed much easier but it's still a pain to track update (new account, new connection, etc).
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/25.
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.