[Bug 23238] Add acking hooks to TpMessageMixin/TpTextMixin

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 18 19:35:07 CEST 2010


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

--- Comment #5 from Eitan Isaacson <eitan.isaacson at collabora.co.uk> 2010-10-18 10:35:05 PDT ---
(In reply to comment #4)
> (Please set the patch keyword if you want things reviewed.)
> 

This isn't ready for review yet, I will add the keyword when it is :)

> I don't think it's worth adding this to TpTextMixin: the first step for anyone
> wanting to do new things with TpTextMixin should be "port to TpMessageMixin".
> 
> tp_message_mixin_take_received returns the pending message ID: the
> acknowledgement hook ought to have that pending message ID as a parameter.
> 

It is in the TpMessage struct, but I just realized it is opaque.

> In the Messages world, we emit PendingMessagesRemoved(au: Pending_Message_IDs),
> which in the dbus-glib world is actually a pending-messages-removed GObject
> signal on the Channel object, whose parameter is a GArray of guint.
> 
> I wonder whether it would be sufficient to have CM implementors just connect to
> that signal, and maintain a hash table of { pending message ID => internal
> object representing the message }?

That makes a lot of sense! Artem, what do you think?

> 
> If we keep the acknowledgement-hook support in its current form, the
> TpMessageMixin version needs tests, since it's the version that will be
> important in future. Two easy ways to do this spring to mind:
> 
> - have the Echo2 example emit a signal from its acknowledgement hook, and catch
> that signal in the test
> 
> - subclass the Echo2 example's channel, and set an acknowledgement hook in the
> subclass's class_init

Good ideas, I'll use those if we have something to test (if the signal is not
enough).

> 
> One way to have "user data" like Mikhail suggested would be to add guint
> tp_message_mixin_take_received_full (GObject *object, TpMessage *message,
> gpointer user_data, GDestroyNotify destroy), where @destroy is called after the
> message has been acknowledged. In simple cases you wouldn't necessarily even
> need the acknowledgement hook.

Since we have unique IDs, I don't think user data is essential. Keeping a
mapping is easy enough, probably not worth complicating our API for that. But I
could be convinced otherwise.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.



More information about the telepathy-bugs mailing list