about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorlightb <lightb@bigfoot>2014-04-22 16:26:45 -0400
committerlightb <lightb@bigfoot>2014-04-22 16:26:45 -0400
commit1bd617d38936dae2f36e51ad0f28c325f57868f6 (patch)
treedcbf7f3569c9491f3aff80fd6cf633a48c4fc5ab
parent6450e2a704c6ed13ec8e5d26d7e5cf933ad00c61 (diff)
downloadprofani-tty-1bd617d38936dae2f36e51ad0f28c325f57868f6.tar.gz
Small modification, should check for whitespace pattern even if policy is always.
-rw-r--r--src/server_events.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/server_events.c b/src/server_events.c
index 0d0ba9c6..29cdfbc5 100644
--- a/src/server_events.c
+++ b/src/server_events.c
@@ -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