Ensure encrypted carbon of own message are marked as encrypted
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -73,7 +73,7 @@ void sv_ev_room_occupent_kicked(const char *const room, const char *const nick,
|
||||
void sv_ev_room_banned(const char *const room, const char *const actor, const char *const reason);
|
||||
void sv_ev_room_occupent_banned(const char *const room, const char *const nick, const char *const actor,
|
||||
const char *const reason);
|
||||
void sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message);
|
||||
void sv_ev_outgoing_carbon(char *barejid, char *message, char *pgp_message, gboolean omemo);
|
||||
void sv_ev_incoming_carbon(char *barejid, char *resource, char *message, char *pgp_message, gboolean omemo);
|
||||
void sv_ev_xmpp_stanza(const char *const msg);
|
||||
void sv_ev_muc_self_online(const char *const room, const char *const nick, gboolean config_required,
|
||||
|
||||
Reference in New Issue
Block a user