+2005-04-25 Michael Poole <mdpoole@troilus.org>
+
+ * ircd/s_user.c (register_user): Replace call with set_user_mode()
+ with a direct parsing of user modes. To match this, revert the
+ initial display of usermode to how it was done before.
+
2005-04-24 Michael Poole <mdpoole@troilus.org>
* doc/example.conf: Document new autoconnect field of Connect.
/*
* Set user's initial modes
*/
- parv[0] = (char*)nick;
- parv[1] = (char*)nick;
- parv[2] = (char*)client_get_default_umode(sptr);
- parv[3] = NULL; /* needed in case of +s */
- set_user_mode(sptr, sptr, 3, parv);
- ClearHiddenHost(sptr); /* just in case somebody stuck +x in there */
+ for (tmpstr = (char*)client_get_default_umode(sptr); *tmpstr; ++tmpstr) {
+ switch (*tmpstr) {
+ case 's':
+ if (!feature_bool(FEAT_HIS_SNOTICES_OPER_ONLY)) {
+ SetServNotice(sptr);
+ set_snomask(sptr, SNO_DEFAULT, SNO_SET);
+ }
+ break;
+ case 'w':
+ if (!feature_bool(FEAT_WALLOPS_OPER_ONLY))
+ SetWallops(sptr);
+ break;
+ case 'i':
+ SetInvisible(sptr);
+ break;
+ case 'd':
+ SetDeaf(sptr);
+ break;
+ case 'g':
+ if (!feature_bool(FEAT_HIS_DEBUG_OPER_ONLY))
+ SetDebug(sptr);
+ break;
+ }
+ }
}
else
/* if (IsServer(cptr)) */
iptobase64(ip_base64, &cli_ip(sptr), sizeof(ip_base64), 0),
NumNick(sptr), cli_info(sptr));
- /* Send server notice mask to client */
- if (MyUser(sptr) && (cli_snomask(sptr) != SNO_DEFAULT) && HasFlag(sptr, FLAG_SERVNOTICE))
- send_reply(sptr, RPL_SNOMASK, cli_snomask(sptr), cli_snomask(sptr));
-
+ /* Send user mode to client */
+ if (MyUser(sptr))
+ {
+ static struct Flags flags; /* automatically initialized to zeros */
+ 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));
+ }
return 0;
}