[Bug 25236] TpHandler - a class that implements a Client.Handler

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Apr 20 14:11:08 CEST 2010


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

--- Comment #7 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-04-20 05:11:08 PDT ---
(In reply to comment #6)
>Is it ok to call G_IMPLEMENT_INTERFACE even if we don't actually implement the
> iface?

IMO, yes, as long as we don't put it in the Interfaces property.

> tp_base_client_register() should probably check that at least of the
> observer/approver/handler has been set as it's not valid to be a Client without
> implemeneting at least one of those interface.

Yes, that sounds sensible.

> Any reason to not have a observer and approver variant of
> tp_base_client_be_a_handler() ?

It doesn't (currently) make sense to be an Observer or Approver with an empty
list of filters. It does make sense to be a Handler with an empty list of
filters (it means you'll only handle channels for which you are the
PreferredHandler).

> I'm not sure CLIENT_HANDLER_BYPASSES_APPROVAL should be a flag. It's pretty
> different from others flags as it doesn't affect the interfaces implemented.

As of spec 0.19.5 (which is newer than this sketch) we want another such flag,
CLIENT_OBSERVER_SHOULD_RECOVER (it's in the sketch, in fact, but is commented
out).

> Any reason to call this TpBaseClient rather than TpClient?

TpClient already exists, and is a TpProxy subclass (used by e.g. MC) to talk to
a client :-)

(This is consistent with our naming for Connections and ConnectionManagers.)

> What should do function like _tp_base_client_observe_channels()? Call a virtual
> method or... ?

I'm not sure. I think either a virtual method or a signal emission would make
sense; see above.

(If we also want something resembling Danielle's TpHandler, we should call it
TpSimpleHandler, make it a TpBaseClient subclass, and have it take filters and
a callback in its constructor for C developers' convenience; similarly for
TpSimpleObserver and potentially TpSimpleApprover.)

> implementation detai: finalize shouldn't use g_hash_table_destroy to destroy
> filters.

Fair enough.

(But, note that this object copies its filters rather than reffing them. This
is the only safe thing to do, because you can't know how callers will behave.)

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