Do not count "there are xx users..." for users that aren't on channel.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 14 Mar 2007 15:28:31 +0000 (15:28 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 14 Mar 2007 15:28:31 +0000 (15:28 +0000)
apps/irssi/src/silc/core/client_ops.c

index 7ecbdf07d8c6fec70653e1977626772f30ed3351..9e481781510da5feac3427537d75d862cebd0550 100644 (file)
@@ -771,6 +771,7 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
     /* If there are multiple same nicknames on channel now, tell it to user. */
     if (client_entry != server->conn->local_entry) {
       char nick[128 + 1], tmp[32];
+      int count = 0;
 
       silc_parse_userfqdn(client_entry->nickname, nick, sizeof(nick), NULL, 0);
       clients = silc_client_get_clients_local(client, conn, nick, NULL);
@@ -778,13 +779,19 @@ void silc_notify(SilcClient client, SilcClientConnection conn,
        silc_client_list_free(client, conn, clients);
        break;
       }
-      silc_snprintf(tmp, sizeof(tmp), "%d", silc_dlist_count(clients));
-      printformat_module("fe-common/silc", server, channel->channel_name,
-                        MSGLEVEL_CRAP, SILCTXT_CHANNEL_MANY_NICKS,
-                        tmp, nick);
-      printformat_module("fe-common/silc", server, channel->channel_name,
-                        MSGLEVEL_CRAP, SILCTXT_CHANNEL_USER_APPEARS,
-                        buf, client_entry->nickname);
+      silc_dlist_start(clients);
+      while ((client_entry2 = silc_dlist_get(clients)))
+       if (silc_client_on_channel(channel, client_entry2))
+         count++;
+      if (count > 1) {
+       silc_snprintf(tmp, sizeof(tmp), "%d", silc_dlist_count(clients));
+       printformat_module("fe-common/silc", server, channel->channel_name,
+                          MSGLEVEL_CRAP, SILCTXT_CHANNEL_MANY_NICKS,
+                          tmp, nick);
+       printformat_module("fe-common/silc", server, channel->channel_name,
+                          MSGLEVEL_CRAP, SILCTXT_CHANNEL_USER_APPEARS,
+                          buf, client_entry->nickname);
+      }
       silc_client_list_free(client, conn, clients);
     }
     break;