mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Small optimization for whois-redirecting.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2012 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
179faf0416
commit
25d0d40d5a
@ -164,7 +164,8 @@ static void ison_save_users(MODULE_SERVER_REC *mserver, char *online)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void whois_send(IRC_SERVER_REC *server, char *nicks)
|
static void whois_send(IRC_SERVER_REC *server, const char *nicks,
|
||||||
|
const char *whois_request)
|
||||||
{
|
{
|
||||||
char *p, *str;
|
char *p, *str;
|
||||||
|
|
||||||
@ -184,7 +185,7 @@ static void whois_send(IRC_SERVER_REC *server, char *nicks)
|
|||||||
"", "event empty", NULL);
|
"", "event empty", NULL);
|
||||||
g_free(str);
|
g_free(str);
|
||||||
|
|
||||||
irc_send_cmdv(server, "WHOIS %s", nicks);
|
irc_send_cmdv(server, "WHOIS %s", whois_request);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void whois_send_server(IRC_SERVER_REC *server, char *nick)
|
static void whois_send_server(IRC_SERVER_REC *server, char *nick)
|
||||||
@ -192,7 +193,7 @@ static void whois_send_server(IRC_SERVER_REC *server, char *nick)
|
|||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
str = g_strdup_printf("%s %s", nick, nick);
|
str = g_strdup_printf("%s %s", nick, nick);
|
||||||
whois_send(server, str);
|
whois_send(server, nick, str);
|
||||||
g_free(str);
|
g_free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,14 +216,14 @@ static void whois_list_send(IRC_SERVER_REC *server, GSList *nicks)
|
|||||||
|
|
||||||
if (count >= server->max_whois_in_cmd) {
|
if (count >= server->max_whois_in_cmd) {
|
||||||
g_string_truncate(str, str->len-1);
|
g_string_truncate(str, str->len-1);
|
||||||
whois_send(server, str->str);
|
whois_send(server, str->str, str->str);
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str->len > 0) {
|
if (str->len > 0) {
|
||||||
g_string_truncate(str, str->len-1);
|
g_string_truncate(str, str->len-1);
|
||||||
whois_send(server, str->str);
|
whois_send(server, str->str, str->str);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_string_free(str, TRUE);
|
g_string_free(str, TRUE);
|
||||||
|
Loading…
Reference in New Issue
Block a user