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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 22 17:48:48 CEST 2010


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

Simon McVittie <simon.mcvittie at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |WIP

--- Comment #2 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-04-22 08:48:48 PDT ---
Since the commit message explicitly says "WIP", I assume you just want API
comments and don't actually consider this to be good to merge yet? As such, I
mostly haven't reviewed the code yet, just the APIs.

The abuse of weak_object to pass through a strong reference is an interesting
hack, but wouldn't it be better to just use the user_data argument? Then
telepathy-glib wouldn't waste time setting up and tearing down a weak ref!
(Also, you seem to leak the result at the end.)

> +void tp_connection_get_contacts_by_id_async (TpConnection *self,
> +    guint n_ids, const gchar * const *ids, guint n_features,
> +    const TpContactFeature *features, GAsyncReadyCallback callback,
> +    gpointer user_data);

If the idea of this method is to be more binding-friendly at the cost of being
less C-friendly, perhaps the IDs should be NULL-terminated (so bindings can
claim it's a "const GStrv"), or a GList?

I'm not sure how we'd represent lists of features or handles in a binding-happy
way; I suppose the answer is that we wait for your g-i bug reports to be fixed,
or fix them ourselves :-/

> + * @self: A connection, which must be ready (#TpConnection:connection-ready
> + *  must be %TRUE)

This should be documented in terms of the CORE and CONNECTED features in new
code. Perhaps this method should even wait for CONNECTED automatically if
necessary?

> + * @successful_requests: (out) (transfer none) (element-type utf8 TelepathyGLib.Contact): map of identifiers to successfully created #TpContact<!-- -->s

This line is huge, can you wrap it?

It would be good to say explicitly that the keys are what the caller asked for,
not the normalized version (i.e. if you request "Fred.Bloggs" on a protocol
where normalization includes lower-casing, you get back a map { "Fred.Bloggs":
<a TpContact whose identifier is "fred.bloggs"> }.

-- 
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