diff options
author | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-08-25 01:20:25 -0500 |
---|---|---|
committer | Epoch Qwert <epoch@53flpnlls43fcguy.onion> | 2014-08-25 01:20:25 -0500 |
commit | 3647474523c6112a84dbe7576d005a617dea9b5a (patch) | |
tree | 453fbf932156b7030fb6db75308044f04ef19a7b | |
parent | 732a3bba7db2c4f915b569b00bd9f86b386beebb (diff) | |
download | segfault-3647474523c6112a84dbe7576d005a617dea9b5a.tar.gz segfault-3647474523c6112a84dbe7576d005a617dea9b5a.zip |
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
-rw-r--r-- | segfault.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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")) { |