mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Rename PROF_MSG_ENC_PLAIN to PROF_MSG_ENC_NONE
This commit is contained in:
parent
af2630a289
commit
a4b53550ca
@ -145,7 +145,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
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);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
}
|
||||
@ -165,7 +165,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
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);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt);
|
||||
free(id);
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
} else {
|
||||
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, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
|
||||
@ -211,7 +211,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
} else {
|
||||
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, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
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);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
}
|
||||
@ -265,7 +265,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
} else {
|
||||
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, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
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);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
}
|
||||
}
|
||||
@ -313,7 +313,7 @@ cl_ev_send_msg_correct(ProfChatWin *chatwin, const char *const msg, const char *
|
||||
#ifndef HAVE_OMEMO
|
||||
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, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, plugin_msg, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
free(id);
|
||||
|
||||
plugins_post_chat_message_send(chatwin->barejid, plugin_msg);
|
||||
@ -352,7 +352,7 @@ cl_ev_send_muc_msg_corrected(ProfMucWin *mucwin, const char *const msg, const ch
|
||||
} else {
|
||||
char *id = message_send_groupchat(mucwin->roomjid, plugin_msg, oob_url, replace_id);
|
||||
groupchat_log_msg_out(mucwin->roomjid, plugin_msg);
|
||||
mucwin_outgoing_msg(mucwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, replace_id);
|
||||
mucwin_outgoing_msg(mucwin, plugin_msg, id, PROF_MSG_ENC_NONE, replace_id);
|
||||
free(id);
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ cl_ev_send_muc_msg_corrected(ProfMucWin *mucwin, const char *const msg, const ch
|
||||
#ifndef HAVE_OMEMO
|
||||
char *id = message_send_groupchat(mucwin->roomjid, plugin_msg, oob_url, replace_id);
|
||||
groupchat_log_msg_out(mucwin->roomjid, plugin_msg);
|
||||
mucwin_outgoing_msg(mucwin, plugin_msg, id, PROF_MSG_ENC_PLAIN, replace_id);
|
||||
mucwin_outgoing_msg(mucwin, plugin_msg, id, PROF_MSG_ENC_NONE, replace_id);
|
||||
free(id);
|
||||
|
||||
plugins_post_room_message_send(mucwin->roomjid, plugin_msg);
|
||||
|
@ -465,12 +465,12 @@ sv_ev_outgoing_carbon(ProfMessage *message)
|
||||
log_error("Couldn't decrypt GPG message and body was empty");
|
||||
return;
|
||||
}
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
} else {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
@ -483,7 +483,7 @@ sv_ev_outgoing_carbon(ProfMessage *message)
|
||||
if (message->enc == PROF_MSG_ENC_OMEMO) {
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
} else {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
@ -505,12 +505,12 @@ sv_ev_outgoing_carbon(ProfMessage *message)
|
||||
log_error("Couldn't decrypt GPG message and body was empty");
|
||||
return;
|
||||
}
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
} else {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
@ -521,7 +521,7 @@ sv_ev_outgoing_carbon(ProfMessage *message)
|
||||
#ifndef HAVE_LIBGPGME
|
||||
#ifndef HAVE_OMEMO
|
||||
if (message->body) {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
chatwin_outgoing_carbon(chatwin, message);
|
||||
}
|
||||
@ -550,7 +550,7 @@ _sv_ev_incoming_pgp(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message
|
||||
log_error("Couldn't decrypt GPG message and body was empty");
|
||||
return;
|
||||
}
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
_clean_incoming_message(message);
|
||||
log_database_add(message, "chat");
|
||||
@ -572,7 +572,7 @@ _sv_ev_incoming_otr(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message
|
||||
message->enc = PROF_MSG_ENC_OTR;
|
||||
chatwin->pgp_send = FALSE;
|
||||
} else {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
}
|
||||
|
||||
_clean_incoming_message(message);
|
||||
@ -605,7 +605,7 @@ static void
|
||||
_sv_ev_incoming_plain(ProfChatWin *chatwin, gboolean new_win, ProfMessage *message, gboolean logit)
|
||||
{
|
||||
if (message->body) {
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->plain = strdup(message->body);
|
||||
_clean_incoming_message(message);
|
||||
log_database_add(message, "chat");
|
||||
|
@ -355,7 +355,7 @@ chat_log_otr_msg_in(ProfMessage *message)
|
||||
const char *jid = connection_get_fulljid();
|
||||
Jid *jidp = jid_create(jid);
|
||||
char *pref_otr_log = prefs_get_string(PREF_OTR_LOG);
|
||||
if (message->enc == PROF_MSG_ENC_PLAIN || (strcmp(pref_otr_log, "on") == 0)) {
|
||||
if (message->enc == PROF_MSG_ENC_NONE || (strcmp(pref_otr_log, "on") == 0)) {
|
||||
if (message->mucuser) {
|
||||
_chat_log_chat(jidp->barejid, message->jid->barejid, message->plain, PROF_IN_LOG, message->timestamp, message->jid->resourcepart);
|
||||
} else {
|
||||
|
@ -368,7 +368,7 @@ otr_on_message_send(ProfChatWin *chatwin, const char *const message, gboolean re
|
||||
if (policy == PROF_OTRPOLICY_OPPORTUNISTIC) {
|
||||
char *otr_tagged_msg = otr_tag_message(message);
|
||||
id = message_send_chat_otr(chatwin->barejid, otr_tagged_msg, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, message, id, PROF_MSG_ENC_PLAIN, request_receipt, replace_id);
|
||||
chatwin_outgoing_msg(chatwin, message, id, PROF_MSG_ENC_NONE, request_receipt, replace_id);
|
||||
chat_log_msg_out(chatwin->barejid, message, NULL);
|
||||
free(otr_tagged_msg);
|
||||
free(id);
|
||||
|
@ -192,7 +192,7 @@ message_init(void)
|
||||
message->body = NULL;
|
||||
message->encrypted = NULL;
|
||||
message->plain = NULL;
|
||||
message->enc = PROF_MSG_ENC_PLAIN;
|
||||
message->enc = PROF_MSG_ENC_NONE;
|
||||
message->timestamp = NULL;
|
||||
message->trusted = true;
|
||||
message->mucuser = false;
|
||||
|
@ -120,7 +120,7 @@ typedef struct disco_item_t {
|
||||
} DiscoItem;
|
||||
|
||||
typedef enum {
|
||||
PROF_MSG_ENC_PLAIN,
|
||||
PROF_MSG_ENC_NONE,
|
||||
PROF_MSG_ENC_OTR,
|
||||
PROF_MSG_ENC_PGP,
|
||||
PROF_MSG_ENC_OMEMO
|
||||
|
Loading…
Reference in New Issue
Block a user