Resolve the client info if client cannot be found from channel
[silc.git] / lib / silcclient / client_channel.c
index 8d781039ae74b1ffe35d9691d3aa9e05eed60ffa..2fc79ea33a61f941522dc7fd02f80c62a3cc49e3 100644 (file)
@@ -69,6 +69,8 @@ void silc_client_send_channel_message(SilcClient client,
       chu->mode & SILC_CHANNEL_UMODE_CHANOP &&
       !(chu->mode & SILC_CHANNEL_UMODE_CHANFO))
     return;
+  if (chu->mode & SILC_CHANNEL_UMODE_QUIET)
+    return;
 
   /* Take the key to be used */
   if (channel->mode & SILC_CHANNEL_MODE_PRIVKEY) {
@@ -300,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;
@@ -313,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 */