+ /* If they get both +x and an account during registration, hide
+ * their hostmask here. Calling hide_hostmask() from IAuth's
+ * account assignment causes a numeric reply during registration.
+ */
+ if (HasHiddenHost(sptr))
+ hide_hostmask(sptr, FLAG_HIDDENHOST);
+ if (IsInvisible(sptr))
+ ++UserStats.inv_clients;
+ if (IsOper(sptr))
+ ++UserStats.opers;
+
+ tmpstr = umode_str(sptr);
+ /* Send full IP address to IPv6-grokking servers. */
+ sendcmdto_flag_serv_butone(user->server, CMD_NICK, cptr,
+ FLAG_IPV6, FLAG_LAST_FLAG,
+ "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+ cli_name(sptr), cli_hopcount(sptr) + 1,
+ cli_lastnick(sptr),
+ user->username, user->realhost,
+ *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+ iptobase64(ip_base64, &cli_ip(sptr), sizeof(ip_base64), 1),
+ NumNick(sptr), cli_info(sptr));
+ /* Send fake IPv6 addresses to pre-IPv6 servers. */
+ sendcmdto_flag_serv_butone(user->server, CMD_NICK, cptr,
+ FLAG_LAST_FLAG, FLAG_IPV6,
+ "%s %d %Tu %s %s %s%s%s%s %s%s :%s",
+ cli_name(sptr), cli_hopcount(sptr) + 1,
+ cli_lastnick(sptr),
+ user->username, user->realhost,
+ *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
+ iptobase64(ip_base64, &cli_ip(sptr), sizeof(ip_base64), 0),
+ NumNick(sptr), cli_info(sptr));
+
+ /* Send user mode to client */
+ if (MyUser(sptr))
+ {
+ static struct Flags flags; /* automatically initialized to zeros */
+ /* To avoid sending +r to the client due to auth-on-connect, set
+ * the "old" FLAG_ACCOUNT bit to match the client's value.
+ */
+ if (IsAccount(cptr))
+ FlagSet(&flags, FLAG_ACCOUNT);
+ else
+ FlagClr(&flags, FLAG_ACCOUNT);
+ client_set_privs(sptr, NULL);
+ send_umode(cptr, sptr, &flags, ALL_UMODES);
+ if ((cli_snomask(sptr) != SNO_DEFAULT) && HasFlag(sptr, FLAG_SERVNOTICE))
+ send_reply(sptr, RPL_SNOMASK, cli_snomask(sptr), cli_snomask(sptr));
+ }