Ensure encrypted carbon of own message are marked as encrypted

This commit is contained in:
Paul Fariello
2019-03-27 13:37:09 +01:00
parent daf84ced0c
commit 2015ba201d
4 changed files with 42 additions and 4 deletions

View File

@@ -387,7 +387,7 @@ sv_ev_delayed_private_message(const char *const fulljid, char *message, GDateTim
}
void
sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message)
sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message, gboolean omemo)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (!chatwin) {
@@ -397,6 +397,7 @@ sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message)
chat_state_active(chatwin->state);
#ifdef HAVE_LIBGPGME
#ifndef HAVE_OMEMO
if (pgp_message) {
char *decrypted = p_gpg_decrypt(pgp_message);
if (decrypted) {
@@ -407,9 +408,44 @@ sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message)
} else {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_PLAIN);
}
#else
return;
#endif
#endif
#ifndef HAVE_LIBGPGME
#ifdef HAVE_OMEMO
if (omemo) {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_OMEMO);
} else {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_PLAIN);
}
return;
#endif
#endif
#ifdef HAVE_LIBGPGME
#ifdef HAVE_OMEMO
if (omemo) {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_OMEMO);
} else if (pgp_message) {
char *decrypted = p_gpg_decrypt(pgp_message);
if (decrypted) {
chatwin_outgoing_carbon(chatwin, decrypted, PROF_MSG_PGP);
} else {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_PLAIN);
}
} else {
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_PLAIN);
}
return;
#endif
#endif
#ifndef HAVE_LIBGPGME
#ifndef HAVE_OMEMO
chatwin_outgoing_carbon(chatwin, message, PROF_MSG_PLAIN);
#endif
#endif
}
#ifdef HAVE_LIBGPGME