about summary refs log tree commit diff stats
path: root/src/command/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/commands.c')
-rw-r--r--src/command/commands.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 27b03c53..45e1c730 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2689,6 +2689,10 @@ cmd_otr(gchar **args, struct cmd_help_t help)
             cons_show("OTR policy is now set to: %s", choice);
             return TRUE;
         } else {
+            if (jabber_get_connection_status() != JABBER_CONNECTED) {
+                cons_show("You must be connected to set the OTR policy for a contact.");
+                return TRUE;
+            }
             char *contact_jid = roster_barejid_from_name(contact);
             if (contact_jid == NULL) {
                 contact_jid = contact;