equal
deleted
inserted
replaced
383 if (!key && res_pgpdata) |
383 if (!key && res_pgpdata) |
384 key = res_pgpdata->sign_keyid; |
384 key = res_pgpdata->sign_keyid; |
385 if (key) { |
385 if (key) { |
386 int nkeys = 1; |
386 int nkeys = 1; |
387 const char *keys[] = { key, 0 }; |
387 const char *keys[] = { key, 0 }; |
388 if (carbons_enabled()) { |
388 if (carbons_enabled()) |
389 keys[1] = gpg_get_private_key_id(); |
389 keys[nkeys++] = gpg_get_private_key_id(); |
390 nkeys++; |
|
391 } |
|
392 enc = gpg_encrypt(text, keys, nkeys); |
390 enc = gpg_encrypt(text, keys, nkeys); |
393 } |
391 } |
394 if (!enc && force) { |
392 if (!enc && force) { |
395 if (encrypted) |
393 if (encrypted) |
396 *encrypted = -1; |
394 *encrypted = -1; |
1139 handle_state_events(from, res, x); |
1137 handle_state_events(from, res, x); |
1140 |
1138 |
1141 scr_LogPrint(LPRINT_DEBUG, "Received incoming carbon from <%s>", from); |
1139 scr_LogPrint(LPRINT_DEBUG, "Received incoming carbon from <%s>", from); |
1142 |
1140 |
1143 } else if (!g_strcmp0(carbon_name, "sent")) { |
1141 } else if (!g_strcmp0(carbon_name, "sent")) { |
|
1142 #ifdef HAVE_GPGME |
|
1143 char *decrypted_pgp = NULL; |
|
1144 #endif |
1144 guint encrypted = 0; |
1145 guint encrypted = 0; |
1145 char *decrypted_pgp = NULL; |
|
1146 const char *to= lm_message_node_get_attribute(x, "to"); |
1146 const char *to= lm_message_node_get_attribute(x, "to"); |
1147 if (!to) { |
1147 if (!to) { |
1148 scr_LogPrint(LPRINT_LOGNORM, "Malformed carbon copy!"); |
1148 scr_LogPrint(LPRINT_LOGNORM, "Malformed carbon copy!"); |
1149 goto handle_messages_return; |
1149 goto handle_messages_return; |
1150 } |
1150 } |
1172 |
1172 |
1173 if (body && *body) |
1173 if (body && *body) |
1174 hk_message_out(bjid, NULL, timestamp, body, encrypted, TRUE, NULL); |
1174 hk_message_out(bjid, NULL, timestamp, body, encrypted, TRUE, NULL); |
1175 |
1175 |
1176 scr_LogPrint(LPRINT_DEBUG, "Received outgoing carbon for <%s>", to); |
1176 scr_LogPrint(LPRINT_DEBUG, "Received outgoing carbon for <%s>", to); |
|
1177 #ifdef HAVE_GPGME |
1177 g_free(decrypted_pgp); |
1178 g_free(decrypted_pgp); |
|
1179 #endif |
1178 goto handle_messages_return; |
1180 goto handle_messages_return; |
1179 } |
1181 } |
1180 } else { // Not a Carbon |
1182 } else { // Not a Carbon |
1181 ns_signed = lm_message_node_find_xmlns(m->node, NS_SIGNED); |
1183 ns_signed = lm_message_node_find_xmlns(m->node, NS_SIGNED); |
1182 } |
1184 } |