[Bug 27687] new GIO-style async methods for requesting TpContacts

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon May 10 14:11:53 CEST 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27687

--- Comment #7 from Xavier Claessens <xclaesse at gmail.com> 2010-05-10 05:11:52 PDT ---
IIRC the reason we had (guint n_handles, TpHandle *handles) and not a GArray,
is to make it slightly easier for single-contact request. It's a pain to create
a GArray just for one handle, but it's easy to pass (1, &handle). Same for
by_id variant, (1, &id) is easy, but if you need it to be NULL-terminated it's
a pain.

Now if we consider having dedicated API for the single-contact request, I don't
think we have any reason anymore to not take a GArray of TpHandle or a
NULL-terminated GStrv. Also it looks even better to take a TpIntSet since the
multi-contact request almost certainly comes just after a
tp_channel_group_get_members().

Note about single-contact request API: One benefit is to have the same
_finish() function for both by_handle and _by_id variants. Like that we can use
the same callback in both cases. After all, it's just about giving a single
GError and TpContact, in both cases.

About TpContactFeature, one issue I see when thinking about droping the
EmpathyTpContactFactory wrapper is the set of features we want on all TpContact
created inside empathy. Atm we have a wrapper function around
tp_connection_get_contacts_by_handle/id() that doesn't take a feature set in
its args, but always gives the same feature set (actually all features) to
tp_connection_get_contacts_*().

So if TpContactFeature were falgs, I could just #define it somewhere and give
it everywhere I have a tp_connection_get_contacts_*(). The (guint n_feature,
TpContactFeature *features) way is a bit annoying IMO, we have to define a
feature array each time we need to request a contact. I understand flags are
dangerous in case we get more than 31 features (can it really happen?
implementation actually already uses flags).

Note that for consistency, we could use 0-terminated GQuark array.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list