diff options
author | Timo Sirainen <cras@irssi.org> | 2002-07-01 21:13:33 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-07-01 21:13:33 +0000 |
commit | ac864325035f2c2e52dfef9be8870887d4055f21 (patch) | |
tree | 3b5a2705b0380ca345cae9699b042d6b19582c5e /src | |
parent | e1b4a2ff8ecd5486786a4bc0d181164509c1e611 (diff) | |
download | irssi-ac864325035f2c2e52dfef9be8870887d4055f21.zip |
nick tracking change: now it renames the query only if the old nick doesn't
exist in any channel with you
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2861 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/irc/fe-irc-queries.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/fe-common/irc/fe-irc-queries.c b/src/fe-common/irc/fe-irc-queries.c index c35e283f..13290a3c 100644 --- a/src/fe-common/irc/fe-irc-queries.c +++ b/src/fe-common/irc/fe-irc-queries.c @@ -42,16 +42,14 @@ static QUERY_REC *query_find_address(SERVER_REC *server, const char *address) return NULL; } -static int have_channel_with_nicks(SERVER_REC *server, const char *nick1, - const char *nick2) +static int server_has_nick(SERVER_REC *server, const char *nick) { GSList *tmp; for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { CHANNEL_REC *channel = tmp->data; - if (nicklist_find(channel, nick1) != NULL && - nicklist_find(channel, nick2) != NULL) + if (nicklist_find(channel, nick) != NULL) return TRUE; } @@ -76,10 +74,8 @@ static void event_privmsg(SERVER_REC *server, const char *data, server, so rename the query. */ query = query_find_address(server, address); if (query != NULL) { - /* make sure the old and new nicks aren't on the - same channel - happens with eg. www gateways - and such.. */ - if (!have_channel_with_nicks(server, nick, query->name)) + /* make sure the old nick doesn't exist anymore */ + if (!server_has_nick(server, query->name)) query_change_nick(query, nick); } } |