Handle command reply lists in threads.
[silc.git] / lib / silcclient / client_channel.c
index c7a414463b3a809940a60ba9c1062a8e1b4c4737..51fc85471d11a358d2be3727a237c9bfc60957de 100644 (file)
@@ -47,6 +47,8 @@ SilcBool silc_client_send_channel_message(SilcClient client,
     return FALSE;
   if (flags & SILC_MESSAGE_FLAG_SIGNED && !hash)
     return FALSE;
+  if (conn->internal->disconnected)
+    return FALSE;
 
   chu = silc_client_on_channel(channel, conn->local_entry);
   if (!chu) {
@@ -200,6 +202,13 @@ SILC_FSM_STATE(silc_client_channel_message)
     return SILC_FSM_CONTINUE;
   }
 
+  /* Check that user is on channel */
+  if (!silc_client_on_channel(channel, client_entry)) {
+    /** User not on channel */
+    silc_fsm_next(fsm, silc_client_channel_message_error);
+    return SILC_FSM_CONTINUE;
+  }
+
   /* If there is no channel private key then just decrypt the message
      with the channel key. If private keys are set then just go through
      all private keys and check what decrypts correctly. */