[Bug 23238] Add acking hooks to TpMessageMixin/TpTextMixin

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Oct 18 13:45:30 CEST 2010


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

Simon McVittie <simon.mcvittie at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|                            |review-, needs test
           Keywords|                            |patch

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-10-18 04:45:29 PDT ---
(Please set the patch keyword if you want things reviewed.)

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.

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

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

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.

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