From f0e089e967734e2b2b7a87b75d1975f7d1dea2c8 Mon Sep 17 00:00:00 2001 From: "arg@10ksloc.org" Date: Wed, 19 Jul 2006 08:29:40 +0200 Subject: [PATCH] new stuff --- sic.1 | 1 + sic.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sic.1 b/sic.1 index 2d453d3..0356690 100644 --- a/sic.1 +++ b/sic.1 @@ -24,6 +24,7 @@ leave a channel/query .TP .BI /m " #channel/user msg " write a message to #channel/user +.TP .BI /t " topic" set the channel topic .TP diff --git a/sic.c b/sic.c index 95f822a..9b06c6b 100644 --- a/sic.c +++ b/sic.c @@ -27,6 +27,7 @@ static const char *fullname = "Anselm R. Garbe"; static const char *password = NULL; static char bufin[MAXMSG], bufout[MAXMSG]; +static char channel[256]; static int srv; static time_t trespond; @@ -72,7 +73,7 @@ parsein(char *msg) if((p = strchr(msg, ' '))) *(p++) = 0; if(msg[0] != '/' && msg[0] != 0) { - privmsg(msg, p); + privmsg(channel, p); return; } if((p = strchr(&msg[3], ' '))) @@ -92,6 +93,12 @@ parsein(char *msg) else snprintf(bufout, sizeof(bufout), "PART %s :sic\r\n", &msg[3]); break; + case 'm': + privmsg(msg, p); + break; + case 's': + strncpy(channel, msg, sizeof(channel)); + break; case 't': snprintf(bufout, sizeof(bufout), "TOPIC %s :%s\r\n", &msg[3], p); break; @@ -275,6 +282,7 @@ main(int argc, char *argv[]) nick, nick, host, fullname ? fullname : nick); write(srv, bufout, strlen(bufout)); + channel[0] = 0; setbuf(stdout, NULL); /* unbuffered stdout */ for(;;) { FD_ZERO(&rd); -- 2.39.2