telepathy-gabble: muc-channel: include error message in delivery reports

Will Thompson wjt at kemper.freedesktop.org
Mon Mar 4 04:22:17 PST 2013


Module: telepathy-gabble
Branch: master
Commit: 8f315a9dc0e575375a8e592bf84591bdec64afc0
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=8f315a9dc0e575375a8e592bf84591bdec64afc0

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Fri Feb 15 08:55:25 2013 +0000

muc-channel: include error message in delivery reports

---

 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 c0d1422..149dcd5 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



More information about the telepathy-commits mailing list