From ecb12efc5ce737532402167679c0f7ffb22c495b Mon Sep 17 00:00:00 2001 From: epochqwert Date: Sun, 8 Mar 2015 07:18:38 -0500 Subject: fixed support of optional : before channel name when parsing JOIN messages from server. --- libirc/examples/link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libirc/examples') diff --git a/libirc/examples/link.c b/libirc/examples/link.c index 5c13e94..0c9e7dd 100644 --- a/libirc/examples/link.c +++ b/libirc/examples/link.c @@ -91,7 +91,7 @@ void line_handler(int fd,char *line) {//this should be built into the libary? } if(s && user->nick && t) { if(!strcmp(s,"JOIN")) { - snprintf(tmp,sizeof(tmp)-1,"%cACTION %s has joined %s%c",1,user->nick,t+1,1); + snprintf(tmp,sizeof(tmp)-1,"%cACTION %s has joined %s%c",1,user->nick,t+(*t==':'),1); privmsg_others(fd,tmp); //send a join message to the other end. } @@ -116,7 +116,7 @@ int main(int argc,char *argv[]) { printf("%d server: %s port: %s channel: %s\n",i,argv[(i*3)+1],argv[(i*3)+2],argv[(i*3)+3]); fds[i]=serverConnect(argv[(i*3)+1],argv[(i*3)+2]); chans[i]=strdup(argv[(i*3)+3]); - mywrite(fds[i],"NICK link\r\nUSER a b c :d\r\n"); + mywrite(fds[i],"NICK link8239\r\nUSER a b c :d\r\n"); } fds[i]=-1; //heh. you can write your own code for picking a different nick per server. fuck you. -- cgit v1.2.3