diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-15 08:55:25 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2013-02-22 00:24:04 +0000 |
commit | 8f315a9dc0e575375a8e592bf84591bdec64afc0 (patch) | |
tree | 56250d384d18d0019938c3c77c741f20e379fcb4 | |
parent | 717c765b11fe101d9f32bb352f0377ccc762726d (diff) |
muc-channel: include error message in delivery reports
-rw-r--r-- | src/muc-channel.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/muc-channel.c b/src/muc-channel.c index c0d142277..149dcd5a0 100644 --- a/src/muc-channel.c +++ b/src/muc-channel.c @@ -3099,9 +3099,21 @@ _gabble_muc_channel_receive (GabbleMucChannel *chan, if (id != NULL) tp_message_set_string (delivery_report, 0, "delivery-token", id); - if (is_error) - tp_message_set_uint32 (delivery_report, 0, "delivery-error", - gabble_tp_send_error_from_wocky_xmpp_error (send_error->code)); + if (send_error != NULL) + { + tp_message_set_uint32 (delivery_report, 0, "delivery-error", + gabble_tp_send_error_from_wocky_xmpp_error (send_error->code)); + + if (!tp_str_empty (send_error->message)) + { + guint body_part_number = tp_message_append_part (delivery_report); + + tp_message_set_string (delivery_report, body_part_number, + "content-type", "text/plain"); + tp_message_set_string (delivery_report, body_part_number, + "content", send_error->message); + } + } /* We do not set a message-sender on the report: the intended recipient * of the original message was the MUC, so the spec says we should omit |