mirror of
https://github.com/irssi/irssi.git
synced 2025-04-25 20:41:23 -05:00
Add server_redirect for names
Then, use this redirect to make irssi not print NAMES commands sent by proxy clients. Closes https://github.com/irssi/irssi/issues/1537
This commit is contained in:
parent
0697e3eaf1
commit
64f91df8fb
@ -706,6 +706,14 @@ void servers_redirect_init(void)
|
||||
NULL, /* */
|
||||
NULL);
|
||||
|
||||
/* NAMES */
|
||||
server_redirect_register("names", TRUE, 0,
|
||||
"event 353", -1, /* An element of NAMES */
|
||||
NULL,
|
||||
"event 366", 1, /* End of NAMES */
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
/* LIST */
|
||||
server_redirect_register("list", FALSE, 0,
|
||||
"event 321", 1, /* Begins the LIST */
|
||||
|
@ -304,14 +304,14 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
|
||||
grab_who(client, args);
|
||||
else if (g_strcmp0(cmd, "WHOWAS") == 0)
|
||||
proxy_redirect_event(client, "whowas", 1, args, -1);
|
||||
else if (g_strcmp0(cmd, "WHOIS") == 0) {
|
||||
else if (g_strcmp0(cmd, "WHOIS") == 0 || g_strcmp0(cmd, "NAMES") == 0) {
|
||||
char *p;
|
||||
|
||||
/* convert dots to spaces */
|
||||
for (p = args; *p != '\0'; p++)
|
||||
if (*p == ',') *p = ' ';
|
||||
|
||||
proxy_redirect_event(client, "whois", 1, args, TRUE);
|
||||
proxy_redirect_event(client, *cmd == 'N' ? "names" : "whois", 1, args, TRUE);
|
||||
} else if (g_strcmp0(cmd, "ISON") == 0)
|
||||
proxy_redirect_event(client, "ison", 1, args, -1);
|
||||
else if (g_strcmp0(cmd, "USERHOST") == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user