Need ContactMonitor helper
@gdesmott
Submitted by Guillaume Desmottes Assigned to Telepathy bugs list
Description
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.