summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-08-25 01:20:25 -0500
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-08-25 01:20:25 -0500
commit3647474523c6112a84dbe7576d005a617dea9b5a (patch)
tree453fbf932156b7030fb6db75308044f04ef19a7b
parent732a3bba7db2c4f915b569b00bd9f86b386beebb (diff)
downloadsegfault-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.c10
1 files 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")) {