[Bug 29531] high-level API for text channels

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Oct 28 17:12:31 CEST 2010


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

--- Comment #9 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2010-10-28 08:12:31 PDT ---
This looks as though it's on the right track.

> void tp_text_channel_forget (TpTextChannel *self,
>     GList *messages, /* list of TpMessage */);
> 
> and maybe a forget_all() ?

This is for Observers/Approvers to use, in situations where a Handler would
acknowledge the message; in the Messages-not-mandatory world, you can't rely on
being told about message acknowledgement. I'd be inclined to just press onwards
with implementing Messages and stop caring about this case; the version of
Empathy/Tpl/whatever that requires Messages can have a versioned Breaks on
older CMs.

> Actually I'm wondering if that's not overkill and we should just give the
> token in tp_text_channel_send_message_finish() and let the user do the
> delivery-report mapping itself if it cares.

I agree, do that, precisely because we can't guarantee we'll ever be notified.

> Actually most of this already exists: TP_CHANNEL_FEATURE_CHAT_STATES,
> "chat-state-changed" and tp_channel_get_chat_state().
> Should we deprecate this API and replace it by a TpTextChannel version?

Perhaps one day. I'd be inclined to just leave it as-is for now.

> Maybe the new version of tp_channel_get_chat_state() and the sig should
> take a TpContact instead?

RESOLVED LATER, IMO :-)

> Do we want the plural version? I guess it can be useful.

I don't think returning the entire hash table is useful in practice; just have
a lookup mechanism by handle, ID and/or contact. UIs should have a list of
contacts (usually of length 1 in practice), and check the contact's chat state
when drawing its icon (or whatever).

----------------------------------

Drive-by implementation review:

> add example_echo_2_channel_get_props()

Should never be necessary. Use TpExportableChannel:immutable-properties
instead; if there are properties missing (perhaps the three from Messages), add
them.

> +      const GHashTable *part = tp_message_peek (msg, 1);
> +      const gchar *text = tp_asv_get_string (part, "content");

We should have convenience API tp_message_get_text() for this, but it should
basically be parts_to_text() from message-mixin.c (which deals with more
subtleties, including the possibility of non-text content).

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