From 3647474523c6112a84dbe7576d005a617dea9b5a Mon Sep 17 00:00:00 2001 From: Epoch Qwert Date: Mon, 25 Aug 2014 01:20:25 -0500 Subject: forgot in last commit: changed up some of the line handler's parsing. added echo detection for odd IRC servers that send the message back to sender --- segfault.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/segfault.c b/segfault.c index 5a4446c..1d439f0 100644 --- a/segfault.c +++ b/segfault.c @@ -1080,13 +1080,11 @@ void line_handler(int fd,char *line) {//this should be built into the libary? } } if(s && t && u) { - if(!strcmp(s,"PRIVMSG")) { - u++; - if(*t == '#')//channel. - message_handler(fd,t,user,u,0); + if(!strcmp(s,"PRIVMSG") && strcmp(user->nick,myuser->nick)) + if(strcmp(user->nick,myuser->nick)) + message_handler(fd,*t=='#'?t:user->nick,user,++u,0); else - message_handler(fd,user->nick,user,u,0); - } + if(debug) privmsg(fd,*t=='#'?t:user->nick,"This server has an echo"); } if(s && user->nick && t) { if(!strcmp(s,"JOIN")) { -- cgit v1.2.3