comparison mcabber/mcabber/xmpp.c @ 2113:44c4b850263a

Cosmetics
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 May 2014 17:26:47 +0200
parents 0c2276f60f78
children 51fde9c25401
comparison
equal deleted inserted replaced
2112:332818e5daa1 2113:44c4b850263a
1289 bjid = g_strdup(from); 1289 bjid = g_strdup(from);
1290 res = strchr(bjid, JID_RESOURCE_SEPARATOR); 1290 res = strchr(bjid, JID_RESOURCE_SEPARATOR);
1291 if (res) *res++ = 0; 1291 if (res) *res++ = 0;
1292 scr_WriteIncomingMessage(bjid, body, timestamp, HBB_PREFIX_IN, 0); 1292 scr_WriteIncomingMessage(bjid, body, timestamp, HBB_PREFIX_IN, 0);
1293 1293
1294 scr_LogPrint(LPRINT_DEBUG, "carbon from:%s", lm_message_node_get_attribute(x, "from")); 1294 scr_LogPrint(LPRINT_DEBUG, "carbon from:%s",
1295 lm_message_node_get_attribute(x, "from"));
1295 1296
1296 } else if (!g_strcmp0(x->name, "sent")) { 1297 } else if (!g_strcmp0(x->name, "sent")) {
1297 x = lm_message_node_find_xmlns(x, "urn:xmpp:forward:0"); 1298 x = lm_message_node_find_xmlns(x, "urn:xmpp:forward:0");
1298 x = lm_message_node_get_child(x, "message"); 1299 x = lm_message_node_get_child(x, "message");
1299 1300
1300 const char *to= lm_message_node_get_attribute(x, "to"); 1301 const char *to= lm_message_node_get_attribute(x, "to");
1301 g_free(bjid); 1302 g_free(bjid);
1302 bjid = g_strdup(to); 1303 bjid = g_strdup(to);
1303 res = strchr(bjid, JID_RESOURCE_SEPARATOR); 1304 res = strchr(bjid, JID_RESOURCE_SEPARATOR);
1304 if (res) *res++ = 0; 1305 if (res) *res++ = 0;
1305 1306
1306 scr_write_outgoing_message(bjid, body, 0, NULL); 1307 scr_write_outgoing_message(bjid, body, 0, NULL);
1307 } 1308 }
1308 } 1309 }
1309 1310
1310 1311
1328 lm_message_unref(rcvd); 1329 lm_message_unref(rcvd);
1329 } 1330 }
1330 1331
1331 { // xep184 receipt confirmation 1332 { // xep184 receipt confirmation
1332 LmMessageNode *received = lm_message_node_get_child(m->node, "received"); 1333 LmMessageNode *received = lm_message_node_get_child(m->node, "received");
1333 if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"), NS_RECEIPTS)) { 1334 if (received && !g_strcmp0(lm_message_node_get_attribute(received, "xmlns"),
1335 NS_RECEIPTS)) {
1334 char *jid = jidtodisp(from); 1336 char *jid = jidtodisp(from);
1335 const char *id = lm_message_node_get_attribute(received, "id"); 1337 const char *id = lm_message_node_get_attribute(received, "id");
1336 // This is for backward compatibility; if the remote client didn't add 1338 // This is for backward compatibility; if the remote client didn't add
1337 // the id as an attribute of the 'received' tag, we use the message id: 1339 // the id as an attribute of the 'received' tag, we use the message id:
1338 if (!id) 1340 if (!id)