1 remove HasSetHost() macro, IsSetHost() is enough (they were the same)
3 There is a IsHiddenHost() for +x (usermode), and a HasHiddenHost() for +rx (user has host hidden),
4 but we do not need this for sethost, +h set means host is hidden.
6 diff -r dae0306eda00 include/client.h
10 #define HasHiddenHost(x) (IsHiddenHost(x) && IsAccount(x))
11 /** Return non-zero if the client is using a spoofhost */
12 #define IsSetHost(x) HasFlag(x, FLAG_SETHOST)
13 -#define HasSetHost(x) (IsSetHost(x))
15 /** Mark a client as having an in-progress net.burst. */
16 #define SetBurst(x) SetFlag(x, FLAG_BURST)
17 diff -r dae0306eda00 ircd/channel.c
21 ircd_ntoa_r(iphost, &cli_ip(cptr));
23 /* sr is real host if +h */
24 - if (HasSetHost(cptr))
25 + if (IsSetHost(cptr))
26 sr = cli_user(cptr)->realhost;
28 /* if +x and not +h sa is real host, if -x or +h sa is the account host */
29 if (IsAccount(cptr)) {
30 - if (HasHiddenHost(cptr) && !HasSetHost(cptr)) {
31 + if (HasHiddenHost(cptr) && !IsSetHost(cptr)) {
32 sa = cli_user(cptr)->realhost;
34 ircd_snprintf(0, tmphost, HOSTLEN, "%s.%s",
35 diff -r dae0306eda00 ircd/m_userhost.c
36 --- a/ircd/m_userhost.c
37 +++ b/ircd/m_userhost.c
39 * of +x. If an oper wants the real host, he should go to
42 - (HasHiddenHost(cptr) || HasSetHost(cptr)) && (sptr != cptr) ?
43 + (HasHiddenHost(cptr) || IsSetHost(cptr)) && (sptr != cptr) ?
44 cli_user(cptr)->host : cli_user(cptr)->realhost);
47 diff -r dae0306eda00 ircd/m_userip.c
51 * of +x. If an oper wants the real IP, he should go to
54 - ((HasHiddenHost(cptr) || HasSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
55 + ((HasHiddenHost(cptr) || IsSetHost(cptr) || feature_bool(FEAT_HIS_USERIP)) && (sptr != cptr)) ?
56 feature_str(FEAT_HIDDEN_IP) :
57 ircd_ntoa(&cli_ip(cptr)));
59 diff -r dae0306eda00 ircd/m_who.c
63 && ((!(matchsel & WHO_FIELD_HOS))
64 || matchexec(cli_user(acptr)->host, mymask, minlen))
65 && ((!(matchsel & WHO_FIELD_HOS))
66 - || !HasSetHost(acptr)
67 + || !IsSetHost(acptr)
68 || !HasHiddenHost(acptr)
70 || matchexec(cli_user(acptr)->realhost, mymask, minlen))
71 && ((!(matchsel & WHO_FIELD_REN))
72 || matchexec(cli_info(acptr), mymask, minlen))
73 && ((!(matchsel & WHO_FIELD_NIP))
74 - || ((HasHiddenHost(acptr) || HasSetHost(acptr)) && !IsAnOper(sptr))
75 + || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
76 || !ipmask_check(&cli_ip(acptr), &imask, ibits))
77 && ((!(matchsel & WHO_FIELD_ACC))
78 || matchexec(cli_user(acptr)->account, mymask, minlen)))
80 && ((!(matchsel & WHO_FIELD_HOS))
81 || matchexec(cli_user(acptr)->host, mymask, minlen))
82 && ((!(matchsel & WHO_FIELD_HOS))
83 - || !HasSetHost(acptr)
84 + || !IsSetHost(acptr)
85 || !HasHiddenHost(acptr)
87 || matchexec(cli_user(acptr)->realhost, mymask, minlen))
88 && ((!(matchsel & WHO_FIELD_REN))
89 || matchexec(cli_info(acptr), mymask, minlen))
90 && ((!(matchsel & WHO_FIELD_NIP))
91 - || ((HasHiddenHost(acptr) || HasSetHost(acptr)) && !IsAnOper(sptr))
92 + || ((HasHiddenHost(acptr) || IsSetHost(acptr)) && !IsAnOper(sptr))
93 || !ipmask_check(&cli_ip(acptr), &imask, ibits))
94 && ((!(matchsel & WHO_FIELD_ACC))
95 || matchexec(cli_user(acptr)->account, mymask, minlen)))
96 diff -r dae0306eda00 ircd/m_whois.c
100 if (IsAccount(acptr))
101 send_reply(sptr, RPL_WHOISACCOUNT, name, user->account);
103 - if ((HasHiddenHost(acptr) || HasSetHost(acptr)) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
104 + if ((HasHiddenHost(acptr) || IsSetHost(acptr)) && ((IsAnOper(sptr) && HasPriv(sptr, PRIV_USER_PRIVACY)) || acptr == sptr))
105 send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
106 user->realhost, ircd_ntoa(&cli_ip(acptr)));
108 diff -r dae0306eda00 ircd/s_user.c
115 - if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || HasSetHost(cptr))
116 + if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || IsSetHost(cptr))
119 sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered");
120 diff -r dae0306eda00 ircd/send.c
126 return (match(mask, cli_user(one)->host) == 0 ||
127 - ((HasHiddenHost(one) || HasSetHost(one)) && match(mask, cli_user(one)->realhost) == 0));
128 + ((HasHiddenHost(one) || IsSetHost(one)) && match(mask, cli_user(one)->realhost) == 0));
131 return (match(mask, cli_name(cli_user(one)->server)) == 0);
132 diff -r dae0306eda00 ircd/whocmds.c
137 if (fields & WHO_FIELD_NIP)
139 - const char* p2 = (HasHiddenHost(acptr) || HasSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
140 + const char* p2 = (HasHiddenHost(acptr) || IsSetHost(acptr) || feature_bool(FEAT_HIS_USERIP)) && (!IsAnOper(sptr) || (IsAnOper(sptr) && !HasPriv(sptr, PRIV_USER_PRIVACY))) ?
141 feature_str(FEAT_HIDDEN_IP) :
142 ircd_ntoa(&cli_ip(acptr));
146 if (SendDebug(acptr))
148 - if (HasSetHost(acptr))
149 + if (IsSetHost(acptr))
152 if (HasHiddenHost(acptr))