about summary refs log tree commit diff stats
path: root/src/command/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/command.c')
-rw-r--r--src/command/command.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c
index 31a481b7..902ef19a 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -1328,6 +1328,10 @@ cmd_execute_default(const char * const inp)
                 ui_current_print_line("You are not currently connected.");
             } else {
 #ifdef HAVE_LIBOTR
+	if ((strcmp(prefs_get_string(PREF_OTR_POLICY), "always") == 0) && !otr_is_secure(recipient)) {
+		cons_show_error("Failed to send message. Please check OTR policy");
+		return TRUE;
+		}
                 if (otr_is_secure(recipient)) {
                     char *encrypted = otr_encrypt_message(recipient, inp);
                     if (encrypted != NULL) {