[Bug 49215] Move chat state to TpTextChannel

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 30 15:10:43 CEST 2012


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

--- Comment #9 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-04-30 06:10:43 PDT ---
(In reply to comment #8)
> I think this should go in the TpProxyFeature docs, perhaps this:
> 
> @prepare_async: if not %NULL, called when preparing the feature is requested.
>  May be %NULL for features whose preparation starts automatically (for
>  instance from the proxy's #GObjectClass.constructed virtual method);
>  if so, the subclass is still expected to call FIXME when the feature
>  has been prepared.
> 
> However, the "FIXME" there still needs replacing... because out-of-tree proxies
> still can't usefully add features, because the ability to say "it worked!" is
> still internal-only API! I'll (re)open a bug.

On (much) closer inspection of the implementation, it goes like this.

Things outside telepathy-glib must have a non-%NULL implementation. It can do
any of these:

  * Succeed. Job done.

  * Fail with a GError. That feature is marked as failed.
    Nothing else really happens, and the GError is almost ignored.
    The overall tp_proxy_prepare_async() call still succeeds.

  * Invalidate the proxy, then fail with a GError (in that order).
    The entire proxy is useless now; tp_proxy_prepare_async() fails
    with the invalidation error, and the GError from 
    TpProxyFeature.prepare_async is ignored. Useful for TpChannel,
    TpConnection and anything else stateful.

It is not correct to fail with a GError, and then immediately invalidate the
proxy: that would result in tp_proxy_prepare_async() succeeding just before the
proxy was invalidated.

Things inside telepathy-glib can also have a %NULL implementation. They must do
exactly one of these:

  * _tp_proxy_set_feature_prepared() (positively or negatively).
    Equivalent to TpProxyFeature.prepare_async() failing.

  * _tp_proxy_set_features_failed(). The tp_proxy_prepare_async() call
    fails with that error, but the proxy is not invalidated.
    Useful for stateless proxies like TpConnectionManager (and basically
    nothing else).

  * Invalidate the proxy. As above.

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