Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp.c @ 2036:f8958ab545ac
Make message delivery receipts more backward-compatible
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 15 Oct 2012 19:53:02 +0200 |
parents | a37fbc3ac6aa |
children | c00b919cf4ac |
comparison
equal
deleted
inserted
replaced
2035:dac609275117 | 2036:f8958ab545ac |
---|---|
421 caps_has_feature(buddy_resource_getcaps(sl_buddy->data, rname), | 421 caps_has_feature(buddy_resource_getcaps(sl_buddy->data, rname), |
422 NS_RECEIPTS, barejid)) { | 422 NS_RECEIPTS, barejid)) { |
423 lm_message_node_set_attribute(lm_message_node_add_child(x->node, "request", | 423 lm_message_node_set_attribute(lm_message_node_add_child(x->node, "request", |
424 NULL), | 424 NULL), |
425 "xmlns", NS_RECEIPTS); | 425 "xmlns", NS_RECEIPTS); |
426 *xep184 = g_strdup(lm_message_node_get_attribute(x->node, "id")); | 426 *xep184 = g_strdup(lm_message_get_id(x)); |
427 } | 427 } |
428 g_free(barejid); | 428 g_free(barejid); |
429 | 429 |
430 #if defined XEP0022 || defined XEP0085 | 430 #if defined XEP0022 || defined XEP0085 |
431 // If typing notifications are disabled, we can skip all this stuff... | 431 // If typing notifications are disabled, we can skip all this stuff... |
1295 { // xep184 receipt confirmation | 1295 { // xep184 receipt confirmation |
1296 LmMessageNode *received = lm_message_node_get_child(m->node, "received"); | 1296 LmMessageNode *received = lm_message_node_get_child(m->node, "received"); |
1297 if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"), NS_RECEIPTS)) { | 1297 if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"), NS_RECEIPTS)) { |
1298 char *jid = jidtodisp(from); | 1298 char *jid = jidtodisp(from); |
1299 const char *id = lm_message_node_get_attribute(received, "id"); | 1299 const char *id = lm_message_node_get_attribute(received, "id"); |
1300 // This is for backward compatibility; if the remote client didn't add | |
1301 // the id as an attribute of the 'received' tag, we use the message id: | |
1302 if (!id) | |
1303 id = lm_message_get_id(m); | |
1300 scr_remove_receipt_flag(jid, id); | 1304 scr_remove_receipt_flag(jid, id); |
1301 g_free(jid); | 1305 g_free(jid); |
1302 } | 1306 } |
1303 } | 1307 } |
1304 | 1308 |