- cli_flags(cptr) &= ~FLAGS_PINGSENT;
- cli_lasttime(cptr) = CurrentTime;
- /*
- * Check to see if this is a PONG :cookie reply from an
- * unregistered user. If so, process it. -record
- */
- if (0 != cli_cookie(sptr) && COOKIE_VERIFIED != cli_cookie(sptr)) {
- if (parc > 1 && cli_cookie(sptr) == atol(parv[parc - 1])) {
- cli_cookie(sptr) = COOKIE_VERIFIED;
- if (cli_user(sptr) && *(cli_user(sptr))->host && (cli_name(sptr))[0])
- /*
- * NICK and USER OK
- */
- return register_user(cptr, sptr, cli_name(sptr), cli_user(sptr)->username);
- }
- else
- send_reply(sptr, SND_EXPLICIT | ERR_BADPING,
- ":To connect, type /QUOTE PONG %u", cli_cookie(sptr));
- }
- return 0;
+ ClearPingSent(cptr);
+ return (parc > 1) ? auth_set_pong(cli_auth(sptr), strtoul(parv[parc - 1], NULL, 10)) : 0;