[Bug 13422] Add nice API for channel creation

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 13 17:56:24 CEST 2010


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

--- Comment #13 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-07-13 08:56:23 PDT ---
(In reply to comment #12)
> Isn't that what I did in
> http://git.collabora.co.uk/?p=user/cassidy/telepathy-glib;a=commitdiff;h=2a4047d81dbed1afd7525d9755f0f681b4b0502b
> ?

Sorry, I was reviewing an older version.

If you don't convert request_ctx into a TpBaseClient subclass, its name should
be in CamelCase anyway, because it's a type.

You seem to have a lot of non-breaking spaces in your docs, notably in
tp_account_ensure_and_handle_channel_async. Please set your editor to highlight
them - in particular, I suspect they break GObject-Introspection annotations.

> > > +  if (tp_cli_channel_request_connect_to_failed (ctx->chan_request,
> > > +      channel_request_failed_cb, ctx, NULL,
> > > +      G_OBJECT (ctx->result), &err) == NULL)
> > 
> > Connect to TpProxy::invalidated, so you'll handle an MC crash correctly.
> > Succeeded maps to TP_DBUS_ERROR_OBJECT_REMOVED, so you'll need to ignore that
> > case with g_error_matches(), if you wanted to ignore Succeeded.

tp_channel_request_failed_cb() invalidates it with an error other than
TP_DBUS_ERROR_OBJECT_REMOVED, and Succeeded with TP_DBUS_ERROR_OBJECT_REMOVED,
so you don't need to watch for the individual signals at all - just use
invalidated. The purpose of invalidated is to give you a single code path for
all the possible reasons why your object caught fire and sank into the swamp
:-)

Doing that will also mean you don't need to worry about disconnecting from
Failed and Succeeded when the context is freed, which you don't seem to do at
the moment anyway.

Either tp_account_ensure_and_handle_channel_async or
tp_account_ensure_and_handle_channel_finish or both should document that in
particular, if the channel goes to a different handler, you'll see
TP_ERROR_NOT_YOURS.

> tp_account_ensure_and_handle_channel_finish ()

Use foo() in gtk-doc, to make a hyperlink.

I haven't reviewed the tests yet.

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