]> jfr.im git - irc/quakenet/snircd-patchqueue.git/commitdiff
issethost: remove HasSetHost() macro, IsSetHost() is enough (they were the same)
authorwiebe <redacted>
Fri, 2 Apr 2010 12:34:05 +0000 (14:34 +0200)
committerwiebe <redacted>
Fri, 2 Apr 2010 12:34:05 +0000 (14:34 +0200)
issethost.patch [new file with mode: 0644]
series

diff --git a/issethost.patch b/issethost.patch
new file mode 100644 (file)
index 0000000..f634956
--- /dev/null
@@ -0,0 +1,152 @@
+remove HasSetHost() macro, IsSetHost() is enough (they were the same)
+
+There is a IsHiddenHost() for +x (usermode), and a HasHiddenHost() for +rx (user has host hidden),
+but we do not need this for sethost, +h set means host is hidden.
+
+diff -r dae0306eda00 include/client.h
+--- a/include/client.h
++++ b/include/client.h
+@@ -627,7 +627,6 @@
+ #define HasHiddenHost(x)        (IsHiddenHost(x) && IsAccount(x))
+ /** Return non-zero if the client is using a spoofhost */
+ #define IsSetHost(x)            HasFlag(x, FLAG_SETHOST)
+-#define HasSetHost(x)           (IsSetHost(x))
+ /** Mark a client as having an in-progress net.burst. */
+ #define SetBurst(x)             SetFlag(x, FLAG_BURST)
+diff -r dae0306eda00 ircd/channel.c
+--- a/ircd/channel.c
++++ b/ircd/channel.c
+@@ -384,12 +384,12 @@
+   ircd_ntoa_r(iphost, &cli_ip(cptr));
+   /* sr is real host if +h */
+-  if (HasSetHost(cptr))
++  if (IsSetHost(cptr))
+     sr = cli_user(cptr)->realhost;
+   /* if +x and not +h sa is real host, if -x or +h sa is the account host */
+   if (IsAccount(cptr)) {
+-    if (HasHiddenHost(cptr) && !HasSetHost(cptr)) {
++    if (HasHiddenHost(cptr) && !IsSetHost(cptr)) {
+       sa = cli_user(cptr)->realhost;
+     } else {
+       ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s",
+diff -r dae0306eda00 ircd/m_userhost.c
+--- a/ircd/m_userhost.c
++++ b/ircd/m_userhost.c
+@@ -104,7 +104,7 @@
+              * of +x.  If an oper wants the real host, he should go to
+              * /whois to get it.
+              */
+-            (HasHiddenHost(cptr) || HasSetHost(cptr)) && (sptr != cptr) ?
++            (HasHiddenHost(cptr) || IsSetHost(cptr)) && (sptr != cptr) ?
+             cli_user(cptr)->host : cli_user(cptr)->realhost);
+ }
+diff -r dae0306eda00 ircd/m_userip.c
+--- a/ircd/m_userip.c
++++ b/ircd/m_userip.c
+@@ -106,7 +106,7 @@
+              * of +x.  If an oper wants the real IP, he should go to
+              * /whois to get it.
+              */
+-            ((HasHiddenHost(cptr) || HasSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
++            ((HasHiddenHost(cptr) || IsSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
+             feature_str(FEAT_HIDDEN_IP) :
+             ircd_ntoa(&cli_ip(cptr)));
+ }
+diff -r dae0306eda00 ircd/m_who.c
+--- a/ircd/m_who.c
++++ b/ircd/m_who.c
+@@ -394,14 +394,14 @@
+               && ((!(matchsel & WHO_FIELD_HOS))
+               || matchexec(cli_user(acptr)->host, mymask, minlen))
+               && ((!(matchsel & WHO_FIELD_HOS))
+-              || !HasSetHost(acptr)
++              || !IsSetHost(acptr)
+             || !HasHiddenHost(acptr)
+             || !IsAnOper(sptr)
+               || matchexec(cli_user(acptr)->realhost, mymask, minlen))
+               && ((!(matchsel & WHO_FIELD_REN))
+               || matchexec(cli_info(acptr), mymask, minlen))
+               && ((!(matchsel & WHO_FIELD_NIP))
+-              || ((HasHiddenHost(acptr) || HasSetHost(acptr)) && !IsAnOper(sptr))
++              || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
+               || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+               && ((!(matchsel & WHO_FIELD_ACC))
+               || matchexec(cli_user(acptr)->account, mymask, minlen)))
+@@ -433,14 +433,14 @@
+             && ((!(matchsel & WHO_FIELD_HOS))
+             || matchexec(cli_user(acptr)->host, mymask, minlen))
+             && ((!(matchsel & WHO_FIELD_HOS))
+-            || !HasSetHost(acptr)
++            || !IsSetHost(acptr)
+           || !HasHiddenHost(acptr)
+           || !IsAnOper(sptr)
+             || matchexec(cli_user(acptr)->realhost, mymask, minlen))
+             && ((!(matchsel & WHO_FIELD_REN))
+             || matchexec(cli_info(acptr), mymask, minlen))
+             && ((!(matchsel & WHO_FIELD_NIP))
+-            || ((HasHiddenHost(acptr) || HasSetHost(acptr)) && !IsAnOper(sptr))
++            || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
+             || !ipmask_check(&cli_ip(acptr), &imask, ibits))
+             && ((!(matchsel & WHO_FIELD_ACC))
+             || matchexec(cli_user(acptr)->account, mymask, minlen)))
+diff -r dae0306eda00 ircd/m_whois.c
+--- a/ircd/m_whois.c
++++ b/ircd/m_whois.c
+@@ -214,7 +214,7 @@
+     if (IsAccount(acptr))
+       send_reply(sptr, RPL_WHOISACCOUNT, name, user->account);
+-    if ((HasHiddenHost(acptr) || HasSetHost(acptr)) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
++    if ((HasHiddenHost(acptr) || IsSetHost(acptr)) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
+       send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
+                  user->realhost, ircd_ntoa(&cli_ip(acptr)));
+diff -r dae0306eda00 ircd/s_user.c
+--- a/ircd/s_user.c
++++ b/ircd/s_user.c
+@@ -965,7 +965,7 @@
+   }
+   SetFlag(cptr, flag);
+-  if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || HasSetHost(cptr))
++  if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || IsSetHost(cptr))
+     return 0;
+   sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered");
+diff -r dae0306eda00 ircd/send.c
+--- a/ircd/send.c
++++ b/ircd/send.c
+@@ -281,7 +281,7 @@
+   {
+     case MATCH_HOST:
+       return (match(mask, cli_user(one)->host) == 0 ||
+-        ((HasHiddenHost(one) || HasSetHost(one)) && match(mask, cli_user(one)->realhost) == 0));
++        ((HasHiddenHost(one) || IsSetHost(one)) && match(mask, cli_user(one)->realhost) == 0));
+     case MATCH_SERVER:
+     default:
+       return (match(mask, cli_name(cli_user(one)->server)) == 0);
+diff -r dae0306eda00 ircd/whocmds.c
+--- a/ircd/whocmds.c
++++ b/ircd/whocmds.c
+@@ -134,7 +134,7 @@
+   if (fields & WHO_FIELD_NIP)
+   {
+-    const char* p2 = (HasHiddenHost(acptr) || HasSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
++    const char* p2 = (HasHiddenHost(acptr) || IsSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
+       feature_str(FEAT_HIDDEN_IP) :
+       ircd_ntoa(&cli_ip(acptr));
+     *(p1++) = ' ';
+@@ -210,7 +210,7 @@
+         *(p1++) = 'w';
+       if (SendDebug(acptr))
+         *(p1++) = 'g';
+-      if (HasSetHost(acptr))
++      if (IsSetHost(acptr))
+         *(p1++) = 'h';
+     }
+     if (HasHiddenHost(acptr))
diff --git a/series b/series
index 4f66aab7dbe562c9b01325902ae4d48d05dd51f5..e9b8cdedca5ea7c71a12a00e9fc0ea1727c12e5a 100644 (file)
--- a/series
+++ b/series
@@ -1,6 +1,7 @@
 realusernamesethost.patch
 sethostoldcode.patch
 sethostnewhostmask.patch
 realusernamesethost.patch
 sethostoldcode.patch
 sethostnewhostmask.patch
+issethost.patch
 cprivmsgerracconly.patch
 badchanzombie.patch
 badchanlocalkick.patch
 cprivmsgerracconly.patch
 badchanzombie.patch
 badchanlocalkick.patch