hidecommand.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
hidecommand.diff (757B) | |
--- | |
1 --- sic.c.orig 2015-04-28 17:21:30.965869283 -0500 | |
2 +++ sic.c 2015-04-28 17:34:40.024754949 -0500 | |
3 @@ -19,6 +19,7 @@ | |
4 static char bufin[4096]; | |
5 static char bufout[4096]; | |
6 static char channel[256]; | |
7 +static char hidecmd[128] = {0}; | |
8 static time_t trespond; | |
9 static FILE *srv; | |
10 | |
11 @@ -99,6 +100,9 @@ | |
12 case 's': | |
13 strlcpy(channel, p, sizeof channel); | |
14 return; | |
15 + case 'h': | |
16 + strlcpy(hidecmd, p, sizeof hidecmd); | |
17 + return; | |
18 } | |
19 } | |
20 sout("%s", s); | |
21 @@ -129,7 +133,8 @@ | |
22 else if(!strcmp("PING", cmd)) | |
23 sout("PONG %s", txt); | |
24 else { | |
25 - pout(usr, ">< %s (%s): %s", cmd, par, txt); | |
26 + if (!strcasestr(hidecmd, cmd)) | |
27 + pout(usr, ">< %s (%s): %s", cmd, par, txt); | |
28 if(!strcmp("NICK", cmd) && !strcmp(usr, nick)) | |
29 strlcpy(nick, txt, sizeof nick); | |
30 } |