static const char *password = NULL;
static char bufin[MAXMSG], bufout[MAXMSG];
+static char channel[256];
static int srv;
static time_t trespond;
if((p = strchr(msg, ' ')))
*(p++) = 0;
if(msg[0] != '/' && msg[0] != 0) {
- privmsg(msg, p);
+ privmsg(channel, p);
return;
}
if((p = strchr(&msg[3], ' ')))
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;
nick, nick, host, fullname ? fullname : nick);
write(srv, bufout, strlen(bufout));
+ channel[0] = 0;
setbuf(stdout, NULL); /* unbuffered stdout */
for(;;) {
FD_ZERO(&rd);