mcabber/mcabber/xmpp.c
changeset 2036 f8958ab545ac
parent 2033 a37fbc3ac6aa
child 2044 c00b919cf4ac
--- a/mcabber/mcabber/xmpp.c	Sun Oct 14 18:06:50 2012 +0200
+++ b/mcabber/mcabber/xmpp.c	Mon Oct 15 19:53:02 2012 +0200
@@ -423,7 +423,7 @@
     lm_message_node_set_attribute(lm_message_node_add_child(x->node, "request",
                                                             NULL),
                                   "xmlns", NS_RECEIPTS);
-    *xep184 = g_strdup(lm_message_node_get_attribute(x->node, "id"));
+    *xep184 = g_strdup(lm_message_get_id(x));
   }
   g_free(barejid);
 
@@ -1297,6 +1297,10 @@
     if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"), NS_RECEIPTS)) {
       char       *jid = jidtodisp(from);
       const char *id  = lm_message_node_get_attribute(received, "id");
+      // This is for backward compatibility; if the remote client didn't add
+      // the id as an attribute of the 'received' tag, we use the message id:
+      if (!id)
+        id = lm_message_get_id(m);
       scr_remove_receipt_flag(jid, id);
       g_free(jid);
     }