1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Small modification, should check for whitespace pattern even if policy is always.

This commit is contained in:
lightb 2014-04-22 16:26:45 -04:00
parent 6450e2a704
commit 1bd617d389

View File

@ -206,20 +206,21 @@ void
handle_incoming_message(char *from, char *message, gboolean priv)
{
#ifdef HAVE_LIBOTR
//check for OTR whitespace (opportunistic)
gboolean was_decrypted = FALSE;
char *newmessage;
if (!priv) {
//check for OTR whitespace (opportunistic or always)
char *policy = prefs_get_string(PREF_OTR_POLICY);
if (strcmp(policy, "opportunistic") == 0) {
if (strcmp(policy, "opportunistic") == 0 || strcmp(policy, "always") == 0) {
if (strstr(message,OTRL_MESSAGE_TAG_BASE)) {
if (strstr(message, OTRL_MESSAGE_TAG_V2) || strstr(message, OTRL_MESSAGE_TAG_V1)) {
char *otr_query_message = otr_start_query();
cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...", message);
cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...");
message_send(otr_query_message, from);
}
}
}
gboolean was_decrypted = FALSE;
char *newmessage;
if (!priv) {
newmessage = otr_decrypt_message(from, message, &was_decrypted);
// internal OTR message