]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * send1.c: Test sendto_* under various conditions | |
3 | * Copyright 2017 Simon Arlott | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation; either version 2 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program; if not, write to the Free Software | |
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | |
18 | * USA | |
19 | */ | |
20 | #include <stdio.h> | |
21 | #include <string.h> | |
22 | #include <stdlib.h> | |
23 | #include <unistd.h> | |
24 | #include "tap/basic.h" | |
25 | ||
26 | #include "ircd_util.h" | |
27 | #include "client_util.h" | |
28 | ||
29 | #include "send.h" | |
30 | #include "s_serv.h" | |
31 | #include "monitor.h" | |
32 | #include "s_conf.h" | |
33 | ||
34 | #define MSG "%s:%d (%s)", __FILE__, __LINE__, __FUNCTION__ | |
35 | ||
36 | // What time is it? | |
37 | #define ADVENTURE_TIME "2017-07-14T02:40:00.000Z" | |
38 | ||
39 | int rb_gettimeofday(struct timeval *tv, void *tz) | |
40 | { | |
41 | if (tv == NULL) { | |
42 | errno = EFAULT; | |
43 | return -1; | |
44 | } | |
45 | tv->tv_sec = 1500000000; | |
46 | tv->tv_usec = 0; | |
47 | return 0; | |
48 | } | |
49 | ||
50 | unsigned int CAP_ACCOUNT_TAG; | |
51 | unsigned int CAP_SERVER_TIME; | |
52 | unsigned int CAP_INVITE_NOTIFY; | |
53 | ||
54 | static struct Client *user; | |
55 | static struct Client *server; | |
56 | static struct Client *remote; | |
57 | static struct Client *server2; | |
58 | static struct Client *remote2; | |
59 | static struct Client *server3; | |
60 | static struct Client *remote3; | |
61 | static struct Channel *channel; | |
62 | static struct Channel *lchannel; | |
63 | ||
64 | static struct Client *local_chan_o; | |
65 | static struct Client *local_chan_ov; | |
66 | static struct Client *local_chan_v; | |
67 | static struct Client *local_chan_p; | |
68 | static struct Client *local_chan_d; | |
69 | static struct Client *local_no_chan; | |
70 | ||
71 | static struct Client *remote_chan_o; | |
72 | static struct Client *remote_chan_ov; | |
73 | static struct Client *remote_chan_v; | |
74 | static struct Client *remote_chan_p; | |
75 | static struct Client *remote_chan_d; | |
76 | ||
77 | static struct Client *remote2_chan_p; | |
78 | static struct Client *remote2_chan_d; | |
79 | ||
80 | static void standard_init(void) | |
81 | { | |
82 | user = make_local_person(); | |
83 | server = make_remote_server(&me); | |
84 | remote = make_remote_person(server); | |
85 | server2 = make_remote_server_name(&me, TEST_SERVER2_NAME); | |
86 | remote2 = make_remote_person_nick(server2, TEST_REMOTE2_NICK); | |
87 | server3 = make_remote_server_name(&me, TEST_SERVER3_NAME); | |
88 | remote3 = make_remote_person_nick(server3, TEST_REMOTE3_NICK); | |
89 | ||
90 | // Expose potential bugs in overlapping capabilities | |
91 | server->localClient->caps |= CAP_ACCOUNT_TAG; | |
92 | server->localClient->caps |= CAP_SERVER_TIME; | |
93 | server2->localClient->caps |= CAP_ACCOUNT_TAG; | |
94 | server2->localClient->caps |= CAP_SERVER_TIME; | |
95 | server3->localClient->caps |= CAP_ACCOUNT_TAG; | |
96 | server3->localClient->caps |= CAP_SERVER_TIME; | |
97 | ||
98 | local_chan_o = make_local_person_nick("LChanOp"); | |
99 | local_chan_ov = make_local_person_nick("LChanOpVoice"); | |
100 | local_chan_v = make_local_person_nick("LChanVoice"); | |
101 | local_chan_p = make_local_person_nick("LChanPeon"); | |
102 | local_chan_d = make_local_person_nick("LChanDeaf"); | |
103 | local_chan_d->umodes |= UMODE_DEAF; | |
104 | local_no_chan = make_local_person_nick("LNoChan"); | |
105 | ||
106 | remote_chan_o = make_remote_person_nick(server, "RChanOp"); | |
107 | remote_chan_ov = make_remote_person_nick(server, "RChanOpVoice"); | |
108 | remote_chan_v = make_remote_person_nick(server, "RChanVoice"); | |
109 | remote_chan_p = make_remote_person_nick(server, "RChanPeon"); | |
110 | remote_chan_d = make_remote_person_nick(server, "RChanDeaf"); | |
111 | remote_chan_d->umodes |= UMODE_DEAF; | |
112 | ||
113 | remote2_chan_p = make_remote_person_nick(server2, "R2ChanPeon"); | |
114 | remote2_chan_d = make_remote_person_nick(server2, "R2ChanDeaf"); | |
115 | remote2_chan_d->umodes |= UMODE_DEAF; | |
116 | ||
117 | channel = make_channel(); | |
118 | ||
119 | add_user_to_channel(channel, local_chan_o, CHFL_CHANOP); | |
120 | add_user_to_channel(channel, local_chan_ov, CHFL_CHANOP | CHFL_VOICE); | |
121 | add_user_to_channel(channel, local_chan_v, CHFL_VOICE); | |
122 | add_user_to_channel(channel, local_chan_p, CHFL_PEON); | |
123 | add_user_to_channel(channel, local_chan_d, CHFL_CHANOP | CHFL_VOICE); | |
124 | ||
125 | add_user_to_channel(channel, remote_chan_o, CHFL_CHANOP); | |
126 | add_user_to_channel(channel, remote_chan_ov, CHFL_CHANOP | CHFL_VOICE); | |
127 | add_user_to_channel(channel, remote_chan_v, CHFL_VOICE); | |
128 | add_user_to_channel(channel, remote_chan_p, CHFL_PEON); | |
129 | add_user_to_channel(channel, remote_chan_d, CHFL_CHANOP | CHFL_VOICE); | |
130 | ||
131 | add_user_to_channel(channel, remote2_chan_p, CHFL_PEON); | |
132 | add_user_to_channel(channel, remote2_chan_d, CHFL_CHANOP | CHFL_VOICE); | |
133 | ||
134 | lchannel = allocate_channel("&test"); | |
135 | ||
136 | add_user_to_channel(lchannel, user, CHFL_PEON); | |
137 | add_user_to_channel(lchannel, remote, CHFL_PEON); | |
138 | add_user_to_channel(lchannel, remote2, CHFL_PEON); | |
139 | add_user_to_channel(lchannel, remote3, CHFL_PEON); | |
140 | } | |
141 | ||
142 | static void standard_ids(void) | |
143 | { | |
144 | strcpy(user->id, TEST_ID); | |
145 | strcpy(server->id, TEST_SERVER_ID); | |
146 | strcpy(remote->id, TEST_REMOTE_ID); | |
147 | strcpy(server2->id, TEST_SERVER2_ID); | |
148 | strcpy(remote2->id, TEST_REMOTE2_ID); | |
149 | strcpy(server3->id, TEST_SERVER3_ID); | |
150 | strcpy(remote3->id, TEST_REMOTE3_ID); | |
151 | ||
152 | strcpy(local_chan_o->id, TEST_ME_ID "90001"); | |
153 | strcpy(local_chan_ov->id, TEST_ME_ID "90002"); | |
154 | strcpy(local_chan_v->id, TEST_ME_ID "90003"); | |
155 | strcpy(local_chan_p->id, TEST_ME_ID "90004"); | |
156 | strcpy(local_chan_d->id, TEST_ME_ID "90005"); | |
157 | ||
158 | strcpy(remote_chan_o->id, TEST_SERVER_ID "90101"); | |
159 | strcpy(remote_chan_ov->id, TEST_SERVER_ID "90102"); | |
160 | strcpy(remote_chan_v->id, TEST_SERVER_ID "90103"); | |
161 | strcpy(remote_chan_p->id, TEST_SERVER_ID "90104"); | |
162 | strcpy(remote_chan_d->id, TEST_SERVER_ID "90105"); | |
163 | ||
164 | strcpy(remote2_chan_p->id, TEST_SERVER2_ID "90204"); | |
165 | strcpy(remote2_chan_d->id, TEST_SERVER2_ID "90205"); | |
166 | } | |
167 | ||
168 | static void standard_server_caps(unsigned int add, unsigned int remove) | |
169 | { | |
170 | server->localClient->caps |= add; | |
171 | server2->localClient->caps |= add; | |
172 | server3->localClient->caps |= add; | |
173 | ||
174 | server->localClient->caps &= ~remove; | |
175 | server2->localClient->caps &= ~remove; | |
176 | server3->localClient->caps &= ~remove; | |
177 | } | |
178 | ||
179 | static void standard_free(void) | |
180 | { | |
181 | remove_remote_person(remote2_chan_p); | |
182 | remove_remote_person(remote2_chan_d); | |
183 | ||
184 | remove_remote_person(remote_chan_o); | |
185 | remove_remote_person(remote_chan_ov); | |
186 | remove_remote_person(remote_chan_v); | |
187 | remove_remote_person(remote_chan_p); | |
188 | remove_remote_person(remote_chan_d); | |
189 | ||
190 | remove_local_person(local_chan_o); | |
191 | remove_local_person(local_chan_ov); | |
192 | remove_local_person(local_chan_v); | |
193 | remove_local_person(local_chan_p); | |
194 | remove_local_person(local_chan_d); | |
195 | remove_local_person(local_no_chan); | |
196 | ||
197 | remove_remote_person(remote3); | |
198 | remove_remote_server(server3); | |
199 | remove_remote_person(remote2); | |
200 | remove_remote_server(server2); | |
201 | remove_remote_person(remote); | |
202 | remove_remote_server(server); | |
203 | remove_local_person(user); | |
204 | } | |
205 | ||
206 | static void sendto_one1(void) | |
207 | { | |
208 | standard_init(); | |
209 | ||
210 | sendto_one(user, "Hello %s!", "World"); | |
211 | is_client_sendq("Hello World!" CRLF, user, MSG); | |
212 | ||
213 | sendto_one(server, "Hello %s!", "World"); | |
214 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
215 | ||
216 | sendto_one(remote, "Hello %s!", "World"); | |
217 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
218 | ||
219 | standard_free(); | |
220 | } | |
221 | ||
222 | static void sendto_one1__tags(void) | |
223 | { | |
224 | standard_init(); | |
225 | ||
226 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
227 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
228 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
229 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
230 | ||
231 | sendto_one(local_chan_o, "Hello %s!", "World"); | |
232 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_o, MSG); | |
233 | ||
234 | sendto_one(local_chan_ov, "Hello %s!", "World"); | |
235 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, MSG); | |
236 | ||
237 | sendto_one(local_chan_v, "Hello %s!", "World"); | |
238 | is_client_sendq("Hello World!" CRLF, local_chan_v, MSG); | |
239 | ||
240 | sendto_one(local_chan_p, "Hello %s!", "World"); | |
241 | is_client_sendq("Hello World!" CRLF, local_chan_p, MSG); | |
242 | ||
243 | standard_free(); | |
244 | } | |
245 | ||
246 | static void sendto_one_prefix1(void) | |
247 | { | |
248 | standard_init(); | |
249 | ||
250 | // Local | |
251 | sendto_one_prefix(user, &me, "TEST", ":Hello %s!", "World"); | |
252 | is_client_sendq(":" TEST_ME_NAME " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
253 | ||
254 | sendto_one_prefix(user, user, "TEST", ":Hello %s!", "World"); | |
255 | is_client_sendq(":" TEST_NICK " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
256 | ||
257 | sendto_one_prefix(user, remote, "TEST", ":Hello %s!", "World"); | |
258 | is_client_sendq(":" TEST_REMOTE_NICK " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
259 | ||
260 | sendto_one_prefix(user, server, "TEST", ":Hello %s!", "World"); | |
261 | is_client_sendq(":" TEST_SERVER_NAME " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
262 | ||
263 | // Remote (without ID) | |
264 | sendto_one_prefix(remote, &me, "TEST", ":Hello %s!", "World"); | |
265 | is_client_sendq(":" TEST_ME_NAME " TEST " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
266 | ||
267 | sendto_one_prefix(remote, user, "TEST", ":Hello %s!", "World"); | |
268 | is_client_sendq(":" TEST_NICK " TEST " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
269 | ||
270 | sendto_one_prefix(remote, remote, "TEST", ":Hello %s!", "World"); | |
271 | is_client_sendq(":" TEST_REMOTE_NICK " TEST " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
272 | ||
273 | sendto_one_prefix(remote, server, "TEST", ":Hello %s!", "World"); | |
274 | is_client_sendq(":" TEST_SERVER_NAME " TEST " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
275 | ||
276 | standard_ids(); | |
277 | ||
278 | // Remote (with ID) | |
279 | sendto_one_prefix(remote, &me, "TEST", ":Hello %s!", "World"); | |
280 | is_client_sendq(":" TEST_ME_ID " TEST " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
281 | ||
282 | sendto_one_prefix(remote, user, "TEST", ":Hello %s!", "World"); | |
283 | is_client_sendq(":" TEST_ID " TEST " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
284 | ||
285 | sendto_one_prefix(remote, remote, "TEST", ":Hello %s!", "World"); | |
286 | is_client_sendq(":" TEST_REMOTE_ID " TEST " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
287 | ||
288 | sendto_one_prefix(remote, server, "TEST", ":Hello %s!", "World"); | |
289 | is_client_sendq(":" TEST_SERVER_ID " TEST " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
290 | ||
291 | standard_free(); | |
292 | } | |
293 | ||
294 | static void sendto_one_prefix1__tags(void) | |
295 | { | |
296 | standard_init(); | |
297 | ||
298 | strcpy(user->user->suser, "test"); | |
299 | strcpy(remote->user->suser, "rtest"); | |
300 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
301 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
302 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
303 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
304 | ||
305 | sendto_one_prefix(user, &me, "TEST", ":Hello %s!", "World"); | |
306 | is_client_sendq(":" TEST_ME_NAME " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
307 | ||
308 | sendto_one_prefix(user, user, "TEST", ":Hello %s!", "World"); | |
309 | is_client_sendq(":" TEST_NICK " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
310 | ||
311 | sendto_one_prefix(user, remote, "TEST", ":Hello %s!", "World"); | |
312 | is_client_sendq(":" TEST_REMOTE_NICK " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
313 | ||
314 | sendto_one_prefix(user, server, "TEST", ":Hello %s!", "World"); | |
315 | is_client_sendq(":" TEST_SERVER_NAME " TEST " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
316 | ||
317 | ||
318 | sendto_one_prefix(local_chan_o, &me, "TEST", ":Hello %s!", "World"); | |
319 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " TEST LChanOp :Hello World!" CRLF, local_chan_o, MSG); | |
320 | ||
321 | sendto_one_prefix(local_chan_o, user, "TEST", ":Hello %s!", "World"); | |
322 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :" TEST_NICK " TEST LChanOp :Hello World!" CRLF, local_chan_o, MSG); | |
323 | ||
324 | sendto_one_prefix(local_chan_o, remote, "TEST", ":Hello %s!", "World"); | |
325 | is_client_sendq("@time=" ADVENTURE_TIME ";account=rtest :" TEST_REMOTE_NICK " TEST LChanOp :Hello World!" CRLF, local_chan_o, MSG); | |
326 | ||
327 | sendto_one_prefix(local_chan_o, server, "TEST", ":Hello %s!", "World"); | |
328 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " TEST LChanOp :Hello World!" CRLF, local_chan_o, MSG); | |
329 | ||
330 | ||
331 | sendto_one_prefix(local_chan_ov, &me, "TEST", ":Hello %s!", "World"); | |
332 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " TEST LChanOpVoice :Hello World!" CRLF, local_chan_ov, MSG); | |
333 | ||
334 | sendto_one_prefix(local_chan_ov, user, "TEST", ":Hello %s!", "World"); | |
335 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_NICK " TEST LChanOpVoice :Hello World!" CRLF, local_chan_ov, MSG); | |
336 | ||
337 | sendto_one_prefix(local_chan_ov, remote, "TEST", ":Hello %s!", "World"); | |
338 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_REMOTE_NICK " TEST LChanOpVoice :Hello World!" CRLF, local_chan_ov, MSG); | |
339 | ||
340 | sendto_one_prefix(local_chan_ov, server, "TEST", ":Hello %s!", "World"); | |
341 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " TEST LChanOpVoice :Hello World!" CRLF, local_chan_ov, MSG); | |
342 | ||
343 | ||
344 | sendto_one_prefix(local_chan_v, &me, "TEST", ":Hello %s!", "World"); | |
345 | is_client_sendq(":" TEST_ME_NAME " TEST LChanVoice :Hello World!" CRLF, local_chan_v, MSG); | |
346 | ||
347 | sendto_one_prefix(local_chan_v, user, "TEST", ":Hello %s!", "World"); | |
348 | is_client_sendq("@account=test :" TEST_NICK " TEST LChanVoice :Hello World!" CRLF, local_chan_v, MSG); | |
349 | ||
350 | sendto_one_prefix(local_chan_v, remote, "TEST", ":Hello %s!", "World"); | |
351 | is_client_sendq("@account=rtest :" TEST_REMOTE_NICK " TEST LChanVoice :Hello World!" CRLF, local_chan_v, MSG); | |
352 | ||
353 | sendto_one_prefix(local_chan_v, server, "TEST", ":Hello %s!", "World"); | |
354 | is_client_sendq(":" TEST_SERVER_NAME " TEST LChanVoice :Hello World!" CRLF, local_chan_v, MSG); | |
355 | ||
356 | ||
357 | sendto_one_prefix(local_chan_p, &me, "TEST", ":Hello %s!", "World"); | |
358 | is_client_sendq(":" TEST_ME_NAME " TEST LChanPeon :Hello World!" CRLF, local_chan_p, MSG); | |
359 | ||
360 | sendto_one_prefix(local_chan_p, user, "TEST", ":Hello %s!", "World"); | |
361 | is_client_sendq(":" TEST_NICK " TEST LChanPeon :Hello World!" CRLF, local_chan_p, MSG); | |
362 | ||
363 | sendto_one_prefix(local_chan_p, remote, "TEST", ":Hello %s!", "World"); | |
364 | is_client_sendq(":" TEST_REMOTE_NICK " TEST LChanPeon :Hello World!" CRLF, local_chan_p, MSG); | |
365 | ||
366 | sendto_one_prefix(local_chan_p, server, "TEST", ":Hello %s!", "World"); | |
367 | is_client_sendq(":" TEST_SERVER_NAME " TEST LChanPeon :Hello World!" CRLF, local_chan_p, MSG); | |
368 | ||
369 | standard_free(); | |
370 | } | |
371 | ||
372 | static void sendto_one_notice1(void) | |
373 | { | |
374 | standard_init(); | |
375 | ||
376 | // Local | |
377 | sendto_one_notice(user, ":Hello %s!", "World"); | |
378 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_NICK " :Hello World!" CRLF, user, MSG); | |
379 | ||
380 | // Remote (without ID) | |
381 | sendto_one_notice(remote, ":Hello %s!", "World"); | |
382 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
383 | ||
384 | standard_ids(); | |
385 | ||
386 | // Remote (with ID) | |
387 | sendto_one_notice(remote, ":Hello %s!", "World"); | |
388 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
389 | ||
390 | // Local (unregistered) | |
391 | user->name[0] = '\0'; | |
392 | sendto_one_notice(user, ":Hello %s!", "World"); | |
393 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :Hello World!" CRLF, user, MSG); | |
394 | ||
395 | standard_free(); | |
396 | } | |
397 | ||
398 | static void sendto_one_notice1__tags(void) | |
399 | { | |
400 | standard_init(); | |
401 | ||
402 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
403 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
404 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
405 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
406 | ||
407 | sendto_one_notice(local_chan_o, ":Hello %s!", "World"); | |
408 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE LChanOp :Hello World!" CRLF, local_chan_o, MSG); | |
409 | ||
410 | sendto_one_notice(local_chan_ov, ":Hello %s!", "World"); | |
411 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE LChanOpVoice :Hello World!" CRLF, local_chan_ov, MSG); | |
412 | ||
413 | sendto_one_notice(local_chan_v, ":Hello %s!", "World"); | |
414 | is_client_sendq(":" TEST_ME_NAME " NOTICE LChanVoice :Hello World!" CRLF, local_chan_v, MSG); | |
415 | ||
416 | // Unregistered | |
417 | local_chan_o->name[0] = '\0'; | |
418 | local_chan_ov->name[0] = '\0'; | |
419 | local_chan_v->name[0] = '\0'; | |
420 | ||
421 | sendto_one_notice(local_chan_o, ":Hello %s!", "World"); | |
422 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :Hello World!" CRLF, local_chan_o, MSG); | |
423 | ||
424 | sendto_one_notice(local_chan_ov, ":Hello %s!", "World"); | |
425 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :Hello World!" CRLF, local_chan_ov, MSG); | |
426 | ||
427 | sendto_one_notice(local_chan_v, ":Hello %s!", "World"); | |
428 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :Hello World!" CRLF, local_chan_v, MSG); | |
429 | ||
430 | standard_free(); | |
431 | } | |
432 | ||
433 | static void sendto_one_numeric1(void) | |
434 | { | |
435 | standard_init(); | |
436 | ||
437 | // Local | |
438 | sendto_one_numeric(user, 1, "Hello %s!", "World"); | |
439 | is_client_sendq(":" TEST_ME_NAME " 001 " TEST_NICK " Hello World!" CRLF, user, MSG); | |
440 | ||
441 | // Remote (without ID) | |
442 | sendto_one_numeric(server, 1, "Hello %s!", "World"); | |
443 | is_client_sendq(":" TEST_ME_NAME " 001 " TEST_SERVER_NAME " Hello World!" CRLF, server, MSG); | |
444 | ||
445 | sendto_one_numeric(remote, 1, "Hello %s!", "World"); | |
446 | is_client_sendq(":" TEST_ME_NAME " 001 " TEST_REMOTE_NICK " Hello World!" CRLF, server, MSG); | |
447 | ||
448 | standard_ids(); | |
449 | ||
450 | // Remote (with ID) | |
451 | sendto_one_numeric(server, 1, "Hello %s!", "World"); | |
452 | is_client_sendq(":" TEST_ME_ID " 001 " TEST_SERVER_ID " Hello World!" CRLF, server, MSG); | |
453 | ||
454 | sendto_one_numeric(remote, 1, "Hello %s!", "World"); | |
455 | is_client_sendq(":" TEST_ME_ID " 001 " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
456 | ||
457 | // Local (unregistered) | |
458 | user->name[0] = '\0'; | |
459 | sendto_one_numeric(user, 1, "Hello %s!", "World"); | |
460 | is_client_sendq(":" TEST_ME_NAME " 001 * Hello World!" CRLF, user, MSG); | |
461 | ||
462 | standard_free(); | |
463 | } | |
464 | ||
465 | static void sendto_one_numeric1__tags(void) | |
466 | { | |
467 | standard_init(); | |
468 | ||
469 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
470 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
471 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
472 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
473 | ||
474 | sendto_one_numeric(local_chan_o, 1, "Hello %s!", "World"); | |
475 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " 001 LChanOp Hello World!" CRLF, local_chan_o, MSG); | |
476 | ||
477 | sendto_one_numeric(local_chan_ov, 1, "Hello %s!", "World"); | |
478 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " 001 LChanOpVoice Hello World!" CRLF, local_chan_ov, MSG); | |
479 | ||
480 | sendto_one_numeric(local_chan_v, 1, "Hello %s!", "World"); | |
481 | is_client_sendq(":" TEST_ME_NAME " 001 LChanVoice Hello World!" CRLF, local_chan_v, MSG); | |
482 | ||
483 | // Unregistered | |
484 | local_chan_o->name[0] = '\0'; | |
485 | local_chan_ov->name[0] = '\0'; | |
486 | local_chan_v->name[0] = '\0'; | |
487 | ||
488 | sendto_one_numeric(local_chan_o, 1, "Hello %s!", "World"); | |
489 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " 001 * Hello World!" CRLF, local_chan_o, MSG); | |
490 | ||
491 | sendto_one_numeric(local_chan_ov, 1, "Hello %s!", "World"); | |
492 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " 001 * Hello World!" CRLF, local_chan_ov, MSG); | |
493 | ||
494 | sendto_one_numeric(local_chan_v, 1, "Hello %s!", "World"); | |
495 | is_client_sendq(":" TEST_ME_NAME " 001 * Hello World!" CRLF, local_chan_v, MSG); | |
496 | ||
497 | standard_free(); | |
498 | } | |
499 | ||
500 | static void sendto_server1(void) | |
501 | { | |
502 | standard_init(); | |
503 | ||
504 | // TODO test capabilities | |
505 | ||
506 | // Local | |
507 | sendto_server(NULL, channel, 0, 0, "Hello %s!", "World"); | |
508 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
509 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
510 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
511 | ||
512 | sendto_server(NULL, lchannel, 0, 0, "Hello %s!", "World"); | |
513 | is_client_sendq_empty(server, MSG); | |
514 | is_client_sendq_empty(server2, MSG); | |
515 | is_client_sendq_empty(server3, MSG); | |
516 | ||
517 | sendto_server(NULL, NULL, 0, 0, "Hello %s!", "World"); | |
518 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
519 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
520 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
521 | ||
522 | sendto_server(user, channel, 0, 0, "Hello %s!", "World"); | |
523 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
524 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
525 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
526 | ||
527 | sendto_server(user, lchannel, 0, 0, "Hello %s!", "World"); | |
528 | is_client_sendq_empty(server, MSG); | |
529 | is_client_sendq_empty(server2, MSG); | |
530 | is_client_sendq_empty(server3, MSG); | |
531 | ||
532 | sendto_server(user, NULL, 0, 0, "Hello %s!", "World"); | |
533 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
534 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
535 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
536 | ||
537 | // Remote | |
538 | sendto_server(remote, channel, 0, 0, "Hello %s!", "World"); | |
539 | is_client_sendq_empty(server, MSG); | |
540 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
541 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
542 | ||
543 | sendto_server(remote, lchannel, 0, 0, "Hello %s!", "World"); | |
544 | is_client_sendq_empty(server, MSG); | |
545 | is_client_sendq_empty(server2, MSG); | |
546 | is_client_sendq_empty(server3, MSG); | |
547 | ||
548 | sendto_server(remote, NULL, 0, 0, "Hello %s!", "World"); | |
549 | is_client_sendq_empty(server, MSG); | |
550 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
551 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
552 | ||
553 | sendto_server(remote2, channel, 0, 0, "Hello %s!", "World"); | |
554 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
555 | is_client_sendq_empty(server2, MSG); | |
556 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
557 | ||
558 | sendto_server(remote2, lchannel, 0, 0, "Hello %s!", "World"); | |
559 | is_client_sendq_empty(server, MSG); | |
560 | is_client_sendq_empty(server2, MSG); | |
561 | is_client_sendq_empty(server3, MSG); | |
562 | ||
563 | sendto_server(remote2, NULL, 0, 0, "Hello %s!", "World"); | |
564 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
565 | is_client_sendq_empty(server2, MSG); | |
566 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
567 | ||
568 | sendto_server(remote3, channel, 0, 0, "Hello %s!", "World"); | |
569 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
570 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
571 | is_client_sendq_empty(server3, MSG); | |
572 | ||
573 | sendto_server(remote3, lchannel, 0, 0, "Hello %s!", "World"); | |
574 | is_client_sendq_empty(server, MSG); | |
575 | is_client_sendq_empty(server2, MSG); | |
576 | is_client_sendq_empty(server3, MSG); | |
577 | ||
578 | sendto_server(remote3, NULL, 0, 0, "Hello %s!", "World"); | |
579 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
580 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
581 | is_client_sendq_empty(server3, MSG); | |
582 | ||
583 | standard_free(); | |
584 | } | |
585 | ||
586 | static void sendto_server1__tags(void) | |
587 | { | |
588 | standard_init(); | |
589 | ||
590 | // TODO test capabilities | |
591 | ||
592 | strcpy(user->user->suser, "test"); | |
593 | strcpy(remote->user->suser, "rtest"); | |
594 | strcpy(remote2->user->suser, "r2test"); | |
595 | strcpy(remote3->user->suser, "r3test"); | |
596 | ||
597 | // Local | |
598 | sendto_server(NULL, channel, 0, 0, "Hello %s!", "World"); | |
599 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
600 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
601 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
602 | ||
603 | sendto_server(NULL, lchannel, 0, 0, "Hello %s!", "World"); | |
604 | is_client_sendq_empty(server, MSG); | |
605 | is_client_sendq_empty(server2, MSG); | |
606 | is_client_sendq_empty(server3, MSG); | |
607 | ||
608 | sendto_server(NULL, NULL, 0, 0, "Hello %s!", "World"); | |
609 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
610 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
611 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
612 | ||
613 | sendto_server(user, channel, 0, 0, "Hello %s!", "World"); | |
614 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
615 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
616 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
617 | ||
618 | sendto_server(user, lchannel, 0, 0, "Hello %s!", "World"); | |
619 | is_client_sendq_empty(server, MSG); | |
620 | is_client_sendq_empty(server2, MSG); | |
621 | is_client_sendq_empty(server3, MSG); | |
622 | ||
623 | sendto_server(user, NULL, 0, 0, "Hello %s!", "World"); | |
624 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
625 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
626 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
627 | ||
628 | // Remote | |
629 | sendto_server(remote, channel, 0, 0, "Hello %s!", "World"); | |
630 | is_client_sendq_empty(server, MSG); | |
631 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
632 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
633 | ||
634 | sendto_server(remote, lchannel, 0, 0, "Hello %s!", "World"); | |
635 | is_client_sendq_empty(server, MSG); | |
636 | is_client_sendq_empty(server2, MSG); | |
637 | is_client_sendq_empty(server3, MSG); | |
638 | ||
639 | sendto_server(remote, NULL, 0, 0, "Hello %s!", "World"); | |
640 | is_client_sendq_empty(server, MSG); | |
641 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
642 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
643 | ||
644 | sendto_server(remote2, channel, 0, 0, "Hello %s!", "World"); | |
645 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
646 | is_client_sendq_empty(server2, MSG); | |
647 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
648 | ||
649 | sendto_server(remote2, lchannel, 0, 0, "Hello %s!", "World"); | |
650 | is_client_sendq_empty(server, MSG); | |
651 | is_client_sendq_empty(server2, MSG); | |
652 | is_client_sendq_empty(server3, MSG); | |
653 | ||
654 | sendto_server(remote2, NULL, 0, 0, "Hello %s!", "World"); | |
655 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
656 | is_client_sendq_empty(server2, MSG); | |
657 | is_client_sendq("Hello World!" CRLF, server3, MSG); | |
658 | ||
659 | sendto_server(remote3, channel, 0, 0, "Hello %s!", "World"); | |
660 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
661 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
662 | is_client_sendq_empty(server3, MSG); | |
663 | ||
664 | sendto_server(remote3, lchannel, 0, 0, "Hello %s!", "World"); | |
665 | is_client_sendq_empty(server, MSG); | |
666 | is_client_sendq_empty(server2, MSG); | |
667 | is_client_sendq_empty(server3, MSG); | |
668 | ||
669 | sendto_server(remote3, NULL, 0, 0, "Hello %s!", "World"); | |
670 | is_client_sendq("Hello World!" CRLF, server, MSG); | |
671 | is_client_sendq("Hello World!" CRLF, server2, MSG); | |
672 | is_client_sendq_empty(server3, MSG); | |
673 | ||
674 | standard_free(); | |
675 | } | |
676 | ||
677 | static void sendto_channel_flags__local__all_members(void) | |
678 | { | |
679 | standard_init(); | |
680 | ||
681 | sendto_channel_flags(local_chan_p, ALL_MEMBERS, local_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
682 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
683 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
684 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
685 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
686 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
687 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
688 | is_client_sendq(":LChanPeon TEST #placeholder :Hello World!" CRLF, server, MSG); | |
689 | is_client_sendq(":LChanPeon TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
690 | ||
691 | standard_ids(); | |
692 | ||
693 | sendto_channel_flags(local_chan_p, ALL_MEMBERS, local_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
694 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
695 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
696 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
697 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
698 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
699 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
700 | is_client_sendq(":" TEST_ME_ID "90004 TEST #placeholder :Hello World!" CRLF, server, MSG); | |
701 | is_client_sendq(":" TEST_ME_ID "90004 TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
702 | ||
703 | standard_free(); | |
704 | } | |
705 | ||
706 | static void sendto_channel_flags__remote__all_members(void) | |
707 | { | |
708 | standard_init(); | |
709 | ||
710 | sendto_channel_flags(server, ALL_MEMBERS, remote_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
711 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
712 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
713 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
714 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
715 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
716 | is_client_sendq_empty(server, "Message source; " MSG); | |
717 | is_client_sendq(":RChanPeon TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
718 | ||
719 | standard_ids(); | |
720 | ||
721 | sendto_channel_flags(server, ALL_MEMBERS, remote_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
722 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
723 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
724 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
725 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
726 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
727 | is_client_sendq_empty(server, "Message source; " MSG); | |
728 | is_client_sendq(":" TEST_SERVER_ID "90104 TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
729 | ||
730 | standard_free(); | |
731 | } | |
732 | ||
733 | static void sendto_channel_flags__local__all_members__tags(void) | |
734 | { | |
735 | standard_init(); | |
736 | ||
737 | strcpy(local_chan_p->user->suser, "test"); | |
738 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
739 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
740 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
741 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
742 | ||
743 | sendto_channel_flags(local_chan_p, ALL_MEMBERS, local_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
744 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
745 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
746 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
747 | is_client_sendq("@account=test :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
748 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
749 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
750 | is_client_sendq(":LChanPeon TEST #placeholder :Hello World!" CRLF, server, MSG); | |
751 | is_client_sendq(":LChanPeon TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
752 | ||
753 | standard_ids(); | |
754 | ||
755 | sendto_channel_flags(local_chan_p, ALL_MEMBERS, local_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
756 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
757 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
758 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
759 | is_client_sendq("@account=test :LChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
760 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
761 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
762 | is_client_sendq(":" TEST_ME_ID "90004 TEST #placeholder :Hello World!" CRLF, server, MSG); | |
763 | is_client_sendq(":" TEST_ME_ID "90004 TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
764 | ||
765 | standard_free(); | |
766 | } | |
767 | ||
768 | static void sendto_channel_flags__remote__all_members__tags(void) | |
769 | { | |
770 | standard_init(); | |
771 | ||
772 | strcpy(remote_chan_p->user->suser, "test"); | |
773 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
774 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
775 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
776 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
777 | ||
778 | sendto_channel_flags(server, ALL_MEMBERS, remote_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
779 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
780 | is_client_sendq("@time=" ADVENTURE_TIME " :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
781 | is_client_sendq("@account=test :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
782 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
783 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
784 | is_client_sendq_empty(server, "Message source; " MSG); | |
785 | is_client_sendq(":RChanPeon TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
786 | ||
787 | standard_ids(); | |
788 | ||
789 | sendto_channel_flags(server, ALL_MEMBERS, remote_chan_p, channel, "TEST #placeholder :Hello %s!", "World"); | |
790 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
791 | is_client_sendq("@time=" ADVENTURE_TIME " :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
792 | is_client_sendq("@account=test :RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
793 | is_client_sendq(":RChanPeon" TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
794 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
795 | is_client_sendq_empty(server, "Message source; " MSG); | |
796 | is_client_sendq(":" TEST_SERVER_ID "90104 TEST #placeholder :Hello World!" CRLF, server2, MSG); | |
797 | ||
798 | standard_free(); | |
799 | } | |
800 | ||
801 | static void sendto_channel_flags__local__voice(void) | |
802 | { | |
803 | standard_init(); | |
804 | ||
805 | // Without CAP_CHW | |
806 | standard_server_caps(0, CAP_CHW); | |
807 | ||
808 | sendto_channel_flags(user, CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
809 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
810 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
811 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
812 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
813 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
814 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
815 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
816 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
817 | ||
818 | // With CAP_CHW | |
819 | standard_server_caps(CAP_CHW, 0); | |
820 | ||
821 | sendto_channel_flags(user, CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
822 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
823 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
824 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
825 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
826 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
827 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
828 | is_client_sendq(":" TEST_NICK " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
829 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
830 | ||
831 | standard_ids(); | |
832 | ||
833 | // Without CAP_CHW | |
834 | standard_server_caps(0, CAP_CHW); | |
835 | ||
836 | sendto_channel_flags(user, CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
837 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
838 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
839 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
840 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
841 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
842 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
843 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
844 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
845 | ||
846 | // With CAP_CHW | |
847 | standard_server_caps(CAP_CHW, 0); | |
848 | ||
849 | sendto_channel_flags(user, CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
850 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
851 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
852 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
853 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
854 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
855 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
856 | is_client_sendq(":" TEST_ID " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
857 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
858 | ||
859 | standard_free(); | |
860 | } | |
861 | ||
862 | static void sendto_channel_flags__remote__voice(void) | |
863 | { | |
864 | standard_init(); | |
865 | ||
866 | // Without CAP_CHW | |
867 | standard_server_caps(0, CAP_CHW); | |
868 | ||
869 | sendto_channel_flags(server3, CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
870 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
871 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
872 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
873 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
874 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
875 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
876 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
877 | ||
878 | // With CAP_CHW | |
879 | standard_server_caps(CAP_CHW, 0); | |
880 | ||
881 | sendto_channel_flags(server3, CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
882 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
883 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
884 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
885 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
886 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
887 | is_client_sendq(":" TEST_REMOTE3_NICK " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
888 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
889 | ||
890 | standard_ids(); | |
891 | ||
892 | // Without CAP_CHW | |
893 | standard_server_caps(0, CAP_CHW); | |
894 | ||
895 | sendto_channel_flags(server3, CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
896 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
897 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
898 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
899 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
900 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
901 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
902 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
903 | ||
904 | // With CAP_CHW | |
905 | standard_server_caps(CAP_CHW, 0); | |
906 | ||
907 | sendto_channel_flags(server3, CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
908 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
909 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
910 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
911 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
912 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
913 | is_client_sendq(":" TEST_REMOTE3_ID " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
914 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
915 | ||
916 | standard_free(); | |
917 | } | |
918 | ||
919 | static void sendto_channel_flags__local__chanop(void) | |
920 | { | |
921 | standard_init(); | |
922 | ||
923 | // Without CAP_CHW | |
924 | standard_server_caps(0, CAP_CHW); | |
925 | ||
926 | sendto_channel_flags(user, CHFL_CHANOP, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
927 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
928 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
929 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
930 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
931 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
932 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
933 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
934 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
935 | ||
936 | // With CAP_CHW | |
937 | standard_server_caps(CAP_CHW, 0); | |
938 | ||
939 | sendto_channel_flags(user, CHFL_CHANOP, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
940 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
941 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
942 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
943 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
944 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
945 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
946 | is_client_sendq(":" TEST_NICK " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
947 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
948 | ||
949 | standard_ids(); | |
950 | ||
951 | // Without CAP_CHW | |
952 | standard_server_caps(0, CAP_CHW); | |
953 | ||
954 | sendto_channel_flags(user, CHFL_CHANOP, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
955 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
956 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
957 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
958 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
959 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
960 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
961 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
962 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
963 | ||
964 | // With CAP_CHW | |
965 | standard_server_caps(CAP_CHW, 0); | |
966 | ||
967 | sendto_channel_flags(user, CHFL_CHANOP, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
968 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
969 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
970 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
971 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
972 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
973 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
974 | is_client_sendq(":" TEST_ID " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
975 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
976 | ||
977 | standard_free(); | |
978 | } | |
979 | ||
980 | static void sendto_channel_flags__remote__chanop(void) | |
981 | { | |
982 | standard_init(); | |
983 | ||
984 | // Without CAP_CHW | |
985 | standard_server_caps(0, CAP_CHW); | |
986 | ||
987 | sendto_channel_flags(server3, CHFL_CHANOP, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
988 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
989 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
990 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
991 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
992 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
993 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
994 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
995 | ||
996 | // With CAP_CHW | |
997 | standard_server_caps(CAP_CHW, 0); | |
998 | ||
999 | sendto_channel_flags(server3, CHFL_CHANOP, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1000 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1001 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1002 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1003 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1004 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1005 | is_client_sendq(":" TEST_REMOTE3_NICK " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
1006 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1007 | ||
1008 | standard_ids(); | |
1009 | ||
1010 | // Without CAP_CHW | |
1011 | standard_server_caps(0, CAP_CHW); | |
1012 | ||
1013 | sendto_channel_flags(server3, CHFL_CHANOP, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1014 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1015 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1016 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1017 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1018 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1019 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1020 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1021 | ||
1022 | // With CAP_CHW | |
1023 | standard_server_caps(CAP_CHW, 0); | |
1024 | ||
1025 | sendto_channel_flags(server3, CHFL_CHANOP, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1026 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1027 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1028 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1029 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1030 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1031 | is_client_sendq(":" TEST_REMOTE3_ID " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
1032 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1033 | ||
1034 | standard_free(); | |
1035 | } | |
1036 | ||
1037 | static void sendto_channel_flags__local__chanop_voice(void) | |
1038 | { | |
1039 | standard_init(); | |
1040 | ||
1041 | // Without CAP_CHW | |
1042 | standard_server_caps(0, CAP_CHW); | |
1043 | ||
1044 | sendto_channel_flags(user, CHFL_CHANOP | CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
1045 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1046 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1047 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1048 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1049 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1050 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1051 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1052 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1053 | ||
1054 | // With CAP_CHW | |
1055 | standard_server_caps(CAP_CHW, 0); | |
1056 | ||
1057 | sendto_channel_flags(user, CHFL_CHANOP | CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
1058 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1059 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1060 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1061 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1062 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1063 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1064 | is_client_sendq(":" TEST_NICK " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
1065 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1066 | ||
1067 | standard_ids(); | |
1068 | ||
1069 | // Without CAP_CHW | |
1070 | standard_server_caps(0, CAP_CHW); | |
1071 | ||
1072 | sendto_channel_flags(user, CHFL_CHANOP | CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
1073 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1074 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1075 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1076 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1077 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1078 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1079 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1080 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1081 | ||
1082 | // With CAP_CHW | |
1083 | standard_server_caps(CAP_CHW, 0); | |
1084 | ||
1085 | sendto_channel_flags(user, CHFL_CHANOP | CHFL_VOICE, user, channel, "TEST #placeholder :Hello %s!", "World"); | |
1086 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1087 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1088 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1089 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1090 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1091 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1092 | is_client_sendq(":" TEST_ID " TEST #placeholder :Hello World!" CRLF, server, MSG); | |
1093 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1094 | ||
1095 | standard_free(); | |
1096 | } | |
1097 | ||
1098 | static void sendto_channel_flags__remote__chanop_voice(void) | |
1099 | { | |
1100 | standard_init(); | |
1101 | ||
1102 | // Without CAP_CHW | |
1103 | standard_server_caps(0, CAP_CHW); | |
1104 | ||
1105 | sendto_channel_flags(server3, CHFL_CHANOP | CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1106 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1107 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1108 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1109 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1110 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1111 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1112 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1113 | ||
1114 | // With CAP_CHW | |
1115 | standard_server_caps(CAP_CHW, 0); | |
1116 | ||
1117 | sendto_channel_flags(server3, CHFL_CHANOP | CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1118 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1119 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1120 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1121 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1122 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1123 | is_client_sendq(":" TEST_REMOTE3_NICK " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
1124 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1125 | ||
1126 | standard_ids(); | |
1127 | ||
1128 | // Without CAP_CHW | |
1129 | standard_server_caps(0, CAP_CHW); | |
1130 | ||
1131 | sendto_channel_flags(server3, CHFL_CHANOP | CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1132 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1133 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1134 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1135 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1136 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1137 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1138 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1139 | ||
1140 | // With CAP_CHW | |
1141 | standard_server_caps(CAP_CHW, 0); | |
1142 | ||
1143 | sendto_channel_flags(server3, CHFL_CHANOP | CHFL_VOICE, remote3, channel, "TEST #placeholder :Hello %s!", "World"); | |
1144 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1145 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1146 | is_client_sendq(":" TEST_REMOTE3_NICK TEST_ID_SUFFIX " TEST #placeholder :Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1147 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1148 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1149 | is_client_sendq(":" TEST_REMOTE3_ID " TEST #placeholder :Hello World!" CRLF, server, "On channel; " MSG); | |
1150 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1151 | ||
1152 | standard_free(); | |
1153 | } | |
1154 | ||
1155 | static void sendto_channel_opmod__local(void) | |
1156 | { | |
1157 | standard_init(); | |
1158 | ||
1159 | // This function does not support TS5... | |
1160 | standard_ids(); | |
1161 | ||
1162 | // Without CAP_CHW | CAP_EOPMOD | |
1163 | standard_server_caps(0, CAP_CHW | CAP_EOPMOD); | |
1164 | ||
1165 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1166 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1167 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1168 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1169 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1170 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1171 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1172 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1173 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1174 | ||
1175 | // With CAP_CHW, without CAP_EOPMOD | |
1176 | standard_server_caps(CAP_CHW, CAP_EOPMOD); | |
1177 | ||
1178 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1179 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1180 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1181 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1182 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1183 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1184 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1185 | is_client_sendq(":" TEST_ME_ID " NOTICE @" TEST_CHANNEL " :<LChanPeon:#test> Hello World!" CRLF, server, MSG); | |
1186 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1187 | ||
1188 | // Moderated channel | |
1189 | channel->mode.mode |= MODE_MODERATED; | |
1190 | ||
1191 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1192 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1193 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1194 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1195 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1196 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1197 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1198 | is_client_sendq(":" TEST_ME_ID "90004 TEST " TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1199 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1200 | ||
1201 | // With CAP_CHW | CAP_EOPMOD | |
1202 | channel->mode.mode &= ~MODE_MODERATED; | |
1203 | standard_server_caps(CAP_CHW | CAP_EOPMOD, 0); | |
1204 | ||
1205 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1206 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1207 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1208 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1209 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1210 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1211 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1212 | is_client_sendq(":" TEST_ME_ID "90004 TEST =" TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1213 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1214 | } | |
1215 | ||
1216 | static void sendto_channel_opmod__local__tags(void) | |
1217 | { | |
1218 | standard_init(); | |
1219 | ||
1220 | strcpy(local_chan_p->user->suser, "test"); | |
1221 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
1222 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
1223 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
1224 | ||
1225 | // This function does not support TS5... | |
1226 | standard_ids(); | |
1227 | ||
1228 | // Without CAP_CHW | CAP_EOPMOD | |
1229 | standard_server_caps(0, CAP_CHW | CAP_EOPMOD); | |
1230 | ||
1231 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1232 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1233 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1234 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1235 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1236 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1237 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1238 | is_client_sendq_empty(server, "No users to receive message; " MSG); | |
1239 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1240 | ||
1241 | // With CAP_CHW, without CAP_EOPMOD | |
1242 | standard_server_caps(CAP_CHW, CAP_EOPMOD); | |
1243 | ||
1244 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1245 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1246 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1247 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1248 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1249 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1250 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1251 | is_client_sendq(":" TEST_ME_ID " NOTICE @" TEST_CHANNEL " :<LChanPeon:#test> Hello World!" CRLF, server, MSG); | |
1252 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1253 | ||
1254 | // Moderated channel | |
1255 | channel->mode.mode |= MODE_MODERATED; | |
1256 | ||
1257 | local_chan_o->localClient->caps &= ~CAP_ACCOUNT_TAG; | |
1258 | local_chan_o->localClient->caps &= ~CAP_SERVER_TIME; | |
1259 | local_chan_ov->localClient->caps |= CAP_ACCOUNT_TAG; | |
1260 | local_chan_ov->localClient->caps &= ~CAP_SERVER_TIME; | |
1261 | ||
1262 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1263 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1264 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1265 | is_client_sendq("@account=test :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1266 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1267 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1268 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1269 | is_client_sendq(":" TEST_ME_ID "90004 TEST " TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1270 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1271 | ||
1272 | // With CAP_CHW | CAP_EOPMOD | |
1273 | channel->mode.mode &= ~MODE_MODERATED; | |
1274 | standard_server_caps(CAP_CHW | CAP_EOPMOD, 0); | |
1275 | ||
1276 | sendto_channel_opmod(local_chan_p, local_chan_p, channel, "TEST", "Hello World!"); | |
1277 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1278 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1279 | is_client_sendq("@account=test :LChanPeon" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1280 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1281 | is_client_sendq_empty(local_chan_p, "Message source; " MSG); | |
1282 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1283 | is_client_sendq(":" TEST_ME_ID "90004 TEST =" TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1284 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1285 | } | |
1286 | ||
1287 | static void sendto_channel_opmod__remote(void) | |
1288 | { | |
1289 | standard_init(); | |
1290 | ||
1291 | // This function does not support TS5... | |
1292 | standard_ids(); | |
1293 | ||
1294 | // Without CAP_CHW | CAP_EOPMOD | |
1295 | standard_server_caps(0, CAP_CHW | CAP_EOPMOD); | |
1296 | ||
1297 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1298 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1299 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1300 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1301 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1302 | is_client_sendq_empty(server, "Message source; " MSG); | |
1303 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1304 | ||
1305 | // With CAP_CHW, without CAP_EOPMOD | |
1306 | standard_server_caps(CAP_CHW, CAP_EOPMOD); | |
1307 | ||
1308 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1309 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1310 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1311 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1312 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1313 | is_client_sendq(":" TEST_SERVER2_ID " NOTICE @" TEST_CHANNEL " :<R2ChanDeaf:#test> Hello World!" CRLF, server, MSG); | |
1314 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1315 | ||
1316 | // Moderated channel | |
1317 | channel->mode.mode |= MODE_MODERATED; | |
1318 | ||
1319 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1320 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1321 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1322 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1323 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1324 | is_client_sendq(":" TEST_SERVER2_ID "90205 TEST " TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1325 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1326 | ||
1327 | // With CAP_CHW | CAP_EOPMOD | |
1328 | channel->mode.mode &= ~MODE_MODERATED; | |
1329 | standard_server_caps(CAP_CHW | CAP_EOPMOD, 0); | |
1330 | ||
1331 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1332 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1333 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1334 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1335 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1336 | is_client_sendq(":" TEST_SERVER2_ID "90205 TEST =" TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1337 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1338 | ||
1339 | standard_free(); | |
1340 | } | |
1341 | ||
1342 | static void sendto_channel_opmod__remote__tags(void) | |
1343 | { | |
1344 | standard_init(); | |
1345 | ||
1346 | strcpy(remote2_chan_d->user->suser, "test"); | |
1347 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
1348 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
1349 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
1350 | ||
1351 | // This function does not support TS5... | |
1352 | standard_ids(); | |
1353 | ||
1354 | // Without CAP_CHW | CAP_EOPMOD | |
1355 | standard_server_caps(0, CAP_CHW | CAP_EOPMOD); | |
1356 | ||
1357 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1358 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1359 | is_client_sendq("@time=" ADVENTURE_TIME " :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1360 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1361 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1362 | is_client_sendq_empty(server, "Message source; " MSG); | |
1363 | is_client_sendq_empty(server2, "No users to receive message; " MSG); | |
1364 | ||
1365 | // With CAP_CHW, without CAP_EOPMOD | |
1366 | standard_server_caps(CAP_CHW, CAP_EOPMOD); | |
1367 | ||
1368 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1369 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1370 | is_client_sendq("@time=" ADVENTURE_TIME " :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1371 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1372 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1373 | is_client_sendq(":" TEST_SERVER2_ID " NOTICE @" TEST_CHANNEL " :<R2ChanDeaf:#test> Hello World!" CRLF, server, MSG); | |
1374 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1375 | ||
1376 | // Moderated channel | |
1377 | channel->mode.mode |= MODE_MODERATED; | |
1378 | ||
1379 | local_chan_o->localClient->caps &= ~CAP_ACCOUNT_TAG; | |
1380 | local_chan_o->localClient->caps &= ~CAP_SERVER_TIME; | |
1381 | local_chan_ov->localClient->caps |= CAP_ACCOUNT_TAG; | |
1382 | local_chan_ov->localClient->caps &= ~CAP_SERVER_TIME; | |
1383 | ||
1384 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1385 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1386 | is_client_sendq("@account=test :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1387 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1388 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1389 | is_client_sendq(":" TEST_SERVER2_ID "90205 TEST " TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1390 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1391 | ||
1392 | // With CAP_CHW | CAP_EOPMOD | |
1393 | channel->mode.mode &= ~MODE_MODERATED; | |
1394 | standard_server_caps(CAP_CHW | CAP_EOPMOD, 0); | |
1395 | ||
1396 | sendto_channel_opmod(server2, remote2_chan_d, channel, "TEST", "Hello World!"); | |
1397 | is_client_sendq(":R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1398 | is_client_sendq("@account=test :R2ChanDeaf" TEST_ID_SUFFIX " TEST " TEST_CHANNEL " :Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1399 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1400 | is_client_sendq_empty(local_chan_d, "Deaf; " MSG); | |
1401 | is_client_sendq(":" TEST_SERVER2_ID "90205 TEST =" TEST_CHANNEL " :Hello World!" CRLF, server, MSG); | |
1402 | is_client_sendq_empty(server2, "Message source; " MSG); | |
1403 | ||
1404 | standard_free(); | |
1405 | } | |
1406 | ||
1407 | static void sendto_channel_local1(void) | |
1408 | { | |
1409 | standard_init(); | |
1410 | ||
1411 | sendto_channel_local(user, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
1412 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1413 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1414 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1415 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1416 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1417 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1418 | is_client_sendq_empty(server, MSG); | |
1419 | is_client_sendq_empty(server2, MSG); | |
1420 | ||
1421 | sendto_channel_local(user, CHFL_VOICE, channel, "Hello %s!", "World"); | |
1422 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1423 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1424 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1425 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1426 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1427 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1428 | is_client_sendq_empty(server, MSG); | |
1429 | is_client_sendq_empty(server2, MSG); | |
1430 | ||
1431 | sendto_channel_local(user, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
1432 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1433 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1434 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1435 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1436 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1437 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1438 | is_client_sendq_empty(server, MSG); | |
1439 | is_client_sendq_empty(server2, MSG); | |
1440 | ||
1441 | sendto_channel_local(user, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
1442 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1443 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1444 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1445 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1446 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1447 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1448 | is_client_sendq_empty(server, MSG); | |
1449 | is_client_sendq_empty(server2, MSG); | |
1450 | ||
1451 | sendto_channel_local(user, ONLY_OPERS, channel, "Hello %s!", "World"); | |
1452 | is_client_sendq_empty(user, "Not an oper; " MSG); | |
1453 | is_client_sendq_empty(local_chan_o, "Not an oper; " MSG); | |
1454 | is_client_sendq_empty(local_chan_ov, "Not an oper; " MSG); | |
1455 | is_client_sendq_empty(local_chan_v, "Not an oper; " MSG); | |
1456 | is_client_sendq_empty(local_chan_p, "Not an oper; " MSG); | |
1457 | is_client_sendq_empty(local_chan_d, "Not an oper; " MSG); | |
1458 | is_client_sendq_empty(server, MSG); | |
1459 | is_client_sendq_empty(server2, MSG); | |
1460 | ||
1461 | struct Client *oper1 = make_local_person_nick("oper1"); | |
1462 | struct Client *oper2 = make_local_person_nick("oper2"); | |
1463 | ||
1464 | make_local_person_oper(oper1); | |
1465 | make_local_person_oper(oper2); | |
1466 | ||
1467 | oper2->umodes |= UMODE_ADMIN; | |
1468 | ||
1469 | add_user_to_channel(lchannel, oper1, CHFL_PEON); | |
1470 | add_user_to_channel(lchannel, oper2, CHFL_PEON); | |
1471 | ||
1472 | sendto_channel_local(user, ALL_MEMBERS, lchannel, "Hello %s!", "World"); | |
1473 | is_client_sendq("Hello World!" CRLF, user, "On channel; " MSG); | |
1474 | is_client_sendq("Hello World!" CRLF, oper1, "On channel; " MSG); | |
1475 | is_client_sendq("Hello World!" CRLF, oper2, "On channel; " MSG); | |
1476 | is_client_sendq_empty(server, MSG); | |
1477 | is_client_sendq_empty(server2, MSG); | |
1478 | is_client_sendq_empty(server3, MSG); | |
1479 | ||
1480 | sendto_channel_local(user, ONLY_OPERS, lchannel, "Hello %s!", "World"); | |
1481 | is_client_sendq_empty(user, "Not an oper; " MSG); | |
1482 | is_client_sendq("Hello World!" CRLF, oper1, "Is an oper; " MSG); | |
1483 | is_client_sendq("Hello World!" CRLF, oper2, "Is an oper; " MSG); | |
1484 | is_client_sendq_empty(server, MSG); | |
1485 | is_client_sendq_empty(server2, MSG); | |
1486 | is_client_sendq_empty(server3, MSG); | |
1487 | ||
1488 | standard_free(); | |
1489 | } | |
1490 | ||
1491 | static void sendto_channel_local1__tags(void) | |
1492 | { | |
1493 | standard_init(); | |
1494 | ||
1495 | strcpy(user->user->suser, "test"); | |
1496 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
1497 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
1498 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
1499 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
1500 | ||
1501 | sendto_channel_local(user, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
1502 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1503 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1504 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1505 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1506 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1507 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1508 | is_client_sendq_empty(server, MSG); | |
1509 | is_client_sendq_empty(server2, MSG); | |
1510 | ||
1511 | sendto_channel_local(user, CHFL_VOICE, channel, "Hello %s!", "World"); | |
1512 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1513 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1514 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1515 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1516 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1517 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1518 | is_client_sendq_empty(server, MSG); | |
1519 | is_client_sendq_empty(server2, MSG); | |
1520 | ||
1521 | sendto_channel_local(user, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
1522 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1523 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1524 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1525 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1526 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1527 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1528 | is_client_sendq_empty(server, MSG); | |
1529 | is_client_sendq_empty(server2, MSG); | |
1530 | ||
1531 | sendto_channel_local(user, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
1532 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1533 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1534 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1535 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1536 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1537 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1538 | is_client_sendq_empty(server, MSG); | |
1539 | is_client_sendq_empty(server2, MSG); | |
1540 | ||
1541 | sendto_channel_local(user, ONLY_OPERS, channel, "Hello %s!", "World"); | |
1542 | is_client_sendq_empty(user, "Not an oper; " MSG); | |
1543 | is_client_sendq_empty(local_chan_o, "Not an oper; " MSG); | |
1544 | is_client_sendq_empty(local_chan_ov, "Not an oper; " MSG); | |
1545 | is_client_sendq_empty(local_chan_v, "Not an oper; " MSG); | |
1546 | is_client_sendq_empty(local_chan_p, "Not an oper; " MSG); | |
1547 | is_client_sendq_empty(local_chan_d, "Not an oper; " MSG); | |
1548 | is_client_sendq_empty(server, MSG); | |
1549 | is_client_sendq_empty(server2, MSG); | |
1550 | ||
1551 | struct Client *oper1 = make_local_person_nick("oper1"); | |
1552 | struct Client *oper2 = make_local_person_nick("oper2"); | |
1553 | ||
1554 | make_local_person_oper(oper1); | |
1555 | make_local_person_oper(oper2); | |
1556 | ||
1557 | oper2->umodes |= UMODE_ADMIN; | |
1558 | ||
1559 | add_user_to_channel(lchannel, oper1, CHFL_PEON); | |
1560 | add_user_to_channel(lchannel, oper2, CHFL_PEON); | |
1561 | ||
1562 | oper1->localClient->caps |= CAP_ACCOUNT_TAG; | |
1563 | oper2->localClient->caps |= CAP_SERVER_TIME; | |
1564 | ||
1565 | sendto_channel_local(user, ALL_MEMBERS, lchannel, "Hello %s!", "World"); | |
1566 | is_client_sendq("Hello World!" CRLF, user, "On channel; " MSG); | |
1567 | is_client_sendq("@account=test Hello World!" CRLF, oper1, "On channel; " MSG); | |
1568 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, oper2, "On channel; " MSG); | |
1569 | is_client_sendq_empty(server, MSG); | |
1570 | is_client_sendq_empty(server2, MSG); | |
1571 | is_client_sendq_empty(server3, MSG); | |
1572 | ||
1573 | sendto_channel_local(user, ONLY_OPERS, lchannel, "Hello %s!", "World"); | |
1574 | is_client_sendq_empty(user, "Not an oper; " MSG); | |
1575 | is_client_sendq("@account=test Hello World!" CRLF, oper1, "Is an oper; " MSG); | |
1576 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, oper2, "Is an oper; " MSG); | |
1577 | is_client_sendq_empty(server, MSG); | |
1578 | is_client_sendq_empty(server2, MSG); | |
1579 | is_client_sendq_empty(server3, MSG); | |
1580 | ||
1581 | oper1->localClient->caps &= ~CAP_ACCOUNT_TAG; | |
1582 | oper2->localClient->caps |= CAP_ACCOUNT_TAG; | |
1583 | ||
1584 | sendto_channel_local(user, ALL_MEMBERS, lchannel, "Hello %s!", "World"); | |
1585 | is_client_sendq("Hello World!" CRLF, user, "On channel; " MSG); | |
1586 | is_client_sendq("Hello World!" CRLF, oper1, "On channel; " MSG); | |
1587 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, oper2, "On channel; " MSG); | |
1588 | is_client_sendq_empty(server, MSG); | |
1589 | is_client_sendq_empty(server2, MSG); | |
1590 | is_client_sendq_empty(server3, MSG); | |
1591 | ||
1592 | sendto_channel_local(user, ONLY_OPERS, lchannel, "Hello %s!", "World"); | |
1593 | is_client_sendq_empty(user, "Not an oper; " MSG); | |
1594 | is_client_sendq("Hello World!" CRLF, oper1, "Is an oper; " MSG); | |
1595 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, oper2, "Is an oper; " MSG); | |
1596 | is_client_sendq_empty(server, MSG); | |
1597 | is_client_sendq_empty(server2, MSG); | |
1598 | is_client_sendq_empty(server3, MSG); | |
1599 | ||
1600 | standard_free(); | |
1601 | } | |
1602 | ||
1603 | static void sendto_channel_local_with_capability1(void) | |
1604 | { | |
1605 | standard_init(); | |
1606 | ||
1607 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
1608 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
1609 | ||
1610 | sendto_channel_local_with_capability(user, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1611 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1612 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1613 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1614 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1615 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1616 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1617 | is_client_sendq_empty(server, MSG); | |
1618 | is_client_sendq_empty(server2, MSG); | |
1619 | ||
1620 | sendto_channel_local_with_capability(user, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1621 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1622 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1623 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1624 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1625 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1626 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1627 | is_client_sendq_empty(server, MSG); | |
1628 | is_client_sendq_empty(server2, MSG); | |
1629 | ||
1630 | sendto_channel_local_with_capability(user, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
1631 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1632 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1633 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1634 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1635 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1636 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1637 | is_client_sendq_empty(server, MSG); | |
1638 | is_client_sendq_empty(server2, MSG); | |
1639 | ||
1640 | sendto_channel_local_with_capability(user, CHFL_VOICE, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1641 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1642 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1643 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1644 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1645 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1646 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1647 | is_client_sendq_empty(server, MSG); | |
1648 | is_client_sendq_empty(server2, MSG); | |
1649 | ||
1650 | sendto_channel_local_with_capability(user, CHFL_VOICE, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1651 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1652 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1653 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1654 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1655 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1656 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1657 | is_client_sendq_empty(server, MSG); | |
1658 | is_client_sendq_empty(server2, MSG); | |
1659 | ||
1660 | sendto_channel_local_with_capability(user, CHFL_VOICE, 0, 0, channel, "Hello %s!", "World"); | |
1661 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1662 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1663 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1664 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1665 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1666 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1667 | is_client_sendq_empty(server, MSG); | |
1668 | is_client_sendq_empty(server2, MSG); | |
1669 | ||
1670 | sendto_channel_local_with_capability(user, CHFL_CHANOP, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1671 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1672 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1673 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1674 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1675 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1676 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1677 | is_client_sendq_empty(server, MSG); | |
1678 | is_client_sendq_empty(server2, MSG); | |
1679 | ||
1680 | sendto_channel_local_with_capability(user, CHFL_CHANOP, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1681 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1682 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1683 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1684 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1685 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1686 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1687 | is_client_sendq_empty(server, MSG); | |
1688 | is_client_sendq_empty(server2, MSG); | |
1689 | ||
1690 | sendto_channel_local_with_capability(user, CHFL_CHANOP, 0, 0, channel, "Hello %s!", "World"); | |
1691 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1692 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1693 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1694 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1695 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1696 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1697 | is_client_sendq_empty(server, MSG); | |
1698 | is_client_sendq_empty(server2, MSG); | |
1699 | ||
1700 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1701 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1702 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1703 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1704 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1705 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1706 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1707 | is_client_sendq_empty(server, MSG); | |
1708 | is_client_sendq_empty(server2, MSG); | |
1709 | ||
1710 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1711 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1712 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1713 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1714 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1715 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1716 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1717 | is_client_sendq_empty(server, MSG); | |
1718 | is_client_sendq_empty(server2, MSG); | |
1719 | ||
1720 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, 0, 0, channel, "Hello %s!", "World"); | |
1721 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1722 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1723 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1724 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1725 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1726 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1727 | is_client_sendq_empty(server, MSG); | |
1728 | is_client_sendq_empty(server2, MSG); | |
1729 | ||
1730 | standard_free(); | |
1731 | } | |
1732 | ||
1733 | static void sendto_channel_local_with_capability1__tags(void) | |
1734 | { | |
1735 | standard_init(); | |
1736 | ||
1737 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
1738 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
1739 | ||
1740 | strcpy(user->user->suser, "test"); | |
1741 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
1742 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
1743 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
1744 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
1745 | ||
1746 | sendto_channel_local_with_capability(user, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1747 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1748 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1749 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1750 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1751 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1752 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1753 | is_client_sendq_empty(server, MSG); | |
1754 | is_client_sendq_empty(server2, MSG); | |
1755 | ||
1756 | sendto_channel_local_with_capability(user, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1757 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1758 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1759 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1760 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1761 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1762 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1763 | is_client_sendq_empty(server, MSG); | |
1764 | is_client_sendq_empty(server2, MSG); | |
1765 | ||
1766 | sendto_channel_local_with_capability(user, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
1767 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1768 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1769 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1770 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1771 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1772 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1773 | is_client_sendq_empty(server, MSG); | |
1774 | is_client_sendq_empty(server2, MSG); | |
1775 | ||
1776 | sendto_channel_local_with_capability(user, CHFL_VOICE, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1777 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1778 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1779 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1780 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1781 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1782 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1783 | is_client_sendq_empty(server, MSG); | |
1784 | is_client_sendq_empty(server2, MSG); | |
1785 | ||
1786 | sendto_channel_local_with_capability(user, CHFL_VOICE, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1787 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1788 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1789 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1790 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1791 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1792 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1793 | is_client_sendq_empty(server, MSG); | |
1794 | is_client_sendq_empty(server2, MSG); | |
1795 | ||
1796 | sendto_channel_local_with_capability(user, CHFL_VOICE, 0, 0, channel, "Hello %s!", "World"); | |
1797 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1798 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
1799 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
1800 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
1801 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
1802 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
1803 | is_client_sendq_empty(server, MSG); | |
1804 | is_client_sendq_empty(server2, MSG); | |
1805 | ||
1806 | sendto_channel_local_with_capability(user, CHFL_CHANOP, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1807 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1808 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1809 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1810 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1811 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1812 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1813 | is_client_sendq_empty(server, MSG); | |
1814 | is_client_sendq_empty(server2, MSG); | |
1815 | ||
1816 | sendto_channel_local_with_capability(user, CHFL_CHANOP, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1817 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1818 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1819 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1820 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1821 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1822 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1823 | is_client_sendq_empty(server, MSG); | |
1824 | is_client_sendq_empty(server2, MSG); | |
1825 | ||
1826 | sendto_channel_local_with_capability(user, CHFL_CHANOP, 0, 0, channel, "Hello %s!", "World"); | |
1827 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1828 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
1829 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
1830 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
1831 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
1832 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
1833 | is_client_sendq_empty(server, MSG); | |
1834 | is_client_sendq_empty(server2, MSG); | |
1835 | ||
1836 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1837 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1838 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1839 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1840 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1841 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1842 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1843 | is_client_sendq_empty(server, MSG); | |
1844 | is_client_sendq_empty(server2, MSG); | |
1845 | ||
1846 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1847 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1848 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1849 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1850 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1851 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1852 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1853 | is_client_sendq_empty(server, MSG); | |
1854 | is_client_sendq_empty(server2, MSG); | |
1855 | ||
1856 | sendto_channel_local_with_capability(user, CHFL_CHANOP | CHFL_VOICE, 0, 0, channel, "Hello %s!", "World"); | |
1857 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1858 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
1859 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
1860 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
1861 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
1862 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
1863 | is_client_sendq_empty(server, MSG); | |
1864 | is_client_sendq_empty(server2, MSG); | |
1865 | ||
1866 | standard_free(); | |
1867 | } | |
1868 | ||
1869 | static void sendto_channel_local_with_capability_butone1(void) | |
1870 | { | |
1871 | standard_init(); | |
1872 | ||
1873 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
1874 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
1875 | ||
1876 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1877 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1878 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1879 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1880 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1881 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1882 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1883 | is_client_sendq_empty(server, MSG); | |
1884 | is_client_sendq_empty(server2, MSG); | |
1885 | ||
1886 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1887 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1888 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1889 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1890 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1891 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1892 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1893 | is_client_sendq_empty(server, MSG); | |
1894 | is_client_sendq_empty(server2, MSG); | |
1895 | ||
1896 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
1897 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1898 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1899 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1900 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1901 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1902 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1903 | is_client_sendq_empty(server, MSG); | |
1904 | is_client_sendq_empty(server2, MSG); | |
1905 | ||
1906 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1907 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1908 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
1909 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1910 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1911 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1912 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1913 | is_client_sendq_empty(server, MSG); | |
1914 | is_client_sendq_empty(server2, MSG); | |
1915 | ||
1916 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1917 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1918 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
1919 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1920 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1921 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1922 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1923 | is_client_sendq_empty(server, MSG); | |
1924 | is_client_sendq_empty(server2, MSG); | |
1925 | ||
1926 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
1927 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1928 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
1929 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1930 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1931 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1932 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1933 | is_client_sendq_empty(server, MSG); | |
1934 | is_client_sendq_empty(server2, MSG); | |
1935 | ||
1936 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1937 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1938 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1939 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1940 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1941 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
1942 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1943 | is_client_sendq_empty(server, MSG); | |
1944 | is_client_sendq_empty(server2, MSG); | |
1945 | ||
1946 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1947 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1948 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1949 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1950 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1951 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
1952 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1953 | is_client_sendq_empty(server, MSG); | |
1954 | is_client_sendq_empty(server2, MSG); | |
1955 | ||
1956 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
1957 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1958 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1959 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1960 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1961 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
1962 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
1963 | is_client_sendq_empty(server, MSG); | |
1964 | is_client_sendq_empty(server2, MSG); | |
1965 | ||
1966 | standard_free(); | |
1967 | } | |
1968 | ||
1969 | static void sendto_channel_local_with_capability_butone1__tags(void) | |
1970 | { | |
1971 | standard_init(); | |
1972 | ||
1973 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
1974 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
1975 | ||
1976 | strcpy(local_chan_o->user->suser, "test_o"); | |
1977 | strcpy(local_chan_p->user->suser, "test_p"); | |
1978 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
1979 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
1980 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
1981 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
1982 | ||
1983 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
1984 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1985 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
1986 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
1987 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
1988 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
1989 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
1990 | is_client_sendq_empty(server, MSG); | |
1991 | is_client_sendq_empty(server2, MSG); | |
1992 | ||
1993 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
1994 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
1995 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
1996 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
1997 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
1998 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
1999 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2000 | is_client_sendq_empty(server, MSG); | |
2001 | is_client_sendq_empty(server2, MSG); | |
2002 | ||
2003 | sendto_channel_local_with_capability_butone(NULL, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
2004 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2005 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2006 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2007 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2008 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2009 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2010 | is_client_sendq_empty(server, MSG); | |
2011 | is_client_sendq_empty(server2, MSG); | |
2012 | ||
2013 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
2014 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2015 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2016 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2017 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2018 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
2019 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2020 | is_client_sendq_empty(server, MSG); | |
2021 | is_client_sendq_empty(server2, MSG); | |
2022 | ||
2023 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
2024 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2025 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2026 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2027 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2028 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2029 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2030 | is_client_sendq_empty(server, MSG); | |
2031 | is_client_sendq_empty(server2, MSG); | |
2032 | ||
2033 | sendto_channel_local_with_capability_butone(local_chan_o, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
2034 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2035 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2036 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2037 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2038 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2039 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2040 | is_client_sendq_empty(server, MSG); | |
2041 | is_client_sendq_empty(server2, MSG); | |
2042 | ||
2043 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, CAP_INVITE_NOTIFY, 0, channel, "Hello %s!", "World"); | |
2044 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2045 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2046 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2047 | is_client_sendq("@account=test_p Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2048 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2049 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2050 | is_client_sendq_empty(server, MSG); | |
2051 | is_client_sendq_empty(server2, MSG); | |
2052 | ||
2053 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, 0, CAP_INVITE_NOTIFY, channel, "Hello %s!", "World"); | |
2054 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2055 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
2056 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2057 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2058 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2059 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2060 | is_client_sendq_empty(server, MSG); | |
2061 | is_client_sendq_empty(server2, MSG); | |
2062 | ||
2063 | sendto_channel_local_with_capability_butone(local_chan_p, ALL_MEMBERS, 0, 0, channel, "Hello %s!", "World"); | |
2064 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2065 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2066 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2067 | is_client_sendq("@account=test_p Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2068 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2069 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2070 | is_client_sendq_empty(server, MSG); | |
2071 | is_client_sendq_empty(server2, MSG); | |
2072 | ||
2073 | standard_free(); | |
2074 | } | |
2075 | ||
2076 | static void sendto_channel_local_butone1(void) | |
2077 | { | |
2078 | standard_init(); | |
2079 | ||
2080 | sendto_channel_local_butone(NULL, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2081 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2082 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2083 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2084 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2085 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2086 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2087 | is_client_sendq_empty(server, MSG); | |
2088 | is_client_sendq_empty(server2, MSG); | |
2089 | ||
2090 | sendto_channel_local_butone(local_chan_o, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2091 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2092 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2093 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2094 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2095 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2096 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2097 | is_client_sendq_empty(server, MSG); | |
2098 | is_client_sendq_empty(server2, MSG); | |
2099 | ||
2100 | sendto_channel_local_butone(local_chan_p, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2101 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2102 | is_client_sendq("Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2103 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2104 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2105 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2106 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2107 | is_client_sendq_empty(server, MSG); | |
2108 | is_client_sendq_empty(server2, MSG); | |
2109 | ||
2110 | sendto_channel_local_butone(local_chan_ov, CHFL_VOICE, channel, "Hello %s!", "World"); | |
2111 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2112 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
2113 | is_client_sendq_empty(local_chan_ov, "Is the one (neo); " MSG); | |
2114 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
2115 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
2116 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
2117 | is_client_sendq_empty(server, MSG); | |
2118 | is_client_sendq_empty(server2, MSG); | |
2119 | ||
2120 | sendto_channel_local_butone(local_chan_p, CHFL_VOICE, channel, "Hello %s!", "World"); | |
2121 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2122 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
2123 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
2124 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
2125 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2126 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
2127 | is_client_sendq_empty(server, MSG); | |
2128 | is_client_sendq_empty(server2, MSG); | |
2129 | ||
2130 | sendto_channel_local_butone(local_chan_o, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
2131 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2132 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2133 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
2134 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
2135 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
2136 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
2137 | is_client_sendq_empty(server, MSG); | |
2138 | is_client_sendq_empty(server2, MSG); | |
2139 | ||
2140 | sendto_channel_local_butone(local_chan_p, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
2141 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2142 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
2143 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
2144 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
2145 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2146 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
2147 | is_client_sendq_empty(server, MSG); | |
2148 | is_client_sendq_empty(server2, MSG); | |
2149 | ||
2150 | sendto_channel_local_butone(local_chan_v, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
2151 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2152 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
2153 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
2154 | is_client_sendq_empty(local_chan_v, "Is the one (neo); " MSG); | |
2155 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
2156 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
2157 | is_client_sendq_empty(server, MSG); | |
2158 | is_client_sendq_empty(server2, MSG); | |
2159 | ||
2160 | sendto_channel_local_butone(local_chan_p, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
2161 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2162 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
2163 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
2164 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
2165 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2166 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
2167 | is_client_sendq_empty(server, MSG); | |
2168 | is_client_sendq_empty(server2, MSG); | |
2169 | ||
2170 | standard_free(); | |
2171 | } | |
2172 | ||
2173 | static void sendto_channel_local_butone1__tags(void) | |
2174 | { | |
2175 | standard_init(); | |
2176 | ||
2177 | strcpy(local_chan_o->user->suser, "test_o"); | |
2178 | strcpy(local_chan_ov->user->suser, "test_ov"); | |
2179 | strcpy(local_chan_v->user->suser, "test_v"); | |
2180 | strcpy(local_chan_p->user->suser, "test_p"); | |
2181 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
2182 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
2183 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
2184 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
2185 | ||
2186 | sendto_channel_local_butone(NULL, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2187 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2188 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2189 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2190 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2191 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2192 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2193 | is_client_sendq_empty(server, MSG); | |
2194 | is_client_sendq_empty(server2, MSG); | |
2195 | ||
2196 | sendto_channel_local_butone(local_chan_o, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2197 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2198 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2199 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2200 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2201 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On channel; " MSG); | |
2202 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2203 | is_client_sendq_empty(server, MSG); | |
2204 | is_client_sendq_empty(server2, MSG); | |
2205 | ||
2206 | sendto_channel_local_butone(local_chan_p, ALL_MEMBERS, channel, "Hello %s!", "World"); | |
2207 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2208 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p Hello World!" CRLF, local_chan_o, "On channel; " MSG); | |
2209 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On channel; " MSG); | |
2210 | is_client_sendq("@account=test_p Hello World!" CRLF, local_chan_v, "On channel; " MSG); | |
2211 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2212 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On channel; " MSG); | |
2213 | is_client_sendq_empty(server, MSG); | |
2214 | is_client_sendq_empty(server2, MSG); | |
2215 | ||
2216 | sendto_channel_local_butone(local_chan_ov, CHFL_VOICE, channel, "Hello %s!", "World"); | |
2217 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2218 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
2219 | is_client_sendq_empty(local_chan_ov, "Is the one (neo); " MSG); | |
2220 | is_client_sendq("@account=test_ov Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
2221 | is_client_sendq_empty(local_chan_p, "Not +v; " MSG); | |
2222 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
2223 | is_client_sendq_empty(server, MSG); | |
2224 | is_client_sendq_empty(server2, MSG); | |
2225 | ||
2226 | sendto_channel_local_butone(local_chan_p, CHFL_VOICE, channel, "Hello %s!", "World"); | |
2227 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2228 | is_client_sendq_empty(local_chan_o, "Not +v; " MSG); | |
2229 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +v; " MSG); | |
2230 | is_client_sendq("@account=test_p Hello World!" CRLF, local_chan_v, "Has +v; " MSG); | |
2231 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2232 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +v; " MSG); | |
2233 | is_client_sendq_empty(server, MSG); | |
2234 | is_client_sendq_empty(server2, MSG); | |
2235 | ||
2236 | sendto_channel_local_butone(local_chan_o, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
2237 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2238 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2239 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
2240 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
2241 | is_client_sendq_empty(local_chan_p, "Not +o; " MSG); | |
2242 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
2243 | is_client_sendq_empty(server, MSG); | |
2244 | is_client_sendq_empty(server2, MSG); | |
2245 | ||
2246 | sendto_channel_local_butone(local_chan_p, CHFL_CHANOP, channel, "Hello %s!", "World"); | |
2247 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2248 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p Hello World!" CRLF, local_chan_o, "Has +o; " MSG); | |
2249 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o; " MSG); | |
2250 | is_client_sendq_empty(local_chan_v, "Not +o; " MSG); | |
2251 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2252 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o; " MSG); | |
2253 | is_client_sendq_empty(server, MSG); | |
2254 | is_client_sendq_empty(server2, MSG); | |
2255 | ||
2256 | sendto_channel_local_butone(local_chan_v, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
2257 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2258 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_v Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
2259 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
2260 | is_client_sendq_empty(local_chan_v, "Is the one (neo); " MSG); | |
2261 | is_client_sendq_empty(local_chan_p, "Not +o/+v; " MSG); | |
2262 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
2263 | is_client_sendq_empty(server, MSG); | |
2264 | is_client_sendq_empty(server2, MSG); | |
2265 | ||
2266 | sendto_channel_local_butone(local_chan_p, CHFL_CHANOP | CHFL_VOICE, channel, "Hello %s!", "World"); | |
2267 | is_client_sendq_empty(user, "Not on channel; " MSG); | |
2268 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p Hello World!" CRLF, local_chan_o, "Has +o/+v; " MSG); | |
2269 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Has +o/+v; " MSG); | |
2270 | is_client_sendq("@account=test_p Hello World!" CRLF, local_chan_v, "Has +o/+v; " MSG); | |
2271 | is_client_sendq_empty(local_chan_p, "Is the one (neo); " MSG); | |
2272 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Has +o/+v; " MSG); | |
2273 | is_client_sendq_empty(server, MSG); | |
2274 | is_client_sendq_empty(server2, MSG); | |
2275 | ||
2276 | standard_free(); | |
2277 | } | |
2278 | ||
2279 | static void sendto_common_channels_local1(void) | |
2280 | { | |
2281 | standard_init(); | |
2282 | ||
2283 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
2284 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
2285 | ||
2286 | sendto_common_channels_local(local_chan_o, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2287 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2288 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has cap; " MSG); | |
2289 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2290 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
2291 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
2292 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2293 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2294 | is_client_sendq_empty(server, MSG); | |
2295 | is_client_sendq_empty(server2, MSG); | |
2296 | ||
2297 | sendto_common_channels_local(local_chan_o, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2298 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2299 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
2300 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Doesn't have cap; " MSG); | |
2301 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2302 | is_client_sendq("Hello World!" CRLF, local_chan_p, "Doesn't have cap; " MSG); | |
2303 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Doesn't have cap; " MSG); | |
2304 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2305 | is_client_sendq_empty(server, MSG); | |
2306 | is_client_sendq_empty(server2, MSG); | |
2307 | ||
2308 | sendto_common_channels_local(local_chan_o, 0, 0, "Hello %s!", "World"); | |
2309 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2310 | is_client_sendq("Hello World!" CRLF, local_chan_o, "No cap checking; " MSG); | |
2311 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On common channel; " MSG); | |
2312 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On common channel; " MSG); | |
2313 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On common channel; " MSG); | |
2314 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On common channel; " MSG); | |
2315 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2316 | is_client_sendq_empty(server, MSG); | |
2317 | is_client_sendq_empty(server2, MSG); | |
2318 | ||
2319 | sendto_common_channels_local(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2320 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2321 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2322 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2323 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2324 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2325 | is_client_sendq_empty(local_no_chan, "Doesn't have cap; " MSG); | |
2326 | is_client_sendq_empty(server, MSG); | |
2327 | is_client_sendq_empty(server2, MSG); | |
2328 | ||
2329 | sendto_common_channels_local(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2330 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2331 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2332 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2333 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2334 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2335 | is_client_sendq("Hello World!" CRLF, local_no_chan, "Doesn't have cap; " MSG); | |
2336 | is_client_sendq_empty(server, MSG); | |
2337 | is_client_sendq_empty(server2, MSG); | |
2338 | ||
2339 | sendto_common_channels_local(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2340 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2341 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2342 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2343 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2344 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2345 | is_client_sendq("Hello World!" CRLF, local_no_chan, "No cap checking; " MSG); | |
2346 | is_client_sendq_empty(server, MSG); | |
2347 | is_client_sendq_empty(server2, MSG); | |
2348 | ||
2349 | local_no_chan->localClient->caps |= CAP_INVITE_NOTIFY; | |
2350 | ||
2351 | sendto_common_channels_local(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2352 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2353 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2354 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2355 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2356 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2357 | is_client_sendq("Hello World!" CRLF, local_no_chan, "Has cap; " MSG); | |
2358 | is_client_sendq_empty(server, MSG); | |
2359 | is_client_sendq_empty(server2, MSG); | |
2360 | ||
2361 | sendto_common_channels_local(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2362 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2363 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2364 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2365 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2366 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2367 | is_client_sendq_empty(local_no_chan, "Has cap; " MSG); | |
2368 | is_client_sendq_empty(server, MSG); | |
2369 | is_client_sendq_empty(server2, MSG); | |
2370 | ||
2371 | sendto_common_channels_local(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2372 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2373 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2374 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2375 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2376 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2377 | is_client_sendq("Hello World!" CRLF, local_no_chan, "No cap checking; " MSG); | |
2378 | is_client_sendq_empty(server, MSG); | |
2379 | is_client_sendq_empty(server2, MSG); | |
2380 | ||
2381 | standard_free(); | |
2382 | } | |
2383 | ||
2384 | static void sendto_common_channels_local1__tags(void) | |
2385 | { | |
2386 | standard_init(); | |
2387 | ||
2388 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
2389 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
2390 | ||
2391 | strcpy(local_chan_o->user->suser, "test_o"); | |
2392 | strcpy(local_no_chan->user->suser, "test_n"); | |
2393 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
2394 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
2395 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
2396 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
2397 | ||
2398 | sendto_common_channels_local(local_chan_o, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2399 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2400 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o Hello World!" CRLF, local_chan_o, "Has cap; " MSG); | |
2401 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2402 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
2403 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
2404 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2405 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2406 | is_client_sendq_empty(server, MSG); | |
2407 | is_client_sendq_empty(server2, MSG); | |
2408 | ||
2409 | sendto_common_channels_local(local_chan_o, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2410 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2411 | is_client_sendq_empty(local_chan_o, "Has cap; " MSG); | |
2412 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Doesn't have cap; " MSG); | |
2413 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2414 | is_client_sendq("Hello World!" CRLF, local_chan_p, "Doesn't have cap; " MSG); | |
2415 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Doesn't have cap; " MSG); | |
2416 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2417 | is_client_sendq_empty(server, MSG); | |
2418 | is_client_sendq_empty(server2, MSG); | |
2419 | ||
2420 | sendto_common_channels_local(local_chan_o, 0, 0, "Hello %s!", "World"); | |
2421 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2422 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o Hello World!" CRLF, local_chan_o, "No cap checking; " MSG); | |
2423 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On common channel; " MSG); | |
2424 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "On common channel; " MSG); | |
2425 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On common channel; " MSG); | |
2426 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On common channel; " MSG); | |
2427 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2428 | is_client_sendq_empty(server, MSG); | |
2429 | is_client_sendq_empty(server2, MSG); | |
2430 | ||
2431 | local_no_chan->localClient->caps |= CAP_SERVER_TIME; | |
2432 | ||
2433 | sendto_common_channels_local(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2434 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2435 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2436 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2437 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2438 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2439 | is_client_sendq_empty(local_no_chan, "Doesn't have cap; " MSG); | |
2440 | is_client_sendq_empty(server, MSG); | |
2441 | is_client_sendq_empty(server2, MSG); | |
2442 | ||
2443 | sendto_common_channels_local(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2444 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2445 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2446 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2447 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2448 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2449 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_no_chan, "Doesn't have cap; " MSG); | |
2450 | is_client_sendq_empty(server, MSG); | |
2451 | is_client_sendq_empty(server2, MSG); | |
2452 | ||
2453 | sendto_common_channels_local(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2454 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2455 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2456 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2457 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2458 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2459 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_no_chan, "No cap checking; " MSG); | |
2460 | is_client_sendq_empty(server, MSG); | |
2461 | is_client_sendq_empty(server2, MSG); | |
2462 | ||
2463 | local_no_chan->localClient->caps |= CAP_INVITE_NOTIFY; | |
2464 | local_no_chan->localClient->caps |= CAP_ACCOUNT_TAG; | |
2465 | ||
2466 | sendto_common_channels_local(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2467 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2468 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2469 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2470 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2471 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2472 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_n Hello World!" CRLF, local_no_chan, "Has cap; " MSG); | |
2473 | is_client_sendq_empty(server, MSG); | |
2474 | is_client_sendq_empty(server2, MSG); | |
2475 | ||
2476 | sendto_common_channels_local(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2477 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2478 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2479 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2480 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2481 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2482 | is_client_sendq_empty(local_no_chan, "Has cap; " MSG); | |
2483 | is_client_sendq_empty(server, MSG); | |
2484 | is_client_sendq_empty(server2, MSG); | |
2485 | ||
2486 | sendto_common_channels_local(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2487 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2488 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2489 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2490 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2491 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2492 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_n Hello World!" CRLF, local_no_chan, "No cap checking; " MSG); | |
2493 | is_client_sendq_empty(server, MSG); | |
2494 | is_client_sendq_empty(server2, MSG); | |
2495 | ||
2496 | local_no_chan->localClient->caps &= ~CAP_SERVER_TIME; | |
2497 | ||
2498 | sendto_common_channels_local(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2499 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2500 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2501 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2502 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2503 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2504 | is_client_sendq("@account=test_n Hello World!" CRLF, local_no_chan, "Has cap; " MSG); | |
2505 | is_client_sendq_empty(server, MSG); | |
2506 | is_client_sendq_empty(server2, MSG); | |
2507 | ||
2508 | sendto_common_channels_local(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2509 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2510 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2511 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2512 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2513 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2514 | is_client_sendq_empty(local_no_chan, "Has cap; " MSG); | |
2515 | is_client_sendq_empty(server, MSG); | |
2516 | is_client_sendq_empty(server2, MSG); | |
2517 | ||
2518 | sendto_common_channels_local(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2519 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2520 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2521 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2522 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2523 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2524 | is_client_sendq("@account=test_n Hello World!" CRLF, local_no_chan, "No cap checking; " MSG); | |
2525 | is_client_sendq_empty(server, MSG); | |
2526 | is_client_sendq_empty(server2, MSG); | |
2527 | ||
2528 | standard_free(); | |
2529 | } | |
2530 | ||
2531 | static void sendto_common_channels_local_butone1(void) | |
2532 | { | |
2533 | standard_init(); | |
2534 | ||
2535 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
2536 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
2537 | ||
2538 | sendto_common_channels_local_butone(local_chan_o, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2539 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2540 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2541 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2542 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
2543 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
2544 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2545 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2546 | is_client_sendq_empty(server, MSG); | |
2547 | is_client_sendq_empty(server2, MSG); | |
2548 | ||
2549 | sendto_common_channels_local_butone(local_chan_o, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2550 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2551 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2552 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "Doesn't have cap; " MSG); | |
2553 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2554 | is_client_sendq("Hello World!" CRLF, local_chan_p, "Doesn't have cap; " MSG); | |
2555 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Doesn't have cap; " MSG); | |
2556 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2557 | is_client_sendq_empty(server, MSG); | |
2558 | is_client_sendq_empty(server2, MSG); | |
2559 | ||
2560 | sendto_common_channels_local_butone(local_chan_o, 0, 0, "Hello %s!", "World"); | |
2561 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2562 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2563 | is_client_sendq("Hello World!" CRLF, local_chan_ov, "On common channel; " MSG); | |
2564 | is_client_sendq("Hello World!" CRLF, local_chan_v, "On common channel; " MSG); | |
2565 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On common channel; " MSG); | |
2566 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On common channel; " MSG); | |
2567 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2568 | is_client_sendq_empty(server, MSG); | |
2569 | is_client_sendq_empty(server2, MSG); | |
2570 | ||
2571 | sendto_common_channels_local_butone(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2572 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2573 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2574 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2575 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2576 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2577 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2578 | is_client_sendq_empty(server, MSG); | |
2579 | is_client_sendq_empty(server2, MSG); | |
2580 | ||
2581 | sendto_common_channels_local_butone(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2582 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2583 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2584 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2585 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2586 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2587 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2588 | is_client_sendq_empty(server, MSG); | |
2589 | is_client_sendq_empty(server2, MSG); | |
2590 | ||
2591 | sendto_common_channels_local_butone(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2592 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2593 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2594 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2595 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2596 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2597 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2598 | is_client_sendq_empty(server, MSG); | |
2599 | is_client_sendq_empty(server2, MSG); | |
2600 | ||
2601 | local_no_chan->localClient->caps |= CAP_INVITE_NOTIFY; | |
2602 | ||
2603 | sendto_common_channels_local_butone(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2604 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2605 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2606 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2607 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2608 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2609 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2610 | is_client_sendq_empty(server, MSG); | |
2611 | is_client_sendq_empty(server2, MSG); | |
2612 | ||
2613 | sendto_common_channels_local_butone(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2614 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2615 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2616 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2617 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2618 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2619 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2620 | is_client_sendq_empty(server, MSG); | |
2621 | is_client_sendq_empty(server2, MSG); | |
2622 | ||
2623 | sendto_common_channels_local_butone(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2624 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2625 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2626 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2627 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2628 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2629 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2630 | is_client_sendq_empty(server, MSG); | |
2631 | is_client_sendq_empty(server2, MSG); | |
2632 | ||
2633 | standard_free(); | |
2634 | } | |
2635 | ||
2636 | static void sendto_common_channels_local_butone1__tags(void) | |
2637 | { | |
2638 | standard_init(); | |
2639 | ||
2640 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
2641 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
2642 | ||
2643 | strcpy(local_chan_o->user->suser, "test_o"); | |
2644 | strcpy(local_no_chan->user->suser, "test_n"); | |
2645 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
2646 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
2647 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
2648 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
2649 | ||
2650 | sendto_common_channels_local_butone(local_chan_o, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2651 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2652 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2653 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
2654 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
2655 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
2656 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
2657 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2658 | is_client_sendq_empty(server, MSG); | |
2659 | is_client_sendq_empty(server2, MSG); | |
2660 | ||
2661 | sendto_common_channels_local_butone(local_chan_o, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2662 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2663 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2664 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Doesn't have cap; " MSG); | |
2665 | is_client_sendq_empty(local_chan_v, "Has cap; " MSG); | |
2666 | is_client_sendq("Hello World!" CRLF, local_chan_p, "Doesn't have cap; " MSG); | |
2667 | is_client_sendq("Hello World!" CRLF, local_chan_d, "Doesn't have cap; " MSG); | |
2668 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2669 | is_client_sendq_empty(server, MSG); | |
2670 | is_client_sendq_empty(server2, MSG); | |
2671 | ||
2672 | sendto_common_channels_local_butone(local_chan_o, 0, 0, "Hello %s!", "World"); | |
2673 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2674 | is_client_sendq_empty(local_chan_o, "Is the one (neo); " MSG); | |
2675 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "On common channel; " MSG); | |
2676 | is_client_sendq("@account=test_o Hello World!" CRLF, local_chan_v, "On common channel; " MSG); | |
2677 | is_client_sendq("Hello World!" CRLF, local_chan_p, "On common channel; " MSG); | |
2678 | is_client_sendq("Hello World!" CRLF, local_chan_d, "On common channel; " MSG); | |
2679 | is_client_sendq_empty(local_no_chan, "Not on common channel; " MSG); | |
2680 | is_client_sendq_empty(server, MSG); | |
2681 | is_client_sendq_empty(server2, MSG); | |
2682 | ||
2683 | local_no_chan->localClient->caps |= CAP_SERVER_TIME; | |
2684 | ||
2685 | sendto_common_channels_local_butone(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2686 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2687 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2688 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2689 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2690 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2691 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2692 | is_client_sendq_empty(server, MSG); | |
2693 | is_client_sendq_empty(server2, MSG); | |
2694 | ||
2695 | sendto_common_channels_local_butone(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2696 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2697 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2698 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2699 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2700 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2701 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2702 | is_client_sendq_empty(server, MSG); | |
2703 | is_client_sendq_empty(server2, MSG); | |
2704 | ||
2705 | sendto_common_channels_local_butone(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2706 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2707 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2708 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2709 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2710 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2711 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2712 | is_client_sendq_empty(server, MSG); | |
2713 | is_client_sendq_empty(server2, MSG); | |
2714 | ||
2715 | local_no_chan->localClient->caps |= CAP_INVITE_NOTIFY; | |
2716 | local_no_chan->localClient->caps |= CAP_ACCOUNT_TAG; | |
2717 | ||
2718 | sendto_common_channels_local_butone(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2719 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2720 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2721 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2722 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2723 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2724 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2725 | is_client_sendq_empty(server, MSG); | |
2726 | is_client_sendq_empty(server2, MSG); | |
2727 | ||
2728 | sendto_common_channels_local_butone(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2729 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2730 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2731 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2732 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2733 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2734 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2735 | is_client_sendq_empty(server, MSG); | |
2736 | is_client_sendq_empty(server2, MSG); | |
2737 | ||
2738 | sendto_common_channels_local_butone(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2739 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2740 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2741 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2742 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2743 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2744 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2745 | is_client_sendq_empty(server, MSG); | |
2746 | is_client_sendq_empty(server2, MSG); | |
2747 | ||
2748 | local_no_chan->localClient->caps &= ~CAP_SERVER_TIME; | |
2749 | ||
2750 | sendto_common_channels_local_butone(local_no_chan, CAP_INVITE_NOTIFY, 0, "Hello %s!", "World"); | |
2751 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2752 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2753 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2754 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2755 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2756 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2757 | is_client_sendq_empty(server, MSG); | |
2758 | is_client_sendq_empty(server2, MSG); | |
2759 | ||
2760 | sendto_common_channels_local_butone(local_no_chan, 0, CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
2761 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2762 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2763 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2764 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2765 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2766 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2767 | is_client_sendq_empty(server, MSG); | |
2768 | is_client_sendq_empty(server2, MSG); | |
2769 | ||
2770 | sendto_common_channels_local_butone(local_no_chan, 0, 0, "Hello %s!", "World"); | |
2771 | is_client_sendq_empty(user, "Not on common channel; " MSG); | |
2772 | is_client_sendq_empty(local_chan_o, "Not on common channel; " MSG); | |
2773 | is_client_sendq_empty(local_chan_ov, "Not on common channel; " MSG); | |
2774 | is_client_sendq_empty(local_chan_p, "Not on common channel; " MSG); | |
2775 | is_client_sendq_empty(local_chan_d, "Not on common channel; " MSG); | |
2776 | is_client_sendq_empty(local_no_chan, "Is the one (neo); " MSG); | |
2777 | is_client_sendq_empty(server, MSG); | |
2778 | is_client_sendq_empty(server2, MSG); | |
2779 | ||
2780 | standard_free(); | |
2781 | } | |
2782 | ||
2783 | static void sendto_match_butone__host(void) | |
2784 | { | |
2785 | standard_init(); | |
2786 | ||
2787 | // This function does not support TS5... | |
2788 | standard_ids(); | |
2789 | ||
2790 | // Local | |
2791 | sendto_match_butone(NULL, user, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2792 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2793 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2794 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2795 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2796 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2797 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2798 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2799 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2800 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2801 | ||
2802 | sendto_match_butone(NULL, user, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2803 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2804 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2805 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2806 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2807 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2808 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2809 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2810 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2811 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2812 | ||
2813 | sendto_match_butone(server, user, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2814 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2815 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2816 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2817 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2818 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2819 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2820 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2821 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2822 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2823 | ||
2824 | sendto_match_butone(server, user, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2825 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2826 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2827 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2828 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2829 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2830 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2831 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2832 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2833 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2834 | ||
2835 | // Remote | |
2836 | sendto_match_butone(NULL, remote, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2837 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2838 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2839 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2840 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2841 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2842 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2843 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2844 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2845 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2846 | ||
2847 | sendto_match_butone(NULL, remote, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2848 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2849 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2850 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2851 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2852 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2853 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2854 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2855 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2856 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2857 | ||
2858 | sendto_match_butone(server, remote, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2859 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2860 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2861 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2862 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2863 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2864 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2865 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2866 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2867 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2868 | ||
2869 | sendto_match_butone(server, remote, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2870 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2871 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2872 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2873 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2874 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2875 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2876 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2877 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2878 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2879 | ||
2880 | standard_free(); | |
2881 | } | |
2882 | ||
2883 | static void sendto_match_butone__host__tags(void) | |
2884 | { | |
2885 | standard_init(); | |
2886 | ||
2887 | strcpy(user->user->suser, "test"); | |
2888 | strcpy(remote->user->suser, "rtest"); | |
2889 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
2890 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
2891 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
2892 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
2893 | ||
2894 | // This function does not support TS5... | |
2895 | standard_ids(); | |
2896 | ||
2897 | // Local | |
2898 | sendto_match_butone(NULL, user, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2899 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2900 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2901 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2902 | is_client_sendq("@account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2903 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2904 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2905 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2906 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2907 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2908 | ||
2909 | sendto_match_butone(NULL, user, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2910 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2911 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2912 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2913 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2914 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2915 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2916 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2917 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2918 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2919 | ||
2920 | sendto_match_butone(server, user, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2921 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2922 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2923 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2924 | is_client_sendq("@account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2925 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2926 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2927 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2928 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2929 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2930 | ||
2931 | sendto_match_butone(server, user, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2932 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2933 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2934 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2935 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2936 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2937 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2938 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2939 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2940 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2941 | ||
2942 | // Remote | |
2943 | sendto_match_butone(NULL, remote, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2944 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2945 | is_client_sendq("@time=" ADVENTURE_TIME ";account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2946 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2947 | is_client_sendq("@account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2948 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2949 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2950 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2951 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2952 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2953 | ||
2954 | sendto_match_butone(NULL, remote, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2955 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2956 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2957 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2958 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2959 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2960 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2961 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
2962 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2963 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2964 | ||
2965 | sendto_match_butone(server, remote, "*.test", MATCH_HOST, "TEST Hello %s!", "World"); | |
2966 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Host matches; " MSG); | |
2967 | is_client_sendq("@time=" ADVENTURE_TIME ";account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Host matches; " MSG); | |
2968 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Host matches; " MSG); | |
2969 | is_client_sendq("@account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Host matches; " MSG); | |
2970 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Host matches; " MSG); | |
2971 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Host matches; " MSG); | |
2972 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2973 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2974 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2975 | ||
2976 | sendto_match_butone(server, remote, "*.invalid", MATCH_HOST, "TEST Hello %s!", "World"); | |
2977 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
2978 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
2979 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
2980 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
2981 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
2982 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
2983 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
2984 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
2985 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
2986 | ||
2987 | standard_free(); | |
2988 | } | |
2989 | ||
2990 | static void sendto_match_butone__server(void) | |
2991 | { | |
2992 | standard_init(); | |
2993 | ||
2994 | // This function does not support TS5... | |
2995 | standard_ids(); | |
2996 | ||
2997 | // Local | |
2998 | sendto_match_butone(NULL, user, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
2999 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3000 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3001 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3002 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3003 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3004 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3005 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3006 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3007 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3008 | ||
3009 | sendto_match_butone(NULL, user, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3010 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3011 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3012 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3013 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3014 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3015 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3016 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3017 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3018 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3019 | ||
3020 | sendto_match_butone(server, user, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3021 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3022 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3023 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3024 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3025 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3026 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3027 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3028 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3029 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3030 | ||
3031 | sendto_match_butone(server, user, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3032 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3033 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3034 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3035 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3036 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3037 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3038 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3039 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3040 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3041 | ||
3042 | // Remote | |
3043 | sendto_match_butone(NULL, remote, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3044 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3045 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3046 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3047 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3048 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3049 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3050 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3051 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3052 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3053 | ||
3054 | sendto_match_butone(NULL, remote, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3055 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3056 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3057 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3058 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3059 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3060 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3061 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3062 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3063 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3064 | ||
3065 | sendto_match_butone(server, remote, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3066 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3067 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3068 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3069 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3070 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3071 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3072 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3073 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3074 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3075 | ||
3076 | sendto_match_butone(server, remote, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3077 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3078 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3079 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3080 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3081 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3082 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3083 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3084 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3085 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3086 | ||
3087 | standard_free(); | |
3088 | } | |
3089 | ||
3090 | static void sendto_match_butone__server__tags(void) | |
3091 | { | |
3092 | standard_init(); | |
3093 | ||
3094 | strcpy(user->user->suser, "test"); | |
3095 | strcpy(remote->user->suser, "rtest"); | |
3096 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
3097 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
3098 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
3099 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
3100 | ||
3101 | // This function does not support TS5... | |
3102 | standard_ids(); | |
3103 | ||
3104 | // Local | |
3105 | sendto_match_butone(NULL, user, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3106 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3107 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3108 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3109 | is_client_sendq("@account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3110 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3111 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3112 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3113 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3114 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3115 | ||
3116 | sendto_match_butone(NULL, user, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3117 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3118 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3119 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3120 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3121 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3122 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3123 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3124 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3125 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3126 | ||
3127 | sendto_match_butone(server, user, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3128 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3129 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3130 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3131 | is_client_sendq("@account=test :" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3132 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3133 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3134 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3135 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3136 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3137 | ||
3138 | sendto_match_butone(server, user, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3139 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3140 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3141 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3142 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3143 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3144 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3145 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3146 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3147 | is_client_sendq(":" TEST_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3148 | ||
3149 | // Remote | |
3150 | sendto_match_butone(NULL, remote, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3151 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3152 | is_client_sendq("@time=" ADVENTURE_TIME ";account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3153 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3154 | is_client_sendq("@account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3155 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3156 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3157 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3158 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3159 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3160 | ||
3161 | sendto_match_butone(NULL, remote, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3162 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3163 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3164 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3165 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3166 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3167 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3168 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server, "Is a server; " MSG); | |
3169 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3170 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3171 | ||
3172 | sendto_match_butone(server, remote, "me.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3173 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, user, "Server matches; " MSG); | |
3174 | is_client_sendq("@time=" ADVENTURE_TIME ";account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_o, "Server matches; " MSG); | |
3175 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_ov, "Server matches; " MSG); | |
3176 | is_client_sendq("@account=rtest :" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_v, "Server matches; " MSG); | |
3177 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_p, "Server matches; " MSG); | |
3178 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST Hello World!" CRLF, local_chan_d, "Server matches; " MSG); | |
3179 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3180 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3181 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3182 | ||
3183 | sendto_match_butone(server, remote, "example.*", MATCH_SERVER, "TEST Hello %s!", "World"); | |
3184 | is_client_sendq_empty(user, "Host doesn't match; " MSG); | |
3185 | is_client_sendq_empty(local_chan_o, "Host doesn't match; " MSG); | |
3186 | is_client_sendq_empty(local_chan_ov, "Host doesn't match; " MSG); | |
3187 | is_client_sendq_empty(local_chan_v, "Host doesn't match; " MSG); | |
3188 | is_client_sendq_empty(local_chan_p, "Host doesn't match; " MSG); | |
3189 | is_client_sendq_empty(local_chan_d, "Host doesn't match; " MSG); | |
3190 | is_client_sendq_empty(server, "Is the one (neo); " MSG); | |
3191 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server2, "Is a server; " MSG); | |
3192 | is_client_sendq(":" TEST_REMOTE_ID " TEST Hello World!" CRLF, server3, "Is a server; " MSG); | |
3193 | ||
3194 | standard_free(); | |
3195 | } | |
3196 | ||
3197 | static void sendto_local_clients_with_capability1(void) | |
3198 | { | |
3199 | standard_init(); | |
3200 | ||
3201 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
3202 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
3203 | ||
3204 | sendto_local_clients_with_capability(CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
3205 | is_client_sendq_empty(user, "Doesn't have cap; " MSG); | |
3206 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Has cap; " MSG); | |
3207 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
3208 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
3209 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
3210 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
3211 | is_client_sendq_empty(server, MSG); | |
3212 | is_client_sendq_empty(server2, MSG); | |
3213 | ||
3214 | standard_free(); | |
3215 | } | |
3216 | ||
3217 | static void sendto_local_clients_with_capability1__tags(void) | |
3218 | { | |
3219 | standard_init(); | |
3220 | ||
3221 | local_chan_o->localClient->caps |= CAP_INVITE_NOTIFY; | |
3222 | local_chan_v->localClient->caps |= CAP_INVITE_NOTIFY; | |
3223 | ||
3224 | strcpy(user->user->suser, "test"); | |
3225 | strcpy(local_chan_o->user->suser, "test_o"); | |
3226 | strcpy(local_chan_ov->user->suser, "test_ov"); | |
3227 | strcpy(local_chan_v->user->suser, "test_v"); | |
3228 | strcpy(local_chan_p->user->suser, "test_p"); | |
3229 | strcpy(local_chan_d->user->suser, "test_d"); | |
3230 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
3231 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
3232 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
3233 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
3234 | ||
3235 | sendto_local_clients_with_capability(CAP_INVITE_NOTIFY, "Hello %s!", "World"); | |
3236 | is_client_sendq_empty(user, "Doesn't have cap; " MSG); | |
3237 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_o, "Has cap; " MSG); | |
3238 | is_client_sendq_empty(local_chan_ov, "Doesn't have cap; " MSG); | |
3239 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Has cap; " MSG); | |
3240 | is_client_sendq_empty(local_chan_p, "Doesn't have cap; " MSG); | |
3241 | is_client_sendq_empty(local_chan_d, "Doesn't have cap; " MSG); | |
3242 | is_client_sendq_empty(server, MSG); | |
3243 | is_client_sendq_empty(server2, MSG); | |
3244 | ||
3245 | standard_free(); | |
3246 | } | |
3247 | ||
3248 | static void sendto_monitor1(void) | |
3249 | { | |
3250 | struct monitor *monptr; | |
3251 | ||
3252 | standard_init(); | |
3253 | ||
3254 | monptr = find_monitor(TEST_NICK, 1); | |
3255 | rb_dlinkAddAlloc(local_chan_o, &monptr->users); | |
3256 | rb_dlinkAddAlloc(monptr, &local_chan_o->localClient->monitor_list); | |
3257 | rb_dlinkAddAlloc(local_chan_v, &monptr->users); | |
3258 | rb_dlinkAddAlloc(monptr, &local_chan_v->localClient->monitor_list); | |
3259 | ||
3260 | sendto_monitor(user, monptr, "Hello %s!", "World"); | |
3261 | is_client_sendq_empty(user, "Not monitoring; " MSG); | |
3262 | is_client_sendq("Hello World!" CRLF, local_chan_o, "Monitoring; " MSG); | |
3263 | is_client_sendq_empty(local_chan_ov, "Not monitoring; " MSG); | |
3264 | is_client_sendq("Hello World!" CRLF, local_chan_v, "Monitoring; " MSG); | |
3265 | is_client_sendq_empty(local_chan_p, "Not monitoring; " MSG); | |
3266 | is_client_sendq_empty(local_chan_d, "Not monitoring; " MSG); | |
3267 | is_client_sendq_empty(server, MSG); | |
3268 | is_client_sendq_empty(server2, MSG); | |
3269 | ||
3270 | standard_free(); | |
3271 | } | |
3272 | ||
3273 | static void sendto_monitor1__tags(void) | |
3274 | { | |
3275 | struct monitor *monptr; | |
3276 | ||
3277 | standard_init(); | |
3278 | ||
3279 | strcpy(user->user->suser, "test"); | |
3280 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
3281 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
3282 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
3283 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
3284 | ||
3285 | monptr = find_monitor(TEST_NICK, 1); | |
3286 | rb_dlinkAddAlloc(local_chan_o, &monptr->users); | |
3287 | rb_dlinkAddAlloc(monptr, &local_chan_o->localClient->monitor_list); | |
3288 | rb_dlinkAddAlloc(local_chan_v, &monptr->users); | |
3289 | rb_dlinkAddAlloc(monptr, &local_chan_v->localClient->monitor_list); | |
3290 | ||
3291 | sendto_monitor(user, monptr, "Hello %s!", "World"); | |
3292 | is_client_sendq_empty(user, "Not monitoring; " MSG); | |
3293 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test Hello World!" CRLF, local_chan_o, "Monitoring; " MSG); | |
3294 | is_client_sendq_empty(local_chan_ov, "Not monitoring; " MSG); | |
3295 | is_client_sendq("@account=test Hello World!" CRLF, local_chan_v, "Monitoring; " MSG); | |
3296 | is_client_sendq_empty(local_chan_p, "Not monitoring; " MSG); | |
3297 | is_client_sendq_empty(local_chan_d, "Not monitoring; " MSG); | |
3298 | is_client_sendq_empty(server, MSG); | |
3299 | is_client_sendq_empty(server2, MSG); | |
3300 | ||
3301 | rb_dlinkAddAlloc(local_chan_ov, &monptr->users); | |
3302 | rb_dlinkAddAlloc(monptr, &local_chan_ov->localClient->monitor_list); | |
3303 | clear_monitor(local_chan_o); | |
3304 | clear_monitor(local_chan_v); | |
3305 | ||
3306 | sendto_monitor(user, monptr, "Hello %s!", "World"); | |
3307 | is_client_sendq_empty(user, "Not monitoring; " MSG); | |
3308 | is_client_sendq_empty(local_chan_o, "Not monitoring; " MSG); | |
3309 | is_client_sendq("@time=" ADVENTURE_TIME " Hello World!" CRLF, local_chan_ov, "Monitoring; " MSG); | |
3310 | is_client_sendq_empty(local_chan_v, "Not monitoring; " MSG); | |
3311 | is_client_sendq_empty(local_chan_p, "Not monitoring; " MSG); | |
3312 | is_client_sendq_empty(local_chan_d, "Not monitoring; " MSG); | |
3313 | is_client_sendq_empty(server, MSG); | |
3314 | is_client_sendq_empty(server2, MSG); | |
3315 | ||
3316 | standard_free(); | |
3317 | } | |
3318 | ||
3319 | static void sendto_anywhere1(void) | |
3320 | { | |
3321 | standard_init(); | |
3322 | ||
3323 | // This function does not support TS5... | |
3324 | standard_ids(); | |
3325 | ||
3326 | // Local | |
3327 | sendto_anywhere(user, remote, "TEST", "Hello %s!", "World"); | |
3328 | is_client_sendq(":" TEST_REMOTE_NICK TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3329 | is_client_sendq_empty(server, MSG); | |
3330 | ||
3331 | sendto_anywhere(user, local_chan_o, "TEST", "Hello %s!", "World"); | |
3332 | is_client_sendq(":LChanOp" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3333 | is_client_sendq_empty(local_chan_o, MSG); | |
3334 | is_client_sendq_empty(server, MSG); | |
3335 | ||
3336 | sendto_anywhere(user, server, "TEST", "Hello %s!", "World"); | |
3337 | is_client_sendq(":" TEST_SERVER_NAME " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3338 | is_client_sendq_empty(server, MSG); | |
3339 | ||
3340 | sendto_anywhere(user, &me, "TEST", "Hello %s!", "World"); | |
3341 | is_client_sendq(":" TEST_ME_NAME " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3342 | is_client_sendq_empty(server, MSG); | |
3343 | ||
3344 | // Remote | |
3345 | sendto_anywhere(remote, user, "TEST", "Hello %s!", "World"); | |
3346 | is_client_sendq_empty(user, MSG); | |
3347 | is_client_sendq(":" TEST_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3348 | ||
3349 | sendto_anywhere(remote, local_chan_o, "TEST", "Hello %s!", "World"); | |
3350 | is_client_sendq_empty(local_chan_o, MSG); | |
3351 | is_client_sendq(":" TEST_ME_ID "90001 TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3352 | ||
3353 | sendto_anywhere(remote, server2, "TEST", "Hello %s!", "World"); | |
3354 | is_client_sendq(":" TEST_SERVER2_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3355 | is_client_sendq_empty(server2, MSG); | |
3356 | ||
3357 | sendto_anywhere(remote, &me, "TEST", "Hello %s!", "World"); | |
3358 | is_client_sendq(":" TEST_ME_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3359 | is_client_sendq_empty(server2, MSG); | |
3360 | ||
3361 | standard_free(); | |
3362 | } | |
3363 | ||
3364 | static void sendto_anywhere1__tags(void) | |
3365 | { | |
3366 | standard_init(); | |
3367 | ||
3368 | strcpy(user->user->suser, "test"); | |
3369 | strcpy(local_chan_o->user->suser, "test_o"); | |
3370 | strcpy(local_chan_ov->user->suser, "test_ov"); | |
3371 | strcpy(local_chan_v->user->suser, "test_v"); | |
3372 | strcpy(local_chan_p->user->suser, "test_p"); | |
3373 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
3374 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
3375 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
3376 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
3377 | ||
3378 | // This function does not support TS5... | |
3379 | standard_ids(); | |
3380 | ||
3381 | // Local | |
3382 | sendto_anywhere(user, local_chan_p, "TEST", "Hello %s!", "World"); | |
3383 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3384 | is_client_sendq_empty(local_chan_p, MSG); | |
3385 | is_client_sendq_empty(server, MSG); | |
3386 | ||
3387 | sendto_anywhere(local_chan_o, local_chan_p, "TEST", "Hello %s!", "World"); | |
3388 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_p :LChanPeon" TEST_ID_SUFFIX " TEST LChanOp Hello World!" CRLF, local_chan_o, MSG); | |
3389 | is_client_sendq_empty(local_chan_p, MSG); | |
3390 | is_client_sendq_empty(server, MSG); | |
3391 | ||
3392 | sendto_anywhere(local_chan_ov, local_chan_p, "TEST", "Hello %s!", "World"); | |
3393 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanPeon" TEST_ID_SUFFIX " TEST LChanOpVoice Hello World!" CRLF, local_chan_ov, MSG); | |
3394 | is_client_sendq_empty(local_chan_p, MSG); | |
3395 | is_client_sendq_empty(server, MSG); | |
3396 | ||
3397 | sendto_anywhere(local_chan_v, local_chan_p, "TEST", "Hello %s!", "World"); | |
3398 | is_client_sendq("@account=test_p :LChanPeon" TEST_ID_SUFFIX " TEST LChanVoice Hello World!" CRLF, local_chan_v, MSG); | |
3399 | is_client_sendq_empty(local_chan_p, MSG); | |
3400 | is_client_sendq_empty(server, MSG); | |
3401 | ||
3402 | sendto_anywhere(user, server, "TEST", "Hello %s!", "World"); | |
3403 | is_client_sendq(":" TEST_SERVER_NAME " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3404 | is_client_sendq_empty(server, MSG); | |
3405 | ||
3406 | sendto_anywhere(user, &me, "TEST", "Hello %s!", "World"); | |
3407 | is_client_sendq(":" TEST_ME_NAME " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3408 | is_client_sendq_empty(server, MSG); | |
3409 | ||
3410 | sendto_anywhere(local_chan_o, server, "TEST", "Hello %s!", "World"); | |
3411 | is_client_sendq(":" TEST_SERVER_NAME " TEST LChanOp Hello World!" CRLF, local_chan_o, MSG); | |
3412 | is_client_sendq_empty(server, MSG); | |
3413 | ||
3414 | sendto_anywhere(local_chan_v, &me, "TEST", "Hello %s!", "World"); | |
3415 | is_client_sendq(":" TEST_ME_NAME " TEST LChanVoice Hello World!" CRLF, local_chan_v, MSG); | |
3416 | is_client_sendq_empty(server, MSG); | |
3417 | ||
3418 | // Remote | |
3419 | sendto_anywhere(remote, user, "TEST", "Hello %s!", "World"); | |
3420 | is_client_sendq_empty(user, MSG); | |
3421 | is_client_sendq(":" TEST_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3422 | ||
3423 | sendto_anywhere(remote, local_chan_o, "TEST", "Hello %s!", "World"); | |
3424 | is_client_sendq_empty(local_chan_o, MSG); | |
3425 | is_client_sendq(":" TEST_ME_ID "90001 TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3426 | ||
3427 | sendto_anywhere(remote, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3428 | is_client_sendq_empty(local_chan_ov, MSG); | |
3429 | is_client_sendq(":" TEST_ME_ID "90002 TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3430 | ||
3431 | sendto_anywhere(remote, local_chan_v, "TEST", "Hello %s!", "World"); | |
3432 | is_client_sendq_empty(local_chan_v, MSG); | |
3433 | is_client_sendq(":" TEST_ME_ID "90003 TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3434 | ||
3435 | sendto_anywhere(remote, server2, "TEST", "Hello %s!", "World"); | |
3436 | is_client_sendq(":" TEST_SERVER2_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3437 | is_client_sendq_empty(server2, MSG); | |
3438 | ||
3439 | sendto_anywhere(remote, &me, "TEST", "Hello %s!", "World"); | |
3440 | is_client_sendq(":" TEST_ME_ID " TEST " TEST_REMOTE_ID " Hello World!" CRLF, server, MSG); | |
3441 | is_client_sendq_empty(server2, MSG); | |
3442 | ||
3443 | standard_free(); | |
3444 | } | |
3445 | ||
3446 | static void sendto_anywhere_echo1(void) | |
3447 | { | |
3448 | standard_init(); | |
3449 | ||
3450 | // Local | |
3451 | sendto_anywhere_echo(user, user, "TEST", "Hello %s!", "World"); | |
3452 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, user, MSG); | |
3453 | is_client_sendq_empty(server, MSG); | |
3454 | ||
3455 | sendto_anywhere_echo(user, local_chan_o, "TEST", "Hello %s!", "World"); | |
3456 | is_client_sendq_empty(user, MSG); | |
3457 | is_client_sendq(":LChanOp" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, local_chan_o, MSG); | |
3458 | is_client_sendq_empty(server, MSG); | |
3459 | ||
3460 | sendto_anywhere_echo(&me, user, "TEST", "Hello %s!", "World"); | |
3461 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST " TEST_ME_NAME " Hello World!" CRLF, user, MSG); | |
3462 | is_client_sendq_empty(server, MSG); | |
3463 | ||
3464 | // Remote | |
3465 | sendto_anywhere_echo(remote, user, "TEST", "Hello %s!", "World"); | |
3466 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST " TEST_REMOTE_NICK " Hello World!" CRLF, user, MSG); | |
3467 | is_client_sendq_empty(server, MSG); | |
3468 | ||
3469 | sendto_anywhere_echo(server, user, "TEST", "Hello %s!", "World"); | |
3470 | is_client_sendq(":" TEST_NICK TEST_ID_SUFFIX " TEST " TEST_SERVER_NAME " Hello World!" CRLF, user, MSG); | |
3471 | is_client_sendq_empty(server, MSG); | |
3472 | ||
3473 | standard_free(); | |
3474 | } | |
3475 | ||
3476 | static void sendto_anywhere_echo1__tags(void) | |
3477 | { | |
3478 | standard_init(); | |
3479 | ||
3480 | strcpy(user->user->suser, "test"); | |
3481 | strcpy(local_chan_o->user->suser, "test_o"); | |
3482 | strcpy(local_chan_ov->user->suser, "test_ov"); | |
3483 | strcpy(local_chan_v->user->suser, "test_v"); | |
3484 | strcpy(local_chan_p->user->suser, "test_p"); | |
3485 | local_chan_o->localClient->caps |= CAP_ACCOUNT_TAG; | |
3486 | local_chan_o->localClient->caps |= CAP_SERVER_TIME; | |
3487 | local_chan_ov->localClient->caps |= CAP_SERVER_TIME; | |
3488 | local_chan_v->localClient->caps |= CAP_ACCOUNT_TAG; | |
3489 | ||
3490 | sendto_anywhere_echo(local_chan_o, local_chan_o, "TEST", "Hello %s!", "World"); | |
3491 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST LChanOp Hello World!" CRLF, local_chan_o, MSG); | |
3492 | is_client_sendq_empty(server, MSG); | |
3493 | ||
3494 | sendto_anywhere_echo(user, local_chan_o, "TEST", "Hello %s!", "World"); | |
3495 | is_client_sendq_empty(user, MSG); | |
3496 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, local_chan_o, MSG); | |
3497 | is_client_sendq_empty(server, MSG); | |
3498 | ||
3499 | sendto_anywhere_echo(local_chan_p, local_chan_o, "TEST", "Hello %s!", "World"); | |
3500 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST LChanPeon Hello World!" CRLF, local_chan_o, MSG); | |
3501 | is_client_sendq_empty(local_chan_p, MSG); | |
3502 | is_client_sendq_empty(server, MSG); | |
3503 | ||
3504 | sendto_anywhere_echo(&me, local_chan_o, "TEST", "Hello %s!", "World"); | |
3505 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST " TEST_ME_NAME " Hello World!" CRLF, local_chan_o, MSG); | |
3506 | is_client_sendq_empty(server, MSG); | |
3507 | ||
3508 | sendto_anywhere_echo(remote, local_chan_o, "TEST", "Hello %s!", "World"); | |
3509 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST " TEST_REMOTE_NICK " Hello World!" CRLF, local_chan_o, MSG); | |
3510 | is_client_sendq_empty(server, MSG); | |
3511 | ||
3512 | sendto_anywhere_echo(server, local_chan_o, "TEST", "Hello %s!", "World"); | |
3513 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test_o :LChanOp" TEST_ID_SUFFIX " TEST " TEST_SERVER_NAME " Hello World!" CRLF, local_chan_o, MSG); | |
3514 | is_client_sendq_empty(server, MSG); | |
3515 | ||
3516 | ||
3517 | sendto_anywhere_echo(local_chan_ov, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3518 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST LChanOpVoice Hello World!" CRLF, local_chan_ov, MSG); | |
3519 | is_client_sendq_empty(server, MSG); | |
3520 | ||
3521 | sendto_anywhere_echo(user, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3522 | is_client_sendq_empty(user, MSG); | |
3523 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, local_chan_ov, MSG); | |
3524 | is_client_sendq_empty(server, MSG); | |
3525 | ||
3526 | sendto_anywhere_echo(local_chan_p, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3527 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST LChanPeon Hello World!" CRLF, local_chan_ov, MSG); | |
3528 | is_client_sendq_empty(local_chan_p, MSG); | |
3529 | is_client_sendq_empty(server, MSG); | |
3530 | ||
3531 | sendto_anywhere_echo(&me, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3532 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST " TEST_ME_NAME " Hello World!" CRLF, local_chan_ov, MSG); | |
3533 | is_client_sendq_empty(server, MSG); | |
3534 | ||
3535 | sendto_anywhere_echo(remote, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3536 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST " TEST_REMOTE_NICK " Hello World!" CRLF, local_chan_ov, MSG); | |
3537 | is_client_sendq_empty(server, MSG); | |
3538 | ||
3539 | sendto_anywhere_echo(server, local_chan_ov, "TEST", "Hello %s!", "World"); | |
3540 | is_client_sendq("@time=" ADVENTURE_TIME " :LChanOpVoice" TEST_ID_SUFFIX " TEST " TEST_SERVER_NAME " Hello World!" CRLF, local_chan_ov, MSG); | |
3541 | is_client_sendq_empty(server, MSG); | |
3542 | ||
3543 | ||
3544 | sendto_anywhere_echo(local_chan_v, local_chan_v, "TEST", "Hello %s!", "World"); | |
3545 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST LChanVoice Hello World!" CRLF, local_chan_v, MSG); | |
3546 | is_client_sendq_empty(server, MSG); | |
3547 | ||
3548 | sendto_anywhere_echo(user, local_chan_v, "TEST", "Hello %s!", "World"); | |
3549 | is_client_sendq_empty(user, MSG); | |
3550 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, local_chan_v, MSG); | |
3551 | is_client_sendq_empty(server, MSG); | |
3552 | ||
3553 | sendto_anywhere_echo(local_chan_p, local_chan_v, "TEST", "Hello %s!", "World"); | |
3554 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST LChanPeon Hello World!" CRLF, local_chan_v, MSG); | |
3555 | is_client_sendq_empty(local_chan_p, MSG); | |
3556 | is_client_sendq_empty(server, MSG); | |
3557 | ||
3558 | sendto_anywhere_echo(&me, local_chan_v, "TEST", "Hello %s!", "World"); | |
3559 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST " TEST_ME_NAME " Hello World!" CRLF, local_chan_v, MSG); | |
3560 | is_client_sendq_empty(server, MSG); | |
3561 | ||
3562 | sendto_anywhere_echo(remote, local_chan_v, "TEST", "Hello %s!", "World"); | |
3563 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST " TEST_REMOTE_NICK " Hello World!" CRLF, local_chan_v, MSG); | |
3564 | is_client_sendq_empty(server, MSG); | |
3565 | ||
3566 | sendto_anywhere_echo(server, local_chan_v, "TEST", "Hello %s!", "World"); | |
3567 | is_client_sendq("@account=test_v :LChanVoice" TEST_ID_SUFFIX " TEST " TEST_SERVER_NAME " Hello World!" CRLF, local_chan_v, MSG); | |
3568 | is_client_sendq_empty(server, MSG); | |
3569 | ||
3570 | ||
3571 | sendto_anywhere_echo(local_chan_p, local_chan_p, "TEST", "Hello %s!", "World"); | |
3572 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST LChanPeon Hello World!" CRLF, local_chan_p, MSG); | |
3573 | is_client_sendq_empty(server, MSG); | |
3574 | ||
3575 | sendto_anywhere_echo(user, local_chan_p, "TEST", "Hello %s!", "World"); | |
3576 | is_client_sendq_empty(user, MSG); | |
3577 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_NICK " Hello World!" CRLF, local_chan_p, MSG); | |
3578 | is_client_sendq_empty(server, MSG); | |
3579 | ||
3580 | sendto_anywhere_echo(&me, local_chan_p, "TEST", "Hello %s!", "World"); | |
3581 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_ME_NAME " Hello World!" CRLF, local_chan_p, MSG); | |
3582 | is_client_sendq_empty(server, MSG); | |
3583 | ||
3584 | sendto_anywhere_echo(remote, local_chan_p, "TEST", "Hello %s!", "World"); | |
3585 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_REMOTE_NICK " Hello World!" CRLF, local_chan_p, MSG); | |
3586 | is_client_sendq_empty(server, MSG); | |
3587 | ||
3588 | sendto_anywhere_echo(server, local_chan_p, "TEST", "Hello %s!", "World"); | |
3589 | is_client_sendq(":LChanPeon" TEST_ID_SUFFIX " TEST " TEST_SERVER_NAME " Hello World!" CRLF, local_chan_p, MSG); | |
3590 | is_client_sendq_empty(server, MSG); | |
3591 | ||
3592 | standard_free(); | |
3593 | } | |
3594 | ||
3595 | static void sendto_match_servs1(void) | |
3596 | { | |
3597 | standard_init(); | |
3598 | ||
3599 | server->localClient->caps = CAP_ENCAP; | |
3600 | server2->localClient->caps = CAP_ENCAP; | |
3601 | server2->localClient->caps |= CAP_KNOCK; | |
3602 | server3->localClient->caps = CAP_BAN; | |
3603 | ||
3604 | // This function does not support TS5... | |
3605 | standard_ids(); | |
3606 | ||
3607 | // Match all | |
3608 | sendto_match_servs(&me, "*.test", 0, 0, "Hello %s!", "World"); | |
3609 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3610 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3611 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server3, MSG); | |
3612 | ||
3613 | sendto_match_servs(user, "*.test", 0, 0, "Hello %s!", "World"); | |
3614 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3615 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3616 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server3, MSG); | |
3617 | ||
3618 | sendto_match_servs(remote, "*.test", 0, 0, "Hello %s!", "World"); | |
3619 | is_client_sendq_empty(server, MSG); | |
3620 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3621 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server3, MSG); | |
3622 | ||
3623 | sendto_match_servs(server, "*.test", 0, 0, "Hello %s!", "World"); | |
3624 | is_client_sendq_empty(server, MSG); | |
3625 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3626 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server3, MSG); | |
3627 | ||
3628 | // Match all, CAP_ENCAP but not CAP_KNOCK | |
3629 | sendto_match_servs(&me, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3630 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3631 | is_client_sendq_empty(server2, MSG); | |
3632 | is_client_sendq_empty(server3, MSG); | |
3633 | ||
3634 | sendto_match_servs(user, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3635 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3636 | is_client_sendq_empty(server2, MSG); | |
3637 | is_client_sendq_empty(server3, MSG); | |
3638 | ||
3639 | sendto_match_servs(remote, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3640 | is_client_sendq_empty(server, MSG); | |
3641 | is_client_sendq_empty(server2, MSG); | |
3642 | is_client_sendq_empty(server3, MSG); | |
3643 | ||
3644 | sendto_match_servs(server, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3645 | is_client_sendq_empty(server, MSG); | |
3646 | is_client_sendq_empty(server2, MSG); | |
3647 | is_client_sendq_empty(server3, MSG); | |
3648 | ||
3649 | // Match all, but not CAP_BAN | |
3650 | sendto_match_servs(&me, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3651 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3652 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3653 | is_client_sendq_empty(server3, MSG); | |
3654 | ||
3655 | sendto_match_servs(user, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3656 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3657 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3658 | is_client_sendq_empty(server3, MSG); | |
3659 | ||
3660 | sendto_match_servs(remote, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3661 | is_client_sendq_empty(server, MSG); | |
3662 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3663 | is_client_sendq_empty(server3, MSG); | |
3664 | ||
3665 | sendto_match_servs(server, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3666 | is_client_sendq_empty(server, MSG); | |
3667 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3668 | is_client_sendq_empty(server3, MSG); | |
3669 | ||
3670 | // Match all, CAP_BAN but not CAP_KNOCK | |
3671 | sendto_match_servs(&me, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3672 | is_client_sendq_empty(server, MSG); | |
3673 | is_client_sendq_empty(server2, MSG); | |
3674 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server3, MSG); | |
3675 | ||
3676 | sendto_match_servs(user, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3677 | is_client_sendq_empty(server, MSG); | |
3678 | is_client_sendq_empty(server2, MSG); | |
3679 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server3, MSG); | |
3680 | ||
3681 | sendto_match_servs(remote, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3682 | is_client_sendq_empty(server, MSG); | |
3683 | is_client_sendq_empty(server2, MSG); | |
3684 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server3, MSG); | |
3685 | ||
3686 | sendto_match_servs(server, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3687 | is_client_sendq_empty(server, MSG); | |
3688 | is_client_sendq_empty(server2, MSG); | |
3689 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server3, MSG); | |
3690 | ||
3691 | // Match all, CAP_KNOCK | |
3692 | sendto_match_servs(&me, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3693 | is_client_sendq_empty(server, MSG); | |
3694 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3695 | is_client_sendq_empty(server3, MSG); | |
3696 | ||
3697 | sendto_match_servs(user, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3698 | is_client_sendq_empty(server, MSG); | |
3699 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3700 | is_client_sendq_empty(server3, MSG); | |
3701 | ||
3702 | sendto_match_servs(remote, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3703 | is_client_sendq_empty(server, MSG); | |
3704 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3705 | is_client_sendq_empty(server3, MSG); | |
3706 | ||
3707 | sendto_match_servs(server, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3708 | is_client_sendq_empty(server, MSG); | |
3709 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3710 | is_client_sendq_empty(server3, MSG); | |
3711 | ||
3712 | // Match none | |
3713 | sendto_match_servs(&me, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3714 | is_client_sendq_empty(server, MSG); | |
3715 | is_client_sendq_empty(server2, MSG); | |
3716 | is_client_sendq_empty(server3, MSG); | |
3717 | ||
3718 | sendto_match_servs(user, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3719 | is_client_sendq_empty(server, MSG); | |
3720 | is_client_sendq_empty(server2, MSG); | |
3721 | is_client_sendq_empty(server3, MSG); | |
3722 | ||
3723 | sendto_match_servs(remote, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3724 | is_client_sendq_empty(server, MSG); | |
3725 | is_client_sendq_empty(server2, MSG); | |
3726 | is_client_sendq_empty(server3, MSG); | |
3727 | ||
3728 | sendto_match_servs(server, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3729 | is_client_sendq_empty(server, MSG); | |
3730 | is_client_sendq_empty(server2, MSG); | |
3731 | is_client_sendq_empty(server3, MSG); | |
3732 | ||
3733 | standard_free(); | |
3734 | } | |
3735 | ||
3736 | static void sendto_match_servs1__tags(void) | |
3737 | { | |
3738 | standard_init(); | |
3739 | ||
3740 | strcpy(user->user->suser, "test"); | |
3741 | strcpy(remote->user->suser, "rtest"); | |
3742 | user->localClient->caps |= CAP_ACCOUNT_TAG; | |
3743 | user->localClient->caps |= CAP_SERVER_TIME; | |
3744 | ||
3745 | server->localClient->caps = CAP_ENCAP; | |
3746 | server2->localClient->caps = CAP_ENCAP; | |
3747 | server2->localClient->caps |= CAP_KNOCK; | |
3748 | server3->localClient->caps = CAP_BAN; | |
3749 | ||
3750 | // This function does not support TS5... | |
3751 | standard_ids(); | |
3752 | ||
3753 | // Match all | |
3754 | sendto_match_servs(&me, "*.test", 0, 0, "Hello %s!", "World"); | |
3755 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3756 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3757 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server3, MSG); | |
3758 | ||
3759 | sendto_match_servs(user, "*.test", 0, 0, "Hello %s!", "World"); | |
3760 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3761 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3762 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server3, MSG); | |
3763 | ||
3764 | sendto_match_servs(remote, "*.test", 0, 0, "Hello %s!", "World"); | |
3765 | is_client_sendq_empty(server, MSG); | |
3766 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3767 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server3, MSG); | |
3768 | ||
3769 | sendto_match_servs(server, "*.test", 0, 0, "Hello %s!", "World"); | |
3770 | is_client_sendq_empty(server, MSG); | |
3771 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3772 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server3, MSG); | |
3773 | ||
3774 | // Match all, CAP_ENCAP but not CAP_KNOCK | |
3775 | sendto_match_servs(&me, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3776 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3777 | is_client_sendq_empty(server2, MSG); | |
3778 | is_client_sendq_empty(server3, MSG); | |
3779 | ||
3780 | sendto_match_servs(user, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3781 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3782 | is_client_sendq_empty(server2, MSG); | |
3783 | is_client_sendq_empty(server3, MSG); | |
3784 | ||
3785 | sendto_match_servs(remote, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3786 | is_client_sendq_empty(server, MSG); | |
3787 | is_client_sendq_empty(server2, MSG); | |
3788 | is_client_sendq_empty(server3, MSG); | |
3789 | ||
3790 | sendto_match_servs(server, "*.test", CAP_ENCAP, CAP_KNOCK, "Hello %s!", "World"); | |
3791 | is_client_sendq_empty(server, MSG); | |
3792 | is_client_sendq_empty(server2, MSG); | |
3793 | is_client_sendq_empty(server3, MSG); | |
3794 | ||
3795 | // Match all, but not CAP_BAN | |
3796 | sendto_match_servs(&me, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3797 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server, MSG); | |
3798 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3799 | is_client_sendq_empty(server3, MSG); | |
3800 | ||
3801 | sendto_match_servs(user, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3802 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server, MSG); | |
3803 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3804 | is_client_sendq_empty(server3, MSG); | |
3805 | ||
3806 | sendto_match_servs(remote, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3807 | is_client_sendq_empty(server, MSG); | |
3808 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3809 | is_client_sendq_empty(server3, MSG); | |
3810 | ||
3811 | sendto_match_servs(server, "*.test", 0, CAP_BAN, "Hello %s!", "World"); | |
3812 | is_client_sendq_empty(server, MSG); | |
3813 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3814 | is_client_sendq_empty(server3, MSG); | |
3815 | ||
3816 | // Match all, CAP_BAN but not CAP_KNOCK | |
3817 | sendto_match_servs(&me, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3818 | is_client_sendq_empty(server, MSG); | |
3819 | is_client_sendq_empty(server2, MSG); | |
3820 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server3, MSG); | |
3821 | ||
3822 | sendto_match_servs(user, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3823 | is_client_sendq_empty(server, MSG); | |
3824 | is_client_sendq_empty(server2, MSG); | |
3825 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server3, MSG); | |
3826 | ||
3827 | sendto_match_servs(remote, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3828 | is_client_sendq_empty(server, MSG); | |
3829 | is_client_sendq_empty(server2, MSG); | |
3830 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server3, MSG); | |
3831 | ||
3832 | sendto_match_servs(server, "*.test", CAP_BAN, CAP_KNOCK, "Hello %s!", "World"); | |
3833 | is_client_sendq_empty(server, MSG); | |
3834 | is_client_sendq_empty(server2, MSG); | |
3835 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server3, MSG); | |
3836 | ||
3837 | // Match all, CAP_KNOCK | |
3838 | sendto_match_servs(&me, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3839 | is_client_sendq_empty(server, MSG); | |
3840 | is_client_sendq(":" TEST_ME_ID " Hello World!" CRLF, server2, MSG); | |
3841 | is_client_sendq_empty(server3, MSG); | |
3842 | ||
3843 | sendto_match_servs(user, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3844 | is_client_sendq_empty(server, MSG); | |
3845 | is_client_sendq(":" TEST_ID " Hello World!" CRLF, server2, MSG); | |
3846 | is_client_sendq_empty(server3, MSG); | |
3847 | ||
3848 | sendto_match_servs(remote, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3849 | is_client_sendq_empty(server, MSG); | |
3850 | is_client_sendq(":" TEST_REMOTE_ID " Hello World!" CRLF, server2, MSG); | |
3851 | is_client_sendq_empty(server3, MSG); | |
3852 | ||
3853 | sendto_match_servs(server, "*.test", CAP_KNOCK, 0, "Hello %s!", "World"); | |
3854 | is_client_sendq_empty(server, MSG); | |
3855 | is_client_sendq(":" TEST_SERVER_ID " Hello World!" CRLF, server2, MSG); | |
3856 | is_client_sendq_empty(server3, MSG); | |
3857 | ||
3858 | // Match none | |
3859 | sendto_match_servs(&me, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3860 | is_client_sendq_empty(server, MSG); | |
3861 | is_client_sendq_empty(server2, MSG); | |
3862 | is_client_sendq_empty(server3, MSG); | |
3863 | ||
3864 | sendto_match_servs(user, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3865 | is_client_sendq_empty(server, MSG); | |
3866 | is_client_sendq_empty(server2, MSG); | |
3867 | is_client_sendq_empty(server3, MSG); | |
3868 | ||
3869 | sendto_match_servs(remote, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3870 | is_client_sendq_empty(server, MSG); | |
3871 | is_client_sendq_empty(server2, MSG); | |
3872 | is_client_sendq_empty(server3, MSG); | |
3873 | ||
3874 | sendto_match_servs(server, "*.invalid", 0, 0, "Hello %s!", "World"); | |
3875 | is_client_sendq_empty(server, MSG); | |
3876 | is_client_sendq_empty(server2, MSG); | |
3877 | is_client_sendq_empty(server3, MSG); | |
3878 | ||
3879 | standard_free(); | |
3880 | } | |
3881 | ||
3882 | static void sendto_realops_snomask1(void) | |
3883 | { | |
3884 | struct Client *oper1 = make_local_person_nick("oper1"); | |
3885 | struct Client *oper2 = make_local_person_nick("oper2"); | |
3886 | struct Client *oper3 = make_local_person_nick("oper3"); | |
3887 | struct Client *oper4 = make_local_person_nick("oper4"); | |
3888 | ||
3889 | standard_init(); | |
3890 | ||
3891 | make_local_person_oper(oper1); | |
3892 | make_local_person_oper(oper2); | |
3893 | make_local_person_oper(oper3); | |
3894 | make_local_person_oper(oper4); | |
3895 | ||
3896 | oper1->snomask = SNO_BOTS | SNO_SKILL; | |
3897 | oper2->snomask = SNO_GENERAL | SNO_REJ; | |
3898 | oper3->snomask = SNO_BOTS | SNO_SKILL; | |
3899 | oper4->snomask = SNO_GENERAL | SNO_REJ; | |
3900 | ||
3901 | oper3->user->privset = privilegeset_get("admin"); | |
3902 | oper4->user->privset = privilegeset_get("admin"); | |
3903 | ||
3904 | server->localClient->caps = CAP_ENCAP | CAP_TS6; | |
3905 | server2->localClient->caps = 0; | |
3906 | ||
3907 | ConfigFileEntry.global_snotices = 0; | |
3908 | remote_rehash_oper_p = NULL; | |
3909 | ||
3910 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
3911 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
3912 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3913 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
3914 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3915 | is_client_sendq_empty(server, MSG); | |
3916 | ||
3917 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
3918 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
3919 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3920 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
3921 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3922 | is_client_sendq_empty(server, MSG); | |
3923 | ||
3924 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
3925 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
3926 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3927 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
3928 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3929 | is_client_sendq_empty(server, MSG); | |
3930 | ||
3931 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
3932 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3933 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
3934 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3935 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
3936 | is_client_sendq_empty(server, MSG); | |
3937 | ||
3938 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
3939 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3940 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
3941 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3942 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
3943 | is_client_sendq_empty(server, MSG); | |
3944 | ||
3945 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
3946 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3947 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
3948 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3949 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
3950 | is_client_sendq_empty(server, MSG); | |
3951 | ||
3952 | remote_rehash_oper_p = remote; | |
3953 | ||
3954 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
3955 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
3956 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3957 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
3958 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3959 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3960 | ||
3961 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
3962 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
3963 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3964 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
3965 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3966 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3967 | ||
3968 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
3969 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
3970 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
3971 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
3972 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
3973 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3974 | ||
3975 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
3976 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3977 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
3978 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3979 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
3980 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3981 | ||
3982 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
3983 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3984 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
3985 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3986 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
3987 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3988 | ||
3989 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
3990 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
3991 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
3992 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
3993 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
3994 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
3995 | ||
3996 | standard_ids(); | |
3997 | ||
3998 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
3999 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4000 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4001 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4002 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4003 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4004 | ||
4005 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
4006 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4007 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4008 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4009 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4010 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4011 | ||
4012 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
4013 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4014 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4015 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4016 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4017 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4018 | ||
4019 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
4020 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4021 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4022 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4023 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4024 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4025 | ||
4026 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
4027 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4028 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4029 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4030 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4031 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4032 | ||
4033 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
4034 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4035 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4036 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4037 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4038 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4039 | ||
4040 | // This feature does not support TS5... | |
4041 | ConfigFileEntry.global_snotices = 1; | |
4042 | ||
4043 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_ALL, "Hello %s!", "World"); | |
4044 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4045 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4046 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4047 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4048 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4049 | is_client_sendq_empty(server2, MSG); | |
4050 | ||
4051 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_ADMIN, "Hello %s!", "World"); | |
4052 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4053 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4054 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4055 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4056 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4057 | is_client_sendq_empty(server2, MSG); | |
4058 | ||
4059 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_OPER, "Hello %s!", "World"); | |
4060 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4061 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4062 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4063 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4064 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4065 | is_client_sendq_empty(server2, MSG); | |
4066 | ||
4067 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_ALL, "Hello %s!", "World"); | |
4068 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4069 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4070 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4071 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4072 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4073 | is_client_sendq_empty(server2, MSG); | |
4074 | ||
4075 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_ADMIN, "Hello %s!", "World"); | |
4076 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4077 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4078 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4079 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4080 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4081 | is_client_sendq_empty(server2, MSG); | |
4082 | ||
4083 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_OPER, "Hello %s!", "World"); | |
4084 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4085 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4086 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4087 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4088 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4089 | is_client_sendq_empty(server2, MSG); | |
4090 | ||
4091 | remove_local_person(oper1); | |
4092 | remove_local_person(oper2); | |
4093 | remove_local_person(oper3); | |
4094 | remove_local_person(oper4); | |
4095 | ||
4096 | standard_free(); | |
4097 | } | |
4098 | ||
4099 | static void sendto_realops_snomask1__tags(void) | |
4100 | { | |
4101 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4102 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4103 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4104 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4105 | ||
4106 | standard_init(); | |
4107 | ||
4108 | strcpy(oper1->user->suser, "test1"); | |
4109 | strcpy(oper2->user->suser, "test2"); | |
4110 | strcpy(oper3->user->suser, "test3"); | |
4111 | strcpy(oper4->user->suser, "test4"); | |
4112 | ||
4113 | oper1->localClient->caps |= CAP_ACCOUNT_TAG; | |
4114 | oper1->localClient->caps |= CAP_SERVER_TIME; | |
4115 | oper2->localClient->caps |= CAP_SERVER_TIME; | |
4116 | oper3->localClient->caps |= CAP_ACCOUNT_TAG; | |
4117 | ||
4118 | make_local_person_oper(oper1); | |
4119 | make_local_person_oper(oper2); | |
4120 | make_local_person_oper(oper3); | |
4121 | make_local_person_oper(oper4); | |
4122 | ||
4123 | oper1->snomask = SNO_BOTS | SNO_SKILL; | |
4124 | oper2->snomask = SNO_GENERAL | SNO_REJ; | |
4125 | oper3->snomask = SNO_BOTS | SNO_SKILL; | |
4126 | oper4->snomask = SNO_GENERAL | SNO_REJ; | |
4127 | ||
4128 | oper3->user->privset = privilegeset_get("admin"); | |
4129 | oper4->user->privset = privilegeset_get("admin"); | |
4130 | ||
4131 | server->localClient->caps = CAP_ENCAP | CAP_TS6; | |
4132 | server2->localClient->caps = 0; | |
4133 | ||
4134 | ConfigFileEntry.global_snotices = 0; | |
4135 | remote_rehash_oper_p = NULL; | |
4136 | ||
4137 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
4138 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4139 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4140 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4141 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4142 | is_client_sendq_empty(server, MSG); | |
4143 | ||
4144 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
4145 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4146 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4147 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4148 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4149 | is_client_sendq_empty(server, MSG); | |
4150 | ||
4151 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
4152 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4153 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4154 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4155 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4156 | is_client_sendq_empty(server, MSG); | |
4157 | ||
4158 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
4159 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4160 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4161 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4162 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4163 | is_client_sendq_empty(server, MSG); | |
4164 | ||
4165 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
4166 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4167 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4168 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4169 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4170 | is_client_sendq_empty(server, MSG); | |
4171 | ||
4172 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
4173 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4174 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4175 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4176 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4177 | is_client_sendq_empty(server, MSG); | |
4178 | ||
4179 | remote_rehash_oper_p = remote; | |
4180 | ||
4181 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
4182 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4183 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4184 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4185 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4186 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4187 | ||
4188 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
4189 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4190 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4191 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4192 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4193 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4194 | ||
4195 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
4196 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4197 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4198 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4199 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4200 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4201 | ||
4202 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
4203 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4204 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4205 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4206 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4207 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4208 | ||
4209 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
4210 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4211 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4212 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4213 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4214 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4215 | ||
4216 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
4217 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4218 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4219 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4220 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4221 | is_client_sendq(":" TEST_ME_NAME " NOTICE " TEST_REMOTE_NICK " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4222 | ||
4223 | standard_ids(); | |
4224 | ||
4225 | sendto_realops_snomask(SNO_BOTS, L_ALL, "Hello %s!", "World"); | |
4226 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4227 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4228 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4229 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4230 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4231 | ||
4232 | sendto_realops_snomask(SNO_BOTS, L_ADMIN, "Hello %s!", "World"); | |
4233 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4234 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4235 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4236 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4237 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4238 | ||
4239 | sendto_realops_snomask(SNO_BOTS, L_OPER, "Hello %s!", "World"); | |
4240 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4241 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4242 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4243 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4244 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4245 | ||
4246 | sendto_realops_snomask(SNO_GENERAL, L_ALL, "Hello %s!", "World"); | |
4247 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4248 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4249 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4250 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4251 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4252 | ||
4253 | sendto_realops_snomask(SNO_GENERAL, L_ADMIN, "Hello %s!", "World"); | |
4254 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4255 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4256 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4257 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4258 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4259 | ||
4260 | sendto_realops_snomask(SNO_GENERAL, L_OPER, "Hello %s!", "World"); | |
4261 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4262 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4263 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4264 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4265 | is_client_sendq(":" TEST_ME_ID " NOTICE " TEST_REMOTE_ID " :*** Notice -- Hello World!" CRLF, server, MSG); | |
4266 | ||
4267 | // This feature does not support TS5... | |
4268 | ConfigFileEntry.global_snotices = 1; | |
4269 | ||
4270 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_ALL, "Hello %s!", "World"); | |
4271 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4272 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4273 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4274 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4275 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4276 | is_client_sendq_empty(server2, MSG); | |
4277 | ||
4278 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_ADMIN, "Hello %s!", "World"); | |
4279 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4280 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4281 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4282 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4283 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4284 | is_client_sendq_empty(server2, MSG); | |
4285 | ||
4286 | sendto_realops_snomask(SNO_BOTS, L_NETWIDE | L_OPER, "Hello %s!", "World"); | |
4287 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4288 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4289 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4290 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4291 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE b :Hello World!" CRLF, server, MSG); | |
4292 | is_client_sendq_empty(server2, MSG); | |
4293 | ||
4294 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_ALL, "Hello %s!", "World"); | |
4295 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4296 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4297 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4298 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4299 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4300 | is_client_sendq_empty(server2, MSG); | |
4301 | ||
4302 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_ADMIN, "Hello %s!", "World"); | |
4303 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4304 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4305 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4306 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4307 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4308 | is_client_sendq_empty(server2, MSG); | |
4309 | ||
4310 | sendto_realops_snomask(SNO_GENERAL, L_NETWIDE | L_OPER, "Hello %s!", "World"); | |
4311 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4312 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4313 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4314 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4315 | is_client_sendq(":" TEST_ME_ID " ENCAP * SNOTE s :Hello World!" CRLF, server, MSG); | |
4316 | is_client_sendq_empty(server2, MSG); | |
4317 | ||
4318 | remove_local_person(oper1); | |
4319 | remove_local_person(oper2); | |
4320 | remove_local_person(oper3); | |
4321 | remove_local_person(oper4); | |
4322 | ||
4323 | standard_free(); | |
4324 | } | |
4325 | ||
4326 | static void sendto_realops_snomask_from1(void) | |
4327 | { | |
4328 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4329 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4330 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4331 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4332 | ||
4333 | make_local_person_oper(oper1); | |
4334 | make_local_person_oper(oper2); | |
4335 | make_local_person_oper(oper3); | |
4336 | make_local_person_oper(oper4); | |
4337 | ||
4338 | oper1->snomask = SNO_BOTS | SNO_SKILL; | |
4339 | oper2->snomask = SNO_GENERAL | SNO_REJ; | |
4340 | oper3->snomask = SNO_BOTS | SNO_SKILL; | |
4341 | oper4->snomask = SNO_GENERAL | SNO_REJ; | |
4342 | ||
4343 | oper3->user->privset = privilegeset_get("admin"); | |
4344 | oper4->user->privset = privilegeset_get("admin"); | |
4345 | ||
4346 | sendto_realops_snomask_from(SNO_BOTS, L_ALL, &me, "Hello %s!", "World"); | |
4347 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4348 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4349 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4350 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4351 | is_client_sendq_empty(server, MSG); | |
4352 | ||
4353 | sendto_realops_snomask_from(SNO_BOTS, L_ADMIN, &me, "Hello %s!", "World"); | |
4354 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4355 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4356 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4357 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4358 | is_client_sendq_empty(server, MSG); | |
4359 | ||
4360 | sendto_realops_snomask_from(SNO_BOTS, L_OPER, &me, "Hello %s!", "World"); | |
4361 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4362 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4363 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4364 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4365 | is_client_sendq_empty(server, MSG); | |
4366 | ||
4367 | sendto_realops_snomask_from(SNO_BOTS, L_ALL, server, "Hello %s!", "World"); | |
4368 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4369 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4370 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4371 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4372 | is_client_sendq_empty(server, MSG); | |
4373 | ||
4374 | sendto_realops_snomask_from(SNO_BOTS, L_ADMIN, server, "Hello %s!", "World"); | |
4375 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4376 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4377 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4378 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4379 | is_client_sendq_empty(server, MSG); | |
4380 | ||
4381 | sendto_realops_snomask_from(SNO_BOTS, L_OPER, server, "Hello %s!", "World"); | |
4382 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4383 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4384 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4385 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4386 | is_client_sendq_empty(server, MSG); | |
4387 | ||
4388 | sendto_realops_snomask_from(SNO_GENERAL, L_ALL, &me, "Hello %s!", "World"); | |
4389 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4390 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4391 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4392 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4393 | is_client_sendq_empty(server, MSG); | |
4394 | ||
4395 | sendto_realops_snomask_from(SNO_GENERAL, L_ADMIN, &me, "Hello %s!", "World"); | |
4396 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4397 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4398 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4399 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4400 | is_client_sendq_empty(server, MSG); | |
4401 | ||
4402 | sendto_realops_snomask_from(SNO_GENERAL, L_OPER, &me, "Hello %s!", "World"); | |
4403 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4404 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4405 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4406 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4407 | is_client_sendq_empty(server, MSG); | |
4408 | ||
4409 | sendto_realops_snomask_from(SNO_GENERAL, L_ALL, server, "Hello %s!", "World"); | |
4410 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4411 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4412 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4413 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4414 | is_client_sendq_empty(server, MSG); | |
4415 | ||
4416 | sendto_realops_snomask_from(SNO_GENERAL, L_ADMIN, server, "Hello %s!", "World"); | |
4417 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4418 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4419 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4420 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4421 | is_client_sendq_empty(server, MSG); | |
4422 | ||
4423 | sendto_realops_snomask_from(SNO_GENERAL, L_OPER, server, "Hello %s!", "World"); | |
4424 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4425 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4426 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4427 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4428 | is_client_sendq_empty(server, MSG); | |
4429 | ||
4430 | remove_local_person(oper1); | |
4431 | remove_local_person(oper2); | |
4432 | remove_local_person(oper3); | |
4433 | remove_local_person(oper4); | |
4434 | } | |
4435 | ||
4436 | static void sendto_realops_snomask_from1__tags(void) | |
4437 | { | |
4438 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4439 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4440 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4441 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4442 | ||
4443 | strcpy(oper1->user->suser, "test1"); | |
4444 | strcpy(oper2->user->suser, "test2"); | |
4445 | strcpy(oper3->user->suser, "test3"); | |
4446 | strcpy(oper4->user->suser, "test4"); | |
4447 | ||
4448 | oper1->localClient->caps |= CAP_ACCOUNT_TAG; | |
4449 | oper1->localClient->caps |= CAP_SERVER_TIME; | |
4450 | oper2->localClient->caps |= CAP_SERVER_TIME; | |
4451 | oper3->localClient->caps |= CAP_ACCOUNT_TAG; | |
4452 | ||
4453 | make_local_person_oper(oper1); | |
4454 | make_local_person_oper(oper2); | |
4455 | make_local_person_oper(oper3); | |
4456 | make_local_person_oper(oper4); | |
4457 | ||
4458 | oper1->snomask = SNO_BOTS | SNO_SKILL; | |
4459 | oper2->snomask = SNO_GENERAL | SNO_REJ; | |
4460 | oper3->snomask = SNO_BOTS | SNO_SKILL; | |
4461 | oper4->snomask = SNO_GENERAL | SNO_REJ; | |
4462 | ||
4463 | oper3->user->privset = privilegeset_get("admin"); | |
4464 | oper4->user->privset = privilegeset_get("admin"); | |
4465 | ||
4466 | sendto_realops_snomask_from(SNO_BOTS, L_ALL, &me, "Hello %s!", "World"); | |
4467 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4468 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4469 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4470 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4471 | is_client_sendq_empty(server, MSG); | |
4472 | ||
4473 | sendto_realops_snomask_from(SNO_BOTS, L_ADMIN, &me, "Hello %s!", "World"); | |
4474 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4475 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4476 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4477 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4478 | is_client_sendq_empty(server, MSG); | |
4479 | ||
4480 | sendto_realops_snomask_from(SNO_BOTS, L_OPER, &me, "Hello %s!", "World"); | |
4481 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4482 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4483 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4484 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4485 | is_client_sendq_empty(server, MSG); | |
4486 | ||
4487 | sendto_realops_snomask_from(SNO_BOTS, L_ALL, server, "Hello %s!", "World"); | |
4488 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4489 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4490 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4491 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4492 | is_client_sendq_empty(server, MSG); | |
4493 | ||
4494 | sendto_realops_snomask_from(SNO_BOTS, L_ADMIN, server, "Hello %s!", "World"); | |
4495 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4496 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4497 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper3, "Matches mask; " MSG); | |
4498 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4499 | is_client_sendq_empty(server, MSG); | |
4500 | ||
4501 | sendto_realops_snomask_from(SNO_BOTS, L_OPER, server, "Hello %s!", "World"); | |
4502 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper1, "Matches mask; " MSG); | |
4503 | is_client_sendq_empty(oper2, "Doesn't match mask; " MSG); | |
4504 | is_client_sendq_empty(oper3, "Not an oper; " MSG); | |
4505 | is_client_sendq_empty(oper4, "Doesn't match mask; " MSG); | |
4506 | is_client_sendq_empty(server, MSG); | |
4507 | ||
4508 | sendto_realops_snomask_from(SNO_GENERAL, L_ALL, &me, "Hello %s!", "World"); | |
4509 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4510 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4511 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4512 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4513 | is_client_sendq_empty(server, MSG); | |
4514 | ||
4515 | sendto_realops_snomask_from(SNO_GENERAL, L_ADMIN, &me, "Hello %s!", "World"); | |
4516 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4517 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4518 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4519 | is_client_sendq(":" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4520 | is_client_sendq_empty(server, MSG); | |
4521 | ||
4522 | sendto_realops_snomask_from(SNO_GENERAL, L_OPER, &me, "Hello %s!", "World"); | |
4523 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4524 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4525 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4526 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4527 | is_client_sendq_empty(server, MSG); | |
4528 | ||
4529 | sendto_realops_snomask_from(SNO_GENERAL, L_ALL, server, "Hello %s!", "World"); | |
4530 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4531 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4532 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4533 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4534 | is_client_sendq_empty(server, MSG); | |
4535 | ||
4536 | sendto_realops_snomask_from(SNO_GENERAL, L_ADMIN, server, "Hello %s!", "World"); | |
4537 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4538 | is_client_sendq_empty(oper2, "Not an admin; " MSG); | |
4539 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4540 | is_client_sendq(":" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper4, "Matches mask; " MSG); | |
4541 | is_client_sendq_empty(server, MSG); | |
4542 | ||
4543 | sendto_realops_snomask_from(SNO_GENERAL, L_OPER, server, "Hello %s!", "World"); | |
4544 | is_client_sendq_empty(oper1, "Doesn't match mask; " MSG); | |
4545 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_SERVER_NAME " NOTICE * :*** Notice -- Hello World!" CRLF, oper2, "Matches mask; " MSG); | |
4546 | is_client_sendq_empty(oper3, "Doesn't match mask; " MSG); | |
4547 | is_client_sendq_empty(oper4, "Not an oper; " MSG); | |
4548 | is_client_sendq_empty(server, MSG); | |
4549 | ||
4550 | remove_local_person(oper1); | |
4551 | remove_local_person(oper2); | |
4552 | remove_local_person(oper3); | |
4553 | remove_local_person(oper4); | |
4554 | } | |
4555 | ||
4556 | static void sendto_wallops_flags1(void) | |
4557 | { | |
4558 | struct Client *user1 = make_local_person_nick("user1"); | |
4559 | struct Client *user2 = make_local_person_nick("user2"); | |
4560 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4561 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4562 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4563 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4564 | ||
4565 | make_local_person_oper(oper1); | |
4566 | make_local_person_oper(oper2); | |
4567 | make_local_person_oper(oper3); | |
4568 | make_local_person_oper(oper4); | |
4569 | ||
4570 | user1->umodes |= UMODE_WALLOP; | |
4571 | oper1->umodes |= UMODE_WALLOP | UMODE_OPERWALL; | |
4572 | oper2->umodes |= UMODE_WALLOP | UMODE_OPERWALL | UMODE_ADMIN; | |
4573 | oper3->umodes |= UMODE_WALLOP; | |
4574 | oper4->umodes |= UMODE_OPERWALL; | |
4575 | ||
4576 | sendto_wallops_flags(UMODE_WALLOP, oper1, "Test to users"); | |
4577 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, user1, "User is +w; " MSG); | |
4578 | is_client_sendq_empty(user2, "User is -w; " MSG); | |
4579 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper1, "User is +w; " MSG); | |
4580 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper2, "User is +w; " MSG); | |
4581 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper3, "User is +w; " MSG); | |
4582 | is_client_sendq_empty(oper4, "User is -w; " MSG); | |
4583 | is_client_sendq_empty(server, MSG); | |
4584 | ||
4585 | sendto_wallops_flags(UMODE_OPERWALL, oper2, "Test to opers"); | |
4586 | is_client_sendq_empty(user1, "Not an oper; " MSG); | |
4587 | is_client_sendq_empty(user2, "Not an oper; " MSG); | |
4588 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper1, "Oper is +z; " MSG); | |
4589 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper2, "Oper is +z; " MSG); | |
4590 | is_client_sendq_empty(oper3, "Oper is -z; " MSG); | |
4591 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper4, "Oper is +z; " MSG); | |
4592 | is_client_sendq_empty(server, MSG); | |
4593 | ||
4594 | sendto_wallops_flags(UMODE_ADMIN, &me, "Test to admins"); | |
4595 | is_client_sendq_empty(user1, "Not an admin; " MSG); | |
4596 | is_client_sendq_empty(user2, "Not an admin; " MSG); | |
4597 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4598 | is_client_sendq(":" TEST_ME_NAME " WALLOPS :Test to admins" CRLF, oper2, MSG); | |
4599 | is_client_sendq_empty(oper3, "Not an admin; " MSG); | |
4600 | is_client_sendq_empty(oper4, "Not an admin; " MSG); | |
4601 | is_client_sendq_empty(server, MSG); | |
4602 | ||
4603 | remove_local_person(user1); | |
4604 | remove_local_person(user2); | |
4605 | remove_local_person(oper1); | |
4606 | remove_local_person(oper2); | |
4607 | remove_local_person(oper3); | |
4608 | remove_local_person(oper4); | |
4609 | } | |
4610 | ||
4611 | static void sendto_wallops_flags1__tags(void) | |
4612 | { | |
4613 | struct Client *user1 = make_local_person_nick("user1"); | |
4614 | struct Client *user2 = make_local_person_nick("user2"); | |
4615 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4616 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4617 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4618 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4619 | ||
4620 | strcpy(oper1->user->suser, "test1"); | |
4621 | strcpy(oper2->user->suser, "test2"); | |
4622 | strcpy(oper3->user->suser, "test3"); | |
4623 | strcpy(oper4->user->suser, "test4"); | |
4624 | ||
4625 | oper1->localClient->caps |= CAP_ACCOUNT_TAG; | |
4626 | oper1->localClient->caps |= CAP_SERVER_TIME; | |
4627 | oper2->localClient->caps |= CAP_SERVER_TIME; | |
4628 | oper3->localClient->caps |= CAP_ACCOUNT_TAG; | |
4629 | ||
4630 | make_local_person_oper(oper1); | |
4631 | make_local_person_oper(oper2); | |
4632 | make_local_person_oper(oper3); | |
4633 | make_local_person_oper(oper4); | |
4634 | ||
4635 | user1->umodes |= UMODE_WALLOP; | |
4636 | oper1->umodes |= UMODE_WALLOP | UMODE_OPERWALL; | |
4637 | oper2->umodes |= UMODE_WALLOP | UMODE_OPERWALL | UMODE_ADMIN; | |
4638 | oper3->umodes |= UMODE_WALLOP; | |
4639 | oper4->umodes |= UMODE_OPERWALL; | |
4640 | ||
4641 | sendto_wallops_flags(UMODE_WALLOP, oper1, "Test to users"); | |
4642 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, user1, "User is +w; " MSG); | |
4643 | is_client_sendq_empty(user2, "User is -w; " MSG); | |
4644 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test1 :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper1, "User is +w; " MSG); | |
4645 | is_client_sendq("@time=" ADVENTURE_TIME " :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper2, "User is +w; " MSG); | |
4646 | is_client_sendq("@account=test1 :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users" CRLF, oper3, "User is +w; " MSG); | |
4647 | is_client_sendq_empty(oper4, "User is -w; " MSG); | |
4648 | is_client_sendq_empty(server, MSG); | |
4649 | ||
4650 | sendto_wallops_flags(UMODE_OPERWALL, oper2, "Test to opers"); | |
4651 | is_client_sendq_empty(user1, "Not an oper; " MSG); | |
4652 | is_client_sendq_empty(user2, "Not an oper; " MSG); | |
4653 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test2 :oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper1, "Oper is +z; " MSG); | |
4654 | is_client_sendq("@time=" ADVENTURE_TIME " :oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper2, "Oper is +z; " MSG); | |
4655 | is_client_sendq_empty(oper3, "Oper is -z; " MSG); | |
4656 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers" CRLF, oper4, "Oper is +z; " MSG); | |
4657 | is_client_sendq_empty(server, MSG); | |
4658 | ||
4659 | sendto_wallops_flags(UMODE_ADMIN, &me, "Test to admins"); | |
4660 | is_client_sendq_empty(user1, "Not an admin; " MSG); | |
4661 | is_client_sendq_empty(user2, "Not an admin; " MSG); | |
4662 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4663 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " WALLOPS :Test to admins" CRLF, oper2, MSG); | |
4664 | is_client_sendq_empty(oper3, "Not an admin; " MSG); | |
4665 | is_client_sendq_empty(oper4, "Not an admin; " MSG); | |
4666 | is_client_sendq_empty(server, MSG); | |
4667 | ||
4668 | remove_local_person(user1); | |
4669 | remove_local_person(user2); | |
4670 | remove_local_person(oper1); | |
4671 | remove_local_person(oper2); | |
4672 | remove_local_person(oper3); | |
4673 | remove_local_person(oper4); | |
4674 | } | |
4675 | ||
4676 | static void sendto_wallops_flags2(void) | |
4677 | { | |
4678 | struct Client *user1 = make_local_person_nick("user1"); | |
4679 | struct Client *user2 = make_local_person_nick("user2"); | |
4680 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4681 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4682 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4683 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4684 | ||
4685 | make_local_person_oper(oper1); | |
4686 | make_local_person_oper(oper2); | |
4687 | make_local_person_oper(oper3); | |
4688 | make_local_person_oper(oper4); | |
4689 | ||
4690 | user1->umodes |= UMODE_WALLOP; | |
4691 | oper1->umodes |= UMODE_WALLOP | UMODE_OPERWALL; | |
4692 | oper2->umodes |= UMODE_WALLOP | UMODE_OPERWALL | UMODE_ADMIN; | |
4693 | oper3->umodes |= UMODE_WALLOP; | |
4694 | oper4->umodes |= UMODE_OPERWALL; | |
4695 | ||
4696 | sendto_wallops_flags(UMODE_WALLOP, oper1, "Test to users %s", "42"); | |
4697 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, user1, "User is +w; " MSG); | |
4698 | is_client_sendq_empty(user2, "User is -w; " MSG); | |
4699 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper1, "User is +w; " MSG); | |
4700 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper2, "User is +w; " MSG); | |
4701 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper3, "User is +w; " MSG); | |
4702 | is_client_sendq_empty(oper4, "User is -w; " MSG); | |
4703 | is_client_sendq_empty(server, MSG); | |
4704 | ||
4705 | sendto_wallops_flags(UMODE_OPERWALL, oper2, "Test to opers %s", "42"); | |
4706 | is_client_sendq_empty(user1, "Not an oper; " MSG); | |
4707 | is_client_sendq_empty(user2, "Not an oper; " MSG); | |
4708 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper1, "Oper is +z; " MSG); | |
4709 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper2, "Oper is +z; " MSG); | |
4710 | is_client_sendq_empty(oper3, "Oper is -z; " MSG); | |
4711 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper4, "Oper is +z; " MSG); | |
4712 | is_client_sendq_empty(server, MSG); | |
4713 | ||
4714 | sendto_wallops_flags(UMODE_ADMIN, &me, "Test to admins %s", "42"); | |
4715 | is_client_sendq_empty(user1, "Not an admin; " MSG); | |
4716 | is_client_sendq_empty(user2, "Not an admin; " MSG); | |
4717 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4718 | is_client_sendq(":" TEST_ME_NAME " WALLOPS :Test to admins 42" CRLF, oper2, MSG); | |
4719 | is_client_sendq_empty(oper3, "Not an admin; " MSG); | |
4720 | is_client_sendq_empty(oper4, "Not an admin; " MSG); | |
4721 | is_client_sendq_empty(server, MSG); | |
4722 | ||
4723 | remove_local_person(user1); | |
4724 | remove_local_person(user2); | |
4725 | remove_local_person(oper1); | |
4726 | remove_local_person(oper2); | |
4727 | remove_local_person(oper3); | |
4728 | remove_local_person(oper4); | |
4729 | } | |
4730 | ||
4731 | static void sendto_wallops_flags2__tags(void) | |
4732 | { | |
4733 | struct Client *user1 = make_local_person_nick("user1"); | |
4734 | struct Client *user2 = make_local_person_nick("user2"); | |
4735 | struct Client *oper1 = make_local_person_nick("oper1"); | |
4736 | struct Client *oper2 = make_local_person_nick("oper2"); | |
4737 | struct Client *oper3 = make_local_person_nick("oper3"); | |
4738 | struct Client *oper4 = make_local_person_nick("oper4"); | |
4739 | ||
4740 | strcpy(oper1->user->suser, "test1"); | |
4741 | strcpy(oper2->user->suser, "test2"); | |
4742 | strcpy(oper3->user->suser, "test3"); | |
4743 | strcpy(oper4->user->suser, "test4"); | |
4744 | ||
4745 | oper1->localClient->caps |= CAP_ACCOUNT_TAG; | |
4746 | oper1->localClient->caps |= CAP_SERVER_TIME; | |
4747 | oper2->localClient->caps |= CAP_SERVER_TIME; | |
4748 | oper3->localClient->caps |= CAP_ACCOUNT_TAG; | |
4749 | ||
4750 | make_local_person_oper(oper1); | |
4751 | make_local_person_oper(oper2); | |
4752 | make_local_person_oper(oper3); | |
4753 | make_local_person_oper(oper4); | |
4754 | ||
4755 | user1->umodes |= UMODE_WALLOP; | |
4756 | oper1->umodes |= UMODE_WALLOP | UMODE_OPERWALL; | |
4757 | oper2->umodes |= UMODE_WALLOP | UMODE_OPERWALL | UMODE_ADMIN; | |
4758 | oper3->umodes |= UMODE_WALLOP; | |
4759 | oper4->umodes |= UMODE_OPERWALL; | |
4760 | ||
4761 | sendto_wallops_flags(UMODE_WALLOP, oper1, "Test to users %s", "42"); | |
4762 | is_client_sendq(":oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, user1, "User is +w; " MSG); | |
4763 | is_client_sendq_empty(user2, "User is -w; " MSG); | |
4764 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test1 :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper1, "User is +w; " MSG); | |
4765 | is_client_sendq("@time=" ADVENTURE_TIME " :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper2, "User is +w; " MSG); | |
4766 | is_client_sendq("@account=test1 :oper1" TEST_ID_SUFFIX " WALLOPS :Test to users 42" CRLF, oper3, "User is +w; " MSG); | |
4767 | is_client_sendq_empty(oper4, "User is -w; " MSG); | |
4768 | is_client_sendq_empty(server, MSG); | |
4769 | ||
4770 | sendto_wallops_flags(UMODE_OPERWALL, oper2, "Test to opers %s", "42"); | |
4771 | is_client_sendq_empty(user1, "Not an oper; " MSG); | |
4772 | is_client_sendq_empty(user2, "Not an oper; " MSG); | |
4773 | is_client_sendq("@time=" ADVENTURE_TIME ";account=test2 :oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper1, "Oper is +z; " MSG); | |
4774 | is_client_sendq("@time=" ADVENTURE_TIME " :oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper2, "Oper is +z; " MSG); | |
4775 | is_client_sendq_empty(oper3, "Oper is -z; " MSG); | |
4776 | is_client_sendq(":oper2" TEST_ID_SUFFIX " WALLOPS :Test to opers 42" CRLF, oper4, "Oper is +z; " MSG); | |
4777 | is_client_sendq_empty(server, MSG); | |
4778 | ||
4779 | sendto_wallops_flags(UMODE_ADMIN, &me, "Test to admins %s", "42"); | |
4780 | is_client_sendq_empty(user1, "Not an admin; " MSG); | |
4781 | is_client_sendq_empty(user2, "Not an admin; " MSG); | |
4782 | is_client_sendq_empty(oper1, "Not an admin; " MSG); | |
4783 | is_client_sendq("@time=" ADVENTURE_TIME " :" TEST_ME_NAME " WALLOPS :Test to admins 42" CRLF, oper2, MSG); | |
4784 | is_client_sendq_empty(oper3, "Not an admin; " MSG); | |
4785 | is_client_sendq_empty(oper4, "Not an admin; " MSG); | |
4786 | is_client_sendq_empty(server, MSG); | |
4787 | ||
4788 | remove_local_person(user1); | |
4789 | remove_local_person(user2); | |
4790 | remove_local_person(oper1); | |
4791 | remove_local_person(oper2); | |
4792 | remove_local_person(oper3); | |
4793 | remove_local_person(oper4); | |
4794 | } | |
4795 | ||
4796 | static void kill_client1(void) | |
4797 | { | |
4798 | standard_init(); | |
4799 | ||
4800 | kill_client(server, remote, "Hello %s!", "World"); | |
4801 | is_client_sendq(":" TEST_ME_NAME " KILL " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
4802 | is_client_sendq_empty(server2, MSG); | |
4803 | ||
4804 | standard_ids(); | |
4805 | ||
4806 | kill_client(server, remote, "Hello %s!", "World"); | |
4807 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4808 | is_client_sendq_empty(server2, MSG); | |
4809 | ||
4810 | standard_free(); | |
4811 | } | |
4812 | ||
4813 | static void kill_client1__tags(void) | |
4814 | { | |
4815 | standard_init(); | |
4816 | ||
4817 | strcpy(remote->user->suser, "test"); | |
4818 | ||
4819 | kill_client(server, remote, "Hello %s!", "World"); | |
4820 | is_client_sendq(":" TEST_ME_NAME " KILL " TEST_REMOTE_NICK " :Hello World!" CRLF, server, MSG); | |
4821 | is_client_sendq_empty(server2, MSG); | |
4822 | ||
4823 | standard_ids(); | |
4824 | ||
4825 | kill_client(server, remote, "Hello %s!", "World"); | |
4826 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4827 | is_client_sendq_empty(server2, MSG); | |
4828 | ||
4829 | standard_free(); | |
4830 | } | |
4831 | ||
4832 | static void kill_client_serv_butone1(void) | |
4833 | { | |
4834 | standard_init(); | |
4835 | ||
4836 | // This function does not support TS5... | |
4837 | standard_ids(); | |
4838 | ||
4839 | // If the server being sent to (or the kill target) is TS6, | |
4840 | // then "but one" is ignored and the kill is sent anyway | |
4841 | kill_client_serv_butone(remote, remote, "Hello %s!", "World"); | |
4842 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4843 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server2, MSG); | |
4844 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server3, MSG); | |
4845 | ||
4846 | kill_client_serv_butone(remote, remote2, "Hello %s!", "World"); | |
4847 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server, MSG); | |
4848 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server2, MSG); | |
4849 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server3, MSG); | |
4850 | ||
4851 | kill_client_serv_butone(remote2, remote, "Hello %s!", "World"); | |
4852 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4853 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server2, MSG); | |
4854 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server3, MSG); | |
4855 | ||
4856 | kill_client_serv_butone(remote2, remote2, "Hello %s!", "World"); | |
4857 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server, MSG); | |
4858 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server2, MSG); | |
4859 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server3, MSG); | |
4860 | ||
4861 | standard_free(); | |
4862 | } | |
4863 | ||
4864 | static void kill_client_serv_butone1__tags(void) | |
4865 | { | |
4866 | standard_init(); | |
4867 | ||
4868 | strcpy(remote2->user->suser, "test"); | |
4869 | strcpy(remote2->user->suser, "test2"); | |
4870 | ||
4871 | // This function does not support TS5... | |
4872 | standard_ids(); | |
4873 | ||
4874 | // If the server being sent to (or the kill target) is TS6, | |
4875 | // then "but one" is ignored and the kill is sent anyway | |
4876 | kill_client_serv_butone(remote, remote, "Hello %s!", "World"); | |
4877 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4878 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server2, MSG); | |
4879 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server3, MSG); | |
4880 | ||
4881 | kill_client_serv_butone(remote, remote2, "Hello %s!", "World"); | |
4882 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server, MSG); | |
4883 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server2, MSG); | |
4884 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server3, MSG); | |
4885 | ||
4886 | kill_client_serv_butone(remote2, remote, "Hello %s!", "World"); | |
4887 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server, MSG); | |
4888 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server2, MSG); | |
4889 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE_ID " :Hello World!" CRLF, server3, MSG); | |
4890 | ||
4891 | kill_client_serv_butone(remote2, remote2, "Hello %s!", "World"); | |
4892 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server, MSG); | |
4893 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server2, MSG); | |
4894 | is_client_sendq(":" TEST_ME_ID " KILL " TEST_REMOTE2_ID " :Hello World!" CRLF, server3, MSG); | |
4895 | ||
4896 | standard_free(); | |
4897 | } | |
4898 | ||
4899 | int main(int argc, char *argv[]) | |
4900 | { | |
4901 | plan_lazy(); | |
4902 | ||
4903 | ircd_util_init(__FILE__); | |
4904 | client_util_init(); | |
4905 | ||
4906 | // Load modules in a predictable order so that tags are added in the same order every time | |
4907 | ircd_util_reload_module("cap_account_tag"); | |
4908 | ircd_util_reload_module("cap_server_time"); | |
4909 | ||
4910 | CAP_ACCOUNT_TAG = capability_get(cli_capindex, "account-tag", NULL); | |
4911 | ok(CAP_ACCOUNT_TAG != 0, "CAP_ACCOUNT_TAG missing; " MSG); | |
4912 | ||
4913 | CAP_SERVER_TIME = capability_get(cli_capindex, "server-time", NULL); | |
4914 | ok(CAP_SERVER_TIME != 0, "CAP_SERVER_TIME missing; " MSG); | |
4915 | ||
4916 | CAP_INVITE_NOTIFY = capability_get(cli_capindex, "invite-notify", NULL); | |
4917 | ok(CAP_INVITE_NOTIFY != 0, "CAP_INVITE_NOTIFY missing; " MSG); | |
4918 | ||
4919 | sendto_one1(); | |
4920 | sendto_one1__tags(); | |
4921 | sendto_one_prefix1(); | |
4922 | sendto_one_prefix1__tags(); | |
4923 | sendto_one_notice1(); | |
4924 | sendto_one_notice1__tags(); | |
4925 | sendto_one_numeric1(); | |
4926 | sendto_one_numeric1__tags(); | |
4927 | sendto_server1(); | |
4928 | sendto_server1__tags(); | |
4929 | ||
4930 | sendto_channel_flags__local__all_members(); | |
4931 | sendto_channel_flags__remote__all_members(); | |
4932 | sendto_channel_flags__local__all_members__tags(); | |
4933 | sendto_channel_flags__remote__all_members__tags(); | |
4934 | sendto_channel_flags__local__voice(); | |
4935 | sendto_channel_flags__remote__voice(); | |
4936 | sendto_channel_flags__local__chanop(); | |
4937 | sendto_channel_flags__remote__chanop(); | |
4938 | sendto_channel_flags__local__chanop_voice(); | |
4939 | sendto_channel_flags__remote__chanop_voice(); | |
4940 | ||
4941 | sendto_channel_opmod__local(); | |
4942 | sendto_channel_opmod__local__tags(); | |
4943 | sendto_channel_opmod__remote(); | |
4944 | sendto_channel_opmod__remote__tags(); | |
4945 | sendto_channel_local1(); | |
4946 | sendto_channel_local1__tags(); | |
4947 | sendto_channel_local_with_capability1(); | |
4948 | sendto_channel_local_with_capability1__tags(); | |
4949 | sendto_channel_local_with_capability_butone1(); | |
4950 | sendto_channel_local_with_capability_butone1__tags(); | |
4951 | sendto_channel_local_butone1(); | |
4952 | sendto_channel_local_butone1__tags(); | |
4953 | sendto_common_channels_local1(); | |
4954 | sendto_common_channels_local1__tags(); | |
4955 | sendto_common_channels_local_butone1(); | |
4956 | sendto_common_channels_local_butone1__tags(); | |
4957 | ||
4958 | sendto_match_butone__host(); | |
4959 | sendto_match_butone__host__tags(); | |
4960 | sendto_match_butone__server(); | |
4961 | sendto_match_butone__server__tags(); | |
4962 | sendto_match_servs1(); | |
4963 | sendto_match_servs1__tags(); | |
4964 | sendto_local_clients_with_capability1(); | |
4965 | sendto_local_clients_with_capability1__tags(); | |
4966 | sendto_monitor1(); | |
4967 | sendto_monitor1__tags(); | |
4968 | sendto_anywhere1(); | |
4969 | sendto_anywhere1__tags(); | |
4970 | sendto_anywhere_echo1(); | |
4971 | sendto_anywhere_echo1__tags(); | |
4972 | ||
4973 | sendto_realops_snomask1(); | |
4974 | sendto_realops_snomask1__tags(); | |
4975 | sendto_realops_snomask_from1(); | |
4976 | sendto_realops_snomask_from1__tags(); | |
4977 | sendto_wallops_flags1(); | |
4978 | sendto_wallops_flags1__tags(); | |
4979 | sendto_wallops_flags2(); | |
4980 | sendto_wallops_flags2__tags(); | |
4981 | ||
4982 | kill_client1(); | |
4983 | kill_client1__tags(); | |
4984 | kill_client_serv_butone1(); | |
4985 | kill_client_serv_butone1__tags(); | |
4986 | ||
4987 | client_util_free(); | |
4988 | ircd_util_free(); | |
4989 | return 0; | |
4990 | } |