[Telepathy] TpChannelView

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 24 04:33:08 PDT 2010


On Tue, 24 Aug 2010 at 21:17:18 +1000, Danielle Madeley wrote:
> Perhaps TpBaseClient et al should take an optional TpBaseChannelFactory,
> which if not provided, defaults to TpChannelFactory.

Yes ish, but we can't use that naming, because we already have a
TpChannelFactory in CMs. Also, I think it should probably be a GInterface,
not a base class.

How about TpClientChannelFactory as the GInterface, and TpDefaultChannelFactory
as the reference implementation?

> TpBaseChannelFactory has one method you need to implement,
> create_channel, which gives you a path, and the properties, and expects
> you to call whatever preparation you need, eventually calling back to
> tp_base_channel_factory_channel_ready().

If it's expected to be async, I think it'd be better to have
create_channel_async and create_channel_finish, and use the GAsyncResult
pattern.

I wonder whether it should just be synchronous, and do the preparation
separately, though; if it's async, then we can't use it in any context
where we need an object synchronously. It seems better to allow for that -
we'd prefer to get an unprepared object of the right app-specific subclass
than an unprepared TpChannel, surely?

(I've already added support for having TpBaseClient wait for things to be,
prepared, asynchronously, so for that use-case it's redundant.)

See also https://bugs.freedesktop.org/show_bug.cgi?id=29451

    Simon


More information about the telepathy mailing list