new stuff
This commit is contained in:
parent
900223808f
commit
f0e089e967
1
sic.1
1
sic.1
@ -24,6 +24,7 @@ leave a channel/query
|
|||||||
.TP
|
.TP
|
||||||
.BI /m " #channel/user msg "
|
.BI /m " #channel/user msg "
|
||||||
write a message to #channel/user
|
write a message to #channel/user
|
||||||
|
.TP
|
||||||
.BI /t " topic"
|
.BI /t " topic"
|
||||||
set the channel topic
|
set the channel topic
|
||||||
.TP
|
.TP
|
||||||
|
10
sic.c
10
sic.c
@ -27,6 +27,7 @@ static const char *fullname = "Anselm R. Garbe";
|
|||||||
static const char *password = NULL;
|
static const char *password = NULL;
|
||||||
|
|
||||||
static char bufin[MAXMSG], bufout[MAXMSG];
|
static char bufin[MAXMSG], bufout[MAXMSG];
|
||||||
|
static char channel[256];
|
||||||
static int srv;
|
static int srv;
|
||||||
static time_t trespond;
|
static time_t trespond;
|
||||||
|
|
||||||
@ -72,7 +73,7 @@ parsein(char *msg)
|
|||||||
if((p = strchr(msg, ' ')))
|
if((p = strchr(msg, ' ')))
|
||||||
*(p++) = 0;
|
*(p++) = 0;
|
||||||
if(msg[0] != '/' && msg[0] != 0) {
|
if(msg[0] != '/' && msg[0] != 0) {
|
||||||
privmsg(msg, p);
|
privmsg(channel, p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if((p = strchr(&msg[3], ' ')))
|
if((p = strchr(&msg[3], ' ')))
|
||||||
@ -92,6 +93,12 @@ parsein(char *msg)
|
|||||||
else
|
else
|
||||||
snprintf(bufout, sizeof(bufout), "PART %s :sic\r\n", &msg[3]);
|
snprintf(bufout, sizeof(bufout), "PART %s :sic\r\n", &msg[3]);
|
||||||
break;
|
break;
|
||||||
|
case 'm':
|
||||||
|
privmsg(msg, p);
|
||||||
|
break;
|
||||||
|
case 's':
|
||||||
|
strncpy(channel, msg, sizeof(channel));
|
||||||
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
snprintf(bufout, sizeof(bufout), "TOPIC %s :%s\r\n", &msg[3], p);
|
snprintf(bufout, sizeof(bufout), "TOPIC %s :%s\r\n", &msg[3], p);
|
||||||
break;
|
break;
|
||||||
@ -275,6 +282,7 @@ main(int argc, char *argv[])
|
|||||||
nick, nick, host, fullname ? fullname : nick);
|
nick, nick, host, fullname ? fullname : nick);
|
||||||
write(srv, bufout, strlen(bufout));
|
write(srv, bufout, strlen(bufout));
|
||||||
|
|
||||||
|
channel[0] = 0;
|
||||||
setbuf(stdout, NULL); /* unbuffered stdout */
|
setbuf(stdout, NULL); /* unbuffered stdout */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
FD_ZERO(&rd);
|
FD_ZERO(&rd);
|
||||||
|
Loading…
Reference in New Issue
Block a user