Bug 35884

Summary: Add support for delivery report into TpMessage
Product: Telepathy Reporter: Nicolas Dufresne <nicolas>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 35883    

Description Nicolas Dufresne 2011-04-01 12:59:41 UTC
The Logger would benifit if TpMessage class had support for delivery report. Currently it's quite hard to access the 'delivery-echo' inside a TpMessage.
Comment 1 Guillaume Desmottes 2011-04-18 05:29:03 UTC
Agreed. Especially, I'd really like to have:

TpMessage * tp_message_report_get_echo (TpMessage *msg);
Comment 2 Nicolas Dufresne 2011-04-18 06:16:21 UTC
I think combined with the already existing _is_delivery_report() this is the only other function we need.
Comment 3 Guillaume Desmottes 2011-04-18 06:28:59 UTC
http://telepathy.freedesktop.org/spec/Channel_Interface_Messages.html#Simple-Type:Delivery_Report_Header_Key

What do you think about this API:

I think it's good to have a common tp_message_delivery_report_* prefix for
these functions.

TpDeliveryStatus tp_message_delivery_report_get_status (TpMessage *self,
    GError **error);

The error will be constructed using tp_proxy_dbus_error_to_gerror() with
the "delivery-dbus-error" and "delivery-error-message" keys.
I'm sure if this should be part of get_status() or not.

const gchar * tp_message_delivery_report_get_token (TpMessage *self);
TpChannelTextSendError tp_message_delivery_report_get_send_error (
    TpMessage *self);

TpMessage * tp_message_delivery_report_dup_echo (TpMessage *self);

It's a _dup and not a _get as it will have to create a new object.


TpContact * tp_message_delivery_report_get_sender (TpMessage *self);
I find 'sender' a bit confusing but that's what's used in the spec...
Comment 4 Guillaume Desmottes 2011-04-18 06:29:54 UTC
(In reply to comment #2)
> I think combined with the already existing _is_delivery_report() this is the
> only other function we need.

Sorry I posted before seeing your message. Don't you think these other functions can be usefull as well? I do need them in Empathy.
Comment 5 Nicolas Dufresne 2011-04-18 06:55:05 UTC
Right, I've replied a little too quickly.

(In reply to comment #3)
> http://telepathy.freedesktop.org/spec/Channel_Interface_Messages.html#Simple-Type:Delivery_Report_Header_Key
> 
> What do you think about this API:
> 
> I think it's good to have a common tp_message_delivery_report_* prefix for
> these functions.
> 
> TpDeliveryStatus tp_message_delivery_report_get_status (TpMessage *self,
>     GError **error);
> 
> The error will be constructed using tp_proxy_dbus_error_to_gerror() with
> the "delivery-dbus-error" and "delivery-error-message" keys.
> I'm sure if this should be part of get_status() or not.

Maybe the gerror should be retrieved along with the send error instead ?

> 
> const gchar * tp_message_delivery_report_get_token (TpMessage *self);
This one we need for sure.

> TpChannelTextSendError tp_message_delivery_report_get_send_error (
>     TpMessage *self);
It's a little weird to have this one separated from the GError. Thinking of it, 'm wondering if the GError is not more related to the send error then it is from the status ?

> 
> TpMessage * tp_message_delivery_report_dup_echo (TpMessage *self);
> 
> It's a _dup and not a _get as it will have to create a new object.
Not sure this one will be used in the logger, but I guess it could be handy at some point.

> 
> 
> TpContact * tp_message_delivery_report_get_sender (TpMessage *self);
> I find 'sender' a bit confusing but that's what's used in the spec...

Yes it is, maybe we could find something better.
Comment 6 Simon McVittie 2012-01-18 02:51:16 UTC
(In reply to comment #5)
> > TpContact * tp_message_delivery_report_get_sender (TpMessage *self);
> > I find 'sender' a bit confusing but that's what's used in the spec...

The parameter should be documented to have to be a TpSignalledMessage (because you can't make a TpContact from any other sort).

Would this just be a wrapper for tp_signalled_message_get_sender()?

It seems reasonable to have a wrapper in the delivery-report namespace to clarify what it means in the context of a delivery report. I'm not sure what the least confusing naming is, though. original_recipient?
Comment 7 GitLab Migration User 2019-12-03 20:37:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/60.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.