fixed IRCParser.c: mark only bots as invisible when joining a +D channel
[NeonServV5.git] / src / IRCParser.c
index 97e851aa2eb63b8b4ed0ff7bb2212f5ee99e6244..c4999828a6b0f889da575f8999e4e48be5e3e22b 100644 (file)
@@ -58,9 +58,9 @@ static void parse_line(struct ClientSocket *client, char *line) {
     int argc = 0;
     char *argv[MAXNUMPARAMS];
     #ifdef HAVE_THREADS
-    printf("[%lu recv %lu] %s\n", syscall(SYS_gettid), (unsigned long) strlen(line), line);
+    putlog(LOGLEVEL_RAW, "[%d recv %lu] %s\n", getCurrentThreadID(), (unsigned long) strlen(line), line);
     #else
-    printf("[recv %lu] %s\n", (unsigned long) strlen(line), line);
+    putlog(LOGLEVEL_RAW, "[recv %lu] %s\n", (unsigned long) strlen(line), line);
     #endif
     if(line[0] == ':')
         line++;
@@ -219,7 +219,7 @@ static IRC_CMD(raw_join) {
         putsock(client, "MODE %s +b", chan->name);
     } else if(!isUserOnChan(user, chan) && ((chan->flags & CHANFLAG_RECEIVED_USERLIST) || isBot(user))) {
         struct ChanUser *chanuser = addChanUser(chan, user);
-        if(isModeSet(chan->modes, 'D'))
+        if(isBot(user) && isModeSet(chan->modes, 'D')) //if the bot joins a channel it could also be invisible
             chanuser->flags |= CHANUSERFLAG_INVISIBLE;
         if(!noEvent) {
             if(wasRegistering)