]> jfr.im git - irc/quakenet/snircd-patchqueue.git/commitdiff
showumodehtoclients: fix -h mode change not showing to client
authorwiebe <redacted>
Tue, 6 Apr 2010 18:41:59 +0000 (20:41 +0200)
committerwiebe <redacted>
Tue, 6 Apr 2010 18:41:59 +0000 (20:41 +0200)
showumodehtoclients.patch

index 459f69307ad00fcea0950da178ffa0fbe540a32b..479b4a45832a378f027679689c9944aec40fe5ae 100644 (file)
@@ -167,19 +167,28 @@ diff -r 4c7b03099b6f ircd/s_user.c
          *m++ = userModeList[i].c;
      }
      *m = '\0';
-@@ -1517,8 +1518,10 @@
+@@ -1239,6 +1240,9 @@
+     return 0;
+   }
++  if (IsSetHost(sptr))
++    alreadyh = 1;
++
+   /*
+    * find flags already set for user
+    * why not just copy them?
+@@ -1517,8 +1521,9 @@
    if (do_set_host) {
      /* We clear the flag in the old mask, so that the +h will be sent */
      /* Only do this if we're SETTING +h and it succeeded */
 -    if (set_hostmask(sptr, hostmask, password) && hostmask)
 +    if (set_hostmask(sptr, hostmask, password) && hostmask) {
        FlagClr(&setflags, FLAG_SETHOST);
-+      alreadyh = 1;
 +    }
    }
  
    if (IsRegistered(sptr)) {
-@@ -1569,7 +1572,7 @@
+@@ -1569,7 +1574,7 @@
      }
      assert(UserStats.opers <= UserStats.clients + UserStats.unknowns);
      assert(UserStats.inv_clients <= UserStats.clients + UserStats.unknowns);
@@ -188,7 +197,7 @@ diff -r 4c7b03099b6f ircd/s_user.c
    }
  
    return 0;
-@@ -1644,9 +1647,11 @@
+@@ -1644,9 +1649,11 @@
   * @param[in] old Pre-change set of modes for \a sptr.
   * @param[in] sendset One of ALL_UMODES, SEND_UMODES_BUT_OPER,
   * SEND_UMODES, to select which changed user modes to send.
@@ -201,7 +210,7 @@ diff -r 4c7b03099b6f ircd/s_user.c
  {
    int i;
    int flag;
-@@ -1689,12 +1694,15 @@
+@@ -1689,12 +1696,15 @@
      }
      /* Special case for SETHOST.. */
      if (flag == FLAG_SETHOST) {
@@ -213,7 +222,7 @@ diff -r 4c7b03099b6f ircd/s_user.c
 -      if (!FlagHas(old, flag))        
 +
 +      /* do not show +h if client already had it */
-+      if (cptr && MyUser(cptr) && alreadyh)
++      if (cptr && MyUser(cptr) && IsSetHost(cptr) && alreadyh)
 +        continue;
 +
 +      /* If we're setting +h, add the parameter later,