From b3f971c56e61eb3f77ecf2cb1980bae6b49d6ad1 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 14 Mar 2007 15:28:31 +0000 Subject: [PATCH] Do not count "there are xx users..." for users that aren't on channel. --- apps/irssi/src/silc/core/client_ops.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index 7ecbdf07..9e481781 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -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; -- 2.24.0