Complain to the client when it sends a line that is too long.
[ircu2.10.12-pk.git] / ircd / s_user.c
index ecedb0629085a789566bed87b7aab699568ac1be..fb08e0bcc8fb7307c5161ebe10f5820fd3786223 100644 (file)
@@ -456,6 +456,12 @@ int register_user(struct Client *cptr, struct Client *sptr)
     ++UserStats.inv_clients;
   if (IsOper(sptr))
     ++UserStats.opers;
+  /* 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);
 
   tmpstr = umode_str(sptr);
   /* Send full IP address to IPv6-grokking servers. */
@@ -984,7 +990,6 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv
 {
   char** p;
   char*  m;
-  struct Client *acptr;
   int what;
   int i;
   struct Flags setflags;
@@ -996,27 +1001,6 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv
 
   what = MODE_ADD;
 
-  if (parc < 2)
-    return need_more_params(sptr, "MODE");
-
-  if (!(acptr = FindUser(parv[1])))
-  {
-    if (MyConnect(sptr))
-      send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]);
-    return 0;
-  }
-
-  if (IsServer(sptr) || sptr != acptr)
-  {
-    if (IsServer(cptr))
-      sendwallto_group_butone(&me, WALL_WALLOPS, 0, 
-                           "MODE for User %s from %s!%s", parv[1],
-                            cli_name(cptr), cli_name(sptr));
-    else
-      send_reply(sptr, ERR_USERSDONTMATCH);
-    return 0;
-  }
-
   if (parc < 3)
   {
     m = buf;
@@ -1211,7 +1195,8 @@ int set_user_mode(struct Client *cptr, struct Client *sptr, int parc, char *parv
     ++UserStats.inv_clients;
   if (!FlagHas(&setflags, FLAG_HIDDENHOST) && do_host_hiding)
     hide_hostmask(sptr, FLAG_HIDDENHOST);
-  send_umode_out(cptr, sptr, &setflags, prop);
+  if (IsRegistered(sptr))
+    send_umode_out(cptr, sptr, &setflags, prop);
 
   return 0;
 }