Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp.c @ 2033:a37fbc3ac6aa
Delivery receipts: Use LM-generated messages id
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 14 Oct 2012 17:41:56 +0200 |
parents | f740c4128f76 |
children | f8958ab545ac |
comparison
equal
deleted
inserted
replaced
2032:f740c4128f76 | 2033:a37fbc3ac6aa |
---|---|
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 = lm_get_uid (); | 426 *xep184 = g_strdup(lm_message_node_get_attribute(x->node, "id")); |
427 lm_message_node_set_attribute (x->node, "id", (const gchar *)*xep184); | |
428 } | 427 } |
429 g_free(barejid); | 428 g_free(barejid); |
430 | 429 |
431 #if defined XEP0022 || defined XEP0085 | 430 #if defined XEP0022 || defined XEP0085 |
432 // If typing notifications are disabled, we can skip all this stuff... | 431 // If typing notifications are disabled, we can skip all this stuff... |
1354 lm_message_node_get_attribute(info, "name"), | 1353 lm_message_node_get_attribute(info, "name"), |
1355 lm_message_node_get_attribute(info, "type"), | 1354 lm_message_node_get_attribute(info, "type"), |
1356 lm_message_node_get_attribute(info, "xml:lang")); | 1355 lm_message_node_get_attribute(info, "xml:lang")); |
1357 info = info->next; | 1356 info = info->next; |
1358 } | 1357 } |
1359 | 1358 |
1360 info = lm_message_node_get_child(query, "feature"); | 1359 info = lm_message_node_get_child(query, "feature"); |
1361 while (info) { | 1360 while (info) { |
1362 if (!g_strcmp0(info->name, "feature")) | 1361 if (!g_strcmp0(info->name, "feature")) |
1363 caps_add_feature(ver, lm_message_node_get_attribute(info, "var")); | 1362 caps_add_feature(ver, lm_message_node_get_attribute(info, "var")); |
1364 info = info->next; | 1363 info = info->next; |
1414 } | 1413 } |
1415 } | 1414 } |
1416 | 1415 |
1417 if (caps_verify(ver, hash)) | 1416 if (caps_verify(ver, hash)) |
1418 caps_copy_to_persistent(ver, lm_message_node_to_string(query)); | 1417 caps_copy_to_persistent(ver, lm_message_node_to_string(query)); |
1419 else | 1418 else |
1420 caps_move_to_local(ver, bjid); | 1419 caps_move_to_local(ver, bjid); |
1421 } | 1420 } |
1422 | 1421 |
1423 caps_callback_return: | 1422 caps_callback_return: |
1424 g_free(bjid); | 1423 g_free(bjid); |
2186 { | 2185 { |
2187 LmMessageNode *x; | 2186 LmMessageNode *x; |
2188 | 2187 |
2189 if (!bookmarks || !bjid) | 2188 if (!bookmarks || !bjid) |
2190 return 0; | 2189 return 0; |
2191 | 2190 |
2192 // Walk through the storage bookmark tags | 2191 // Walk through the storage bookmark tags |
2193 for (x = bookmarks->children ; x; x = x->next) { | 2192 for (x = bookmarks->children ; x; x = x->next) { |
2194 // If the node is a conference item, check the jid. | 2193 // If the node is a conference item, check the jid. |
2195 if (x->name && !strcmp(x->name, "conference")) { | 2194 if (x->name && !strcmp(x->name, "conference")) { |
2196 const char *fjid = lm_message_node_get_attribute(x, "jid"); | 2195 const char *fjid = lm_message_node_get_attribute(x, "jid"); |