Feature request - XEP-0373: OpenPGP for XMPP (OX)
Basic implementation of XEP-0373: OpenPGP for XMPP. https://xmpp.org/extensions/xep-0373.html Command /ox Issue: #1331
This commit is contained in:
committed by
Michael Vetter
parent
3afd854dc8
commit
2c94ee5a88
@@ -138,6 +138,15 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
log_database_add_outgoing_chat(id, chatwin->barejid, plugin_msg, replace_id, PROF_MSG_ENC_OMEMO);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OMEMO, request_receipt, replace_id);
|
||||
free(id);
|
||||
#endif
|
||||
} else if (chatwin->is_ox) {
|
||||
#ifdef HAVE_LIBGPGME
|
||||
// XEP-0373: OpenPGP for XMPP
|
||||
char *id = message_send_chat_ox(chatwin->barejid, plugin_msg, request_receipt, replace_id);
|
||||
chat_log_pgp_msg_out(chatwin->barejid, plugin_msg, NULL);
|
||||
log_database_add_outgoing_chat(id, chatwin->barejid, plugin_msg, replace_id, PROF_MSG_ENC_OX);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_OX, request_receipt, replace_id);
|
||||
free(id);
|
||||
#endif
|
||||
} else if (chatwin->pgp_send) {
|
||||
#ifdef HAVE_LIBGPGME
|
||||
|
||||
@@ -516,6 +516,22 @@ _sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
_sv_ev_incoming_ox(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message, gboolean logit)
|
||||
{
|
||||
#ifdef HAVE_LIBGPGME
|
||||
//_clean_incoming_message(message);
|
||||
chatwin_incoming_msg(chatwin, message, new_win);
|
||||
log_database_add_incoming(message);
|
||||
if (logit) {
|
||||
chat_log_pgp_msg_in(message);
|
||||
}
|
||||
chatwin->pgp_recv = TRUE;
|
||||
//p_gpg_free_decrypted(message->plain);
|
||||
message->plain = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message)
|
||||
{
|
||||
@@ -604,7 +620,9 @@ sv_ev_incoming_message(ProfMessage *message)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (message->encrypted) {
|
||||
if( message->enc == PROF_MSG_ENC_OX) {
|
||||
_sv_ev_incoming_ox(chatwin, new_win, message, TRUE);
|
||||
} else if (message->encrypted) {
|
||||
if (chatwin->is_otr) {
|
||||
win_println((ProfWin*)chatwin, THEME_DEFAULT, "-", "PGP encrypted message received whilst in OTR session.");
|
||||
} else {
|
||||
@@ -638,7 +656,9 @@ sv_ev_incoming_carbon(ProfMessage *message)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (message->encrypted) {
|
||||
if (message->enc == PROF_MSG_ENC_OX) {
|
||||
_sv_ev_incoming_ox(chatwin, new_win, message, FALSE);
|
||||
} else if (message->encrypted) {
|
||||
_sv_ev_incoming_pgp(chatwin, new_win, message, FALSE);
|
||||
} else if (message->enc == PROF_MSG_ENC_OMEMO) {
|
||||
_sv_ev_incoming_omemo(chatwin, new_win, message, FALSE);
|
||||
|
||||
Reference in New Issue
Block a user