event_registered(user, from);
user->flags &= ~USERFLAG_WAS_REGISTERING;
} else if(!(chan->flags & CHANFLAG_RECEIVED_USERLIST)) {
+ if(client->user != user) { //bots are allowed to add themselves
+ DESYNCHRONIZE(cache_sync);
+ return 1; //ignore join
+ }
+
chanuser = addChanUser(chan, user);
chanuser->visCount = 1;
- if(isBot(user) && isModeSet(chan->modes, 'D')) //if the bot joins a channel it could also be invisible
+ if(isModeSet(chan->modes, 'D')) //if the bot joins a channel it could also be invisible
chanuser->flags |= CHANUSERFLAG_INVISIBLE;
get_userlist_with_invisible(chan, 0, got_channel_userlist, chanuser);