From eeccd41908d606fb7fb456cf863288126e59c514 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Thu, 20 Mar 2014 19:36:21 +0200 Subject: [PATCH] Fix #238: False "not delivered" in conference When Lync Archiving option is enabled, then the IMDN (Instant Message Delivery Notification) XML for conference messages contains "recipient" nodes also in the case of successful delivery, with a status code of 200. sipe_process_imdn() now parses the "status" node and only generates a "message not delivered" error if that node is missing or the error code is greater or equal to 300. --- src/core/sipe-conf.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/core/sipe-conf.c b/src/core/sipe-conf.c index b139ace2..cd71956e 100644 --- a/src/core/sipe-conf.c +++ b/src/core/sipe-conf.c @@ -3,7 +3,7 @@ * * pidgin-sipe * - * Copyright (C) 2010-2013 SIPE Project + * Copyright (C) 2010-2014 SIPE Project * Copyright (C) 2009 pier11 * * @@ -22,6 +22,15 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** + * Documentation references: + * + * Microsoft DevNet: [MS-CONFIM]: Centralized Conference Control Protocol: + * Instant Messaging Extensions + * + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -1217,7 +1226,17 @@ sipe_process_imdn(struct sipe_core_private *sipe_private, for (node = sipe_xml_child(xn_imdn, "recipient"); node; node = sipe_xml_twin(node)) { gchar *tmp = parse_from(sipe_xml_attribute(node, "uri")); gchar *uri = parse_from(tmp); - sipe_user_present_message_undelivered(sipe_private, session, -1, -1, uri, message); + gchar *status = sipe_xml_data(sipe_xml_child(node, "status")); + guint error = status ? g_ascii_strtoull(status, NULL, 10) : 0; + /* default to error if missing or conversion failed */ + if ((error == 0) || (error >= 300)) + sipe_user_present_message_undelivered(sipe_private, + session, + error, + -1, + uri, + message); + g_free(status); g_free(tmp); g_free(uri); } -- 2.11.4.GIT