diff options
author | Michael Vetter <jubalh@iodoru.org> | 2020-02-12 08:54:12 +0100 |
---|---|---|
committer | Michael Vetter <jubalh@iodoru.org> | 2020-02-12 08:54:12 +0100 |
commit | 11b6e1bfa07fba1028a6ef31a336ad5856fc5801 (patch) | |
tree | d1b9f3ae89bff9d6ed998d31b0de804f932b5263 /src/event | |
parent | 38c32be14cb6b985a0c3982d5fef7127c7dbbaa7 (diff) | |
download | profani-tty-11b6e1bfa07fba1028a6ef31a336ad5856fc5801.tar.gz |
xep-0308: enable corrections for outgoing encrypted messages
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/client_events.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/event/client_events.c b/src/event/client_events.c index a9b7b46b..10354a5f 100644 --- a/src/event/client_events.c +++ b/src/event/client_events.c @@ -149,13 +149,12 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifdef HAVE_LIBGPGME #ifndef HAVE_OMEMO if (chatwin->pgp_send) { - // TODO: replace_id - char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt); + char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt, replace_id); chat_log_pgp_msg_out(chatwin->barejid, plugin_msg, NULL); - chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt); + chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt, replace_id); free(id); } else { - gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt); + gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt, replace_id); if (!handled) { char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); @@ -175,7 +174,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifdef HAVE_LIBOTR #ifndef HAVE_LIBGPGME #ifndef HAVE_OMEMO - gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt); + gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt, replace_id); if (!handled) { char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); @@ -195,9 +194,9 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifdef HAVE_LIBGPGME #ifndef HAVE_OMEMO if (chatwin->pgp_send) { - char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt); + char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt, replace_id); chat_log_pgp_msg_out(chatwin->barejid, plugin_msg, NULL); - chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt); + chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt, replace_id); free(id); } else { char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); @@ -218,7 +217,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifndef HAVE_LIBGPGME #ifdef HAVE_OMEMO if (chatwin->is_omemo) { - char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE); + char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE, replace_id); chat_log_omemo_msg_out(chatwin->barejid, plugin_msg, NULL); chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OMEMO, request_receipt); free(id); @@ -241,12 +240,12 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifndef HAVE_LIBGPGME #ifdef HAVE_OMEMO if (chatwin->is_omemo) { - char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE); + char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE, replace_id); chat_log_omemo_msg_out(chatwin->barejid, plugin_msg, NULL); chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OMEMO, request_receipt); free(id); } else { - gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt); + gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt, replace_id); if (!handled) { char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); @@ -267,19 +266,19 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifdef HAVE_LIBGPGME #ifdef HAVE_OMEMO if (chatwin->is_omemo) { - char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE); + char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE, replace_id); chat_log_omemo_msg_out(chatwin->barejid, plugin_msg, NULL); chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OMEMO, request_receipt); free(id); } else if (chatwin->pgp_send) { - char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt); + char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt, replace_id); chat_log_pgp_msg_out(chatwin->barejid, plugin_msg, NULL); - chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt); + chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt, replace_id); free(id); } else { - char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt); + char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); - chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt); + chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id); free(id); } @@ -295,17 +294,17 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifdef HAVE_LIBGPGME #ifdef HAVE_OMEMO if (chatwin->is_omemo) { - char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE); + char *id = omemo_on_message_send((ProfWin *)chatwin, plugin_msg, request_receipt, FALSE, replace_id); chat_log_omemo_msg_out(chatwin->barejid, plugin_msg, NULL); chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OMEMO, request_receipt, replace_id); free(id); } else if (chatwin->pgp_send) { - char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt); + char *id = message_send_chat_pgp(chatwin->barejid, plugin_msg, request_receipt, replace_id); chat_log_pgp_msg_out(chatwin->barejid, plugin_msg, NULL); chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PGP, request_receipt, replace_id); free(id); } else { - gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt); + gboolean handled = otr_on_message_send(chatwin, plugin_msg, request_receipt, replace_id); if (!handled) { char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); @@ -325,9 +324,9 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char * #ifndef HAVE_LIBOTR #ifndef HAVE_LIBGPGME #ifndef HAVE_OMEMO - char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt); + char *id = message_send_chat(chatwin->barejid, plugin_msg, oob_url, request_receipt, replace_id); chat_log_msg_out(chatwin->barejid, plugin_msg, NULL); - chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt); + chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id); free(id); plugins_post_chat_message_send(chatwin->barejid, plugin_msg); @@ -354,7 +353,8 @@ cl_ev_send_muc_msg(ProfMucWin *mucwin, const char *const msg, const char *const #ifdef HAVE_OMEMO if (mucwin->is_omemo) { - char *id = omemo_on_message_send((ProfWin *)mucwin, plugin_msg, FALSE, TRUE); + // TODO: replace_id for MUC + char *id = omemo_on_message_send((ProfWin *)mucwin, plugin_msg, FALSE, TRUE, NULL); groupchat_log_omemo_msg_out(mucwin->roomjid, plugin_msg); mucwin_outgoing_msg(mucwin, plugin_msg, id, PROF_MSG_ENC_OMEMO); free(id); |