static time_t last_too_many2;
assert(cptr == sptr);
+ assert(cli_unreg(sptr) == 0);
if (!IsIAuthed(sptr)) {
if (iauth_active)
return iauth_start_client(iauth_active, sptr);
}
hAddClient(sptr);
+ cli_unreg(sptr) &= ~CLIREG_NICK; /* nickname now set */
+
/*
* If the client hasn't gotten a cookie-ping yet,
* choose a cookie and send it. -record!jegelhof@cloud9.net
} while (!cli_cookie(sptr));
sendrawto_one(cptr, MSG_PING " :%u", cli_cookie(sptr));
}
- else if (*(cli_user(sptr))->host && cli_cookie(sptr) == COOKIE_VERIFIED) {
+ else if (!cli_unreg(sptr)) {
/*
* USER and PONG already received, now we have NICK.
* register_user may reject the client and call exit_client
for (chan = (cli_user(cptr))->channel; chan;
chan = chan->next_channel)
ClearBanValid(chan);
+ break;
default:
return 0;
}
/** Check whether \a sptr is allowed to send a message to \a acptr.
* If \a sptr is a remote user, it means some server has an outdated
* SILENCE list for \a acptr, so send the missing SILENCE mask(s) back
- * in the direction of \a sptr.
+ * in the direction of \a sptr. Skip the check if \a sptr is a server.
* @param[in] sptr Client trying to send a message.
* @param[in] acptr Destination of message.
* @return Non-zero if \a sptr is SILENCEd by \a acptr, zero if not.
size_t buf_used, slen;
char buf[BUFSIZE];
- if (!(user = cli_user(acptr))
+ if (IsServer(sptr) || !(user = cli_user(acptr))
|| !(found = find_ban(sptr, user->silence)))
return 0;
assert(!(found->flags & BAN_EXCEPTION));