Send private carbons element with message when encrypted

This commit is contained in:
James Booth
2015-03-10 21:16:34 +00:00
parent 3c1e8c4e15
commit 2ff6873cf1
10 changed files with 62 additions and 19 deletions

View File

@@ -1928,7 +1928,7 @@ _cmd_execute_default(const char * inp)
if (otr_is_secure(chatwin->barejid)) {
char *encrypted = otr_encrypt_message(chatwin->barejid, inp);
if (encrypted != NULL) {
message_send_chat(chatwin->barejid, encrypted);
message_send_chat_encrypted(chatwin->barejid, encrypted);
otr_free_message(encrypted);
if (prefs_get_boolean(PREF_CHLOG)) {
const char *jid = jabber_get_fulljid();

View File

@@ -1265,7 +1265,7 @@ cmd_msg(gchar **args, struct cmd_help_t help)
if (otr_is_secure(barejid)) {
char *encrypted = otr_encrypt_message(barejid, msg);
if (encrypted != NULL) {
message_send_chat(barejid, encrypted);
message_send_chat_encrypted(barejid, encrypted);
otr_free_message(encrypted);
ui_outgoing_chat_msg("me", barejid, msg);
@@ -1294,7 +1294,7 @@ cmd_msg(gchar **args, struct cmd_help_t help)
GString *otr_message = g_string_new(msg);
g_string_append(otr_message, OTRL_MESSAGE_TAG_BASE);
g_string_append(otr_message, OTRL_MESSAGE_TAG_V2);
message_send_chat(barejid, otr_message->str);
message_send_chat_encrypted(barejid, otr_message->str);
g_string_free(otr_message, TRUE);
} else {
@@ -3073,7 +3073,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
if (otr_is_secure(chatwin->barejid)) {
char *encrypted = otr_encrypt_message(chatwin->barejid, tiny);
if (encrypted != NULL) {
message_send_chat(chatwin->barejid, encrypted);
message_send_chat_encrypted(chatwin->barejid, encrypted);
otr_free_message(encrypted);
if (prefs_get_boolean(PREF_CHLOG)) {
const char *jid = jabber_get_fulljid();
@@ -4080,7 +4080,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
} else if (!otr_is_secure(barejid)) {
char *otr_query_message = otr_start_query();
message_send_chat(barejid, otr_query_message);
message_send_chat_encrypted(barejid, otr_query_message);
} else {
ui_gone_secure(barejid, otr_is_trusted(barejid));
}
@@ -4098,7 +4098,7 @@ cmd_otr(gchar **args, struct cmd_help_t help)
} else {
ProfChatWin *chatwin = ui_get_current_chat();
char *otr_query_message = otr_start_query();
message_send_chat(chatwin->barejid, otr_query_message);
message_send_chat_encrypted(chatwin->barejid, otr_query_message);
}
}
}