]>
Commit | Line | Data |
---|---|---|
1 | remove HasSetHost() macro, IsSetHost() is enough (they were the same) | |
2 | ||
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. | |
5 | ||
6 | diff -r dae0306eda00 include/client.h | |
7 | --- a/include/client.h | |
8 | +++ b/include/client.h | |
9 | @@ -627,7 +627,6 @@ | |
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)) | |
14 | ||
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 | |
18 | --- a/ircd/channel.c | |
19 | +++ b/ircd/channel.c | |
20 | @@ -384,12 +384,12 @@ | |
21 | ircd_ntoa_r(iphost, &cli_ip(cptr)); | |
22 | ||
23 | /* sr is real host if +h */ | |
24 | - if (HasSetHost(cptr)) | |
25 | + if (IsSetHost(cptr)) | |
26 | sr = cli_user(cptr)->realhost; | |
27 | ||
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; | |
33 | } else { | |
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 | |
38 | @@ -104,7 +104,7 @@ | |
39 | * of +x. If an oper wants the real host, he should go to | |
40 | * /whois to get it. | |
41 | */ | |
42 | - (HasHiddenHost(cptr) || HasSetHost(cptr)) && (sptr != cptr) ? | |
43 | + (HasHiddenHost(cptr) || IsSetHost(cptr)) && (sptr != cptr) ? | |
44 | cli_user(cptr)->host : cli_user(cptr)->realhost); | |
45 | } | |
46 | ||
47 | diff -r dae0306eda00 ircd/m_userip.c | |
48 | --- a/ircd/m_userip.c | |
49 | +++ b/ircd/m_userip.c | |
50 | @@ -106,7 +106,7 @@ | |
51 | * of +x. If an oper wants the real IP, he should go to | |
52 | * /whois to get it. | |
53 | */ | |
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))); | |
58 | } | |
59 | diff -r dae0306eda00 ircd/m_who.c | |
60 | --- a/ircd/m_who.c | |
61 | +++ b/ircd/m_who.c | |
62 | @@ -394,14 +394,14 @@ | |
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) | |
69 | || !IsAnOper(sptr) | |
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))) | |
79 | @@ -433,14 +433,14 @@ | |
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) | |
86 | || !IsAnOper(sptr) | |
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 | |
97 | --- a/ircd/m_whois.c | |
98 | +++ b/ircd/m_whois.c | |
99 | @@ -214,7 +214,7 @@ | |
100 | if (IsAccount(acptr)) | |
101 | send_reply(sptr, RPL_WHOISACCOUNT, name, user->account); | |
102 | ||
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))); | |
107 | ||
108 | diff -r dae0306eda00 ircd/s_user.c | |
109 | --- a/ircd/s_user.c | |
110 | +++ b/ircd/s_user.c | |
111 | @@ -965,7 +965,7 @@ | |
112 | } | |
113 | ||
114 | SetFlag(cptr, flag); | |
115 | - if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || HasSetHost(cptr)) | |
116 | + if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT) || IsSetHost(cptr)) | |
117 | return 0; | |
118 | ||
119 | sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered"); | |
120 | diff -r dae0306eda00 ircd/send.c | |
121 | --- a/ircd/send.c | |
122 | +++ b/ircd/send.c | |
123 | @@ -281,7 +281,7 @@ | |
124 | { | |
125 | case MATCH_HOST: | |
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)); | |
129 | case MATCH_SERVER: | |
130 | default: | |
131 | return (match(mask, cli_name(cli_user(one)->server)) == 0); | |
132 | diff -r dae0306eda00 ircd/whocmds.c | |
133 | --- a/ircd/whocmds.c | |
134 | +++ b/ircd/whocmds.c | |
135 | @@ -134,7 +134,7 @@ | |
136 | ||
137 | if (fields & WHO_FIELD_NIP) | |
138 | { | |
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)); | |
143 | *(p1++) = ' '; | |
144 | @@ -210,7 +210,7 @@ | |
145 | *(p1++) = 'w'; | |
146 | if (SendDebug(acptr)) | |
147 | *(p1++) = 'g'; | |
148 | - if (HasSetHost(acptr)) | |
149 | + if (IsSetHost(acptr)) | |
150 | *(p1++) = 'h'; | |
151 | } | |
152 | if (HasHiddenHost(acptr)) |