Resolve the client info if client cannot be found from channel
[silc.git] / lib / silcclient / client_channel.c
index c2ffe6630aaf32332bf6abc8bf6a49b53e4c512e..2fc79ea33a61f941522dc7fd02f80c62a3cc49e3 100644 (file)
@@ -69,10 +69,8 @@ void silc_client_send_channel_message(SilcClient client,
       chu->mode & SILC_CHANNEL_UMODE_CHANOP &&
       !(chu->mode & SILC_CHANNEL_UMODE_CHANFO))
     return;
-#if 0
   if (chu->mode & SILC_CHANNEL_UMODE_QUIET)
     return;
-#endif
 
   /* Take the key to be used */
   if (channel->mode & SILC_CHANNEL_MODE_PRIVKEY) {
@@ -304,7 +302,8 @@ void silc_client_channel_message(SilcClient client,
 
   /* Find client entry */
   client_entry = silc_client_get_client_by_id(client, conn, client_id);
-  if (!client_entry || !client_entry->nickname) {
+  if (!client_entry || !client_entry->nickname ||
+      !silc_client_on_channel(channel, client_entry)) {
     /* Resolve the client info */
     SilcChannelClientResolve res = silc_calloc(1, sizeof(*res));
     res->payload = payload;
@@ -317,11 +316,6 @@ void silc_client_channel_message(SilcClient client,
     goto out;
   }
 
-  if (!silc_client_on_channel(channel, client_entry)) {
-    SILC_LOG_WARNING(("Received channel message from client not on channel"));
-    goto out;
-  }
-
   message = silc_channel_message_get_data(payload, &message_len);
 
   /* Pass the message to application */