2 * send1.c: Test sendto_* under various conditions
3 * Copyright 2017 Simon Arlott
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.
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.
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
24 #include "tap/basic.h"
26 #include "ircd_util.h"
27 #include "client_util.h"
34 #define MSG "%s:%d (%s)", __FILE__, __LINE__, __FUNCTION__
37 #define ADVENTURE_TIME "2017-07-14T02:40:00.000Z"
39 int rb_gettimeofday(struct timeval
*tv
, void *tz
)
45 tv
->tv_sec
= 1500000000;
50 unsigned int CAP_ACCOUNT_TAG
;
51 unsigned int CAP_SERVER_TIME
;
52 unsigned int CAP_INVITE_NOTIFY
;
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
;
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
;
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
;
77 static struct Client
*remote2_chan_p
;
78 static struct Client
*remote2_chan_d
;
80 static void standard_init(void)
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
);
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
;
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");
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
;
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
;
117 channel
= make_channel();
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
);
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
);
131 add_user_to_channel(channel
, remote2_chan_p
, CHFL_PEON
);
132 add_user_to_channel(channel
, remote2_chan_d
, CHFL_CHANOP
| CHFL_VOICE
);
134 lchannel
= allocate_channel("&test");
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
);
142 static void standard_ids(void)
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
);
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");
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");
164 strcpy(remote2_chan_p
->id
, TEST_SERVER2_ID
"90204");
165 strcpy(remote2_chan_d
->id
, TEST_SERVER2_ID
"90205");
168 static void standard_server_caps(unsigned int add
, unsigned int remove
)
170 server
->localClient
->caps
|= add
;
171 server2
->localClient
->caps
|= add
;
172 server3
->localClient
->caps
|= add
;
174 server
->localClient
->caps
&= ~remove
;
175 server2
->localClient
->caps
&= ~remove
;
176 server3
->localClient
->caps
&= ~remove
;
179 static void standard_free(void)
181 remove_remote_person(remote2_chan_p
);
182 remove_remote_person(remote2_chan_d
);
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
);
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
);
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
);
206 static void sendto_one1(void)
210 sendto_one(user
, "Hello %s!", "World");
211 is_client_sendq("Hello World!" CRLF
, user
, MSG
);
213 sendto_one(server
, "Hello %s!", "World");
214 is_client_sendq("Hello World!" CRLF
, server
, MSG
);
216 sendto_one(remote
, "Hello %s!", "World");
217 is_client_sendq("Hello World!" CRLF
, server
, MSG
);
222 static void sendto_one1__tags(void)
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
;
231 sendto_one(local_chan_o
, "Hello %s!", "World");
232 is_client_sendq("@time=" ADVENTURE_TIME
" Hello World!" CRLF
, local_chan_o
, MSG
);
234 sendto_one(local_chan_ov
, "Hello %s!", "World");
235 is_client_sendq("@time=" ADVENTURE_TIME
" Hello World!" CRLF
, local_chan_ov
, MSG
);
237 sendto_one(local_chan_v
, "Hello %s!", "World");
238 is_client_sendq("Hello World!" CRLF
, local_chan_v
, MSG
);
240 sendto_one(local_chan_p
, "Hello %s!", "World");
241 is_client_sendq("Hello World!" CRLF
, local_chan_p
, MSG
);
246 static void sendto_one_prefix1(void)
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
);
254 sendto_one_prefix(user
, user
, "TEST", ":Hello %s!", "World");
255 is_client_sendq(":" TEST_NICK
" TEST " TEST_NICK
" :Hello World!" CRLF
, user
, MSG
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
294 static void sendto_one_prefix1__tags(void)
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
;
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
);
308 sendto_one_prefix(user
, user
, "TEST", ":Hello %s!", "World");
309 is_client_sendq(":" TEST_NICK
" TEST " TEST_NICK
" :Hello World!" CRLF
, user
, MSG
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
372 static void sendto_one_notice1(void)
377 sendto_one_notice(user
, ":Hello %s!", "World");
378 is_client_sendq(":" TEST_ME_NAME
" NOTICE " TEST_NICK
" :Hello World!" CRLF
, user
, MSG
);
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
);
387 sendto_one_notice(remote
, ":Hello %s!", "World");
388 is_client_sendq(":" TEST_ME_ID
" NOTICE " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
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
);
398 static void sendto_one_notice1__tags(void)
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
;
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
);
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
);
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
);
417 local_chan_o
->name
[0] = '\0';
418 local_chan_ov
->name
[0] = '\0';
419 local_chan_v
->name
[0] = '\0';
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
);
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
);
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
);
433 static void sendto_one_numeric1(void)
438 sendto_one_numeric(user
, 1, "Hello %s!", "World");
439 is_client_sendq(":" TEST_ME_NAME
" 001 " TEST_NICK
" Hello World!" CRLF
, user
, MSG
);
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
);
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
);
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
);
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
);
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
);
465 static void sendto_one_numeric1__tags(void)
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
;
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
);
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
);
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
);
484 local_chan_o
->name
[0] = '\0';
485 local_chan_ov
->name
[0] = '\0';
486 local_chan_v
->name
[0] = '\0';
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
);
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
);
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
);
500 static void sendto_server1(void)
504 // TODO test capabilities
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
586 static void sendto_server1__tags(void)
590 // TODO test capabilities
592 strcpy(user
->user
->suser
, "test");
593 strcpy(remote
->user
->suser
, "rtest");
594 strcpy(remote2
->user
->suser
, "r2test");
595 strcpy(remote3
->user
->suser
, "r3test");
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
677 static void sendto_channel_flags__local__all_members(void)
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
);
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
);
706 static void sendto_channel_flags__remote__all_members(void)
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
);
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
);
733 static void sendto_channel_flags__local__all_members__tags(void)
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
;
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
);
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
);
768 static void sendto_channel_flags__remote__all_members__tags(void)
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
;
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
);
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
);
801 static void sendto_channel_flags__local__voice(void)
806 standard_server_caps(0, CAP_CHW
);
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
);
819 standard_server_caps(CAP_CHW
, 0);
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
);
834 standard_server_caps(0, CAP_CHW
);
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
);
847 standard_server_caps(CAP_CHW
, 0);
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
);
862 static void sendto_channel_flags__remote__voice(void)
867 standard_server_caps(0, CAP_CHW
);
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
);
879 standard_server_caps(CAP_CHW
, 0);
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
);
893 standard_server_caps(0, CAP_CHW
);
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
);
905 standard_server_caps(CAP_CHW
, 0);
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
);
919 static void sendto_channel_flags__local__chanop(void)
924 standard_server_caps(0, CAP_CHW
);
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
);
937 standard_server_caps(CAP_CHW
, 0);
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
);
952 standard_server_caps(0, CAP_CHW
);
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
);
965 standard_server_caps(CAP_CHW
, 0);
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
);
980 static void sendto_channel_flags__remote__chanop(void)
985 standard_server_caps(0, CAP_CHW
);
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
);
997 standard_server_caps(CAP_CHW
, 0);
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
);
1011 standard_server_caps(0, CAP_CHW
);
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
);
1023 standard_server_caps(CAP_CHW
, 0);
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
);
1037 static void sendto_channel_flags__local__chanop_voice(void)
1042 standard_server_caps(0, CAP_CHW
);
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
);
1055 standard_server_caps(CAP_CHW
, 0);
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
);
1070 standard_server_caps(0, CAP_CHW
);
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
);
1083 standard_server_caps(CAP_CHW
, 0);
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
);
1098 static void sendto_channel_flags__remote__chanop_voice(void)
1103 standard_server_caps(0, CAP_CHW
);
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
);
1115 standard_server_caps(CAP_CHW
, 0);
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
);
1129 standard_server_caps(0, CAP_CHW
);
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
);
1141 standard_server_caps(CAP_CHW
, 0);
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
);
1155 static void sendto_channel_opmod__local(void)
1159 // This function does not support TS5...
1162 // Without CAP_CHW | CAP_EOPMOD
1163 standard_server_caps(0, CAP_CHW
| CAP_EOPMOD
);
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
);
1175 // With CAP_CHW, without CAP_EOPMOD
1176 standard_server_caps(CAP_CHW
, CAP_EOPMOD
);
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
);
1188 // Moderated channel
1189 channel
->mode
.mode
|= MODE_MODERATED
;
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
);
1201 // With CAP_CHW | CAP_EOPMOD
1202 channel
->mode
.mode
&= ~MODE_MODERATED
;
1203 standard_server_caps(CAP_CHW
| CAP_EOPMOD
, 0);
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
);
1216 static void sendto_channel_opmod__local__tags(void)
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
;
1225 // This function does not support TS5...
1228 // Without CAP_CHW | CAP_EOPMOD
1229 standard_server_caps(0, CAP_CHW
| CAP_EOPMOD
);
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
);
1241 // With CAP_CHW, without CAP_EOPMOD
1242 standard_server_caps(CAP_CHW
, CAP_EOPMOD
);
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
);
1254 // Moderated channel
1255 channel
->mode
.mode
|= MODE_MODERATED
;
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
;
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
);
1272 // With CAP_CHW | CAP_EOPMOD
1273 channel
->mode
.mode
&= ~MODE_MODERATED
;
1274 standard_server_caps(CAP_CHW
| CAP_EOPMOD
, 0);
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
);
1287 static void sendto_channel_opmod__remote(void)
1291 // This function does not support TS5...
1294 // Without CAP_CHW | CAP_EOPMOD
1295 standard_server_caps(0, CAP_CHW
| CAP_EOPMOD
);
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
);
1305 // With CAP_CHW, without CAP_EOPMOD
1306 standard_server_caps(CAP_CHW
, CAP_EOPMOD
);
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
);
1316 // Moderated channel
1317 channel
->mode
.mode
|= MODE_MODERATED
;
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
);
1327 // With CAP_CHW | CAP_EOPMOD
1328 channel
->mode
.mode
&= ~MODE_MODERATED
;
1329 standard_server_caps(CAP_CHW
| CAP_EOPMOD
, 0);
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
);
1342 static void sendto_channel_opmod__remote__tags(void)
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
;
1351 // This function does not support TS5...
1354 // Without CAP_CHW | CAP_EOPMOD
1355 standard_server_caps(0, CAP_CHW
| CAP_EOPMOD
);
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
);
1365 // With CAP_CHW, without CAP_EOPMOD
1366 standard_server_caps(CAP_CHW
, CAP_EOPMOD
);
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
);
1376 // Moderated channel
1377 channel
->mode
.mode
|= MODE_MODERATED
;
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
;
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
);
1392 // With CAP_CHW | CAP_EOPMOD
1393 channel
->mode
.mode
&= ~MODE_MODERATED
;
1394 standard_server_caps(CAP_CHW
| CAP_EOPMOD
, 0);
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
);
1407 static void sendto_channel_local1(void)
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
);
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
);
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
);
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
);
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
);
1461 struct Client
*oper1
= make_local_person_nick("oper1");
1462 struct Client
*oper2
= make_local_person_nick("oper2");
1464 make_local_person_oper(oper1
);
1465 make_local_person_oper(oper2
);
1467 oper2
->umodes
|= UMODE_ADMIN
;
1469 add_user_to_channel(lchannel
, oper1
, CHFL_PEON
);
1470 add_user_to_channel(lchannel
, oper2
, CHFL_PEON
);
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
);
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
);
1491 static void sendto_channel_local1__tags(void)
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
;
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
);
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
);
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
);
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
);
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
);
1551 struct Client
*oper1
= make_local_person_nick("oper1");
1552 struct Client
*oper2
= make_local_person_nick("oper2");
1554 make_local_person_oper(oper1
);
1555 make_local_person_oper(oper2
);
1557 oper2
->umodes
|= UMODE_ADMIN
;
1559 add_user_to_channel(lchannel
, oper1
, CHFL_PEON
);
1560 add_user_to_channel(lchannel
, oper2
, CHFL_PEON
);
1562 oper1
->localClient
->caps
|= CAP_ACCOUNT_TAG
;
1563 oper2
->localClient
->caps
|= CAP_SERVER_TIME
;
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
);
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
);
1581 oper1
->localClient
->caps
&= ~CAP_ACCOUNT_TAG
;
1582 oper2
->localClient
->caps
|= CAP_ACCOUNT_TAG
;
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
);
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
);
1603 static void sendto_channel_local_with_capability1(void)
1607 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
1608 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
1733 static void sendto_channel_local_with_capability1__tags(void)
1737 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
1738 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
1869 static void sendto_channel_local_with_capability_butone1(void)
1873 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
1874 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
1969 static void sendto_channel_local_with_capability_butone1__tags(void)
1973 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
1974 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
2076 static void sendto_channel_local_butone1(void)
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
2173 static void sendto_channel_local_butone1__tags(void)
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
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
2279 static void sendto_common_channels_local1(void)
2283 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2284 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
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
);
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
);
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
);
2349 local_no_chan
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
2384 static void sendto_common_channels_local1__tags(void)
2388 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2389 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
;
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
);
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
);
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
);
2431 local_no_chan
->localClient
->caps
|= CAP_SERVER_TIME
;
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
);
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
);
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
);
2463 local_no_chan
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2464 local_no_chan
->localClient
->caps
|= CAP_ACCOUNT_TAG
;
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
);
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
);
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
);
2496 local_no_chan
->localClient
->caps
&= ~CAP_SERVER_TIME
;
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
);
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
);
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
);
2531 static void sendto_common_channels_local_butone1(void)
2535 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2536 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
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
);
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
);
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
);
2601 local_no_chan
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
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
);
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
);
2636 static void sendto_common_channels_local_butone1__tags(void)
2640 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2641 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
;
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
);
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
);
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
);
2683 local_no_chan
->localClient
->caps
|= CAP_SERVER_TIME
;
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
);
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
);
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
);
2715 local_no_chan
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
2716 local_no_chan
->localClient
->caps
|= CAP_ACCOUNT_TAG
;
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
);
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
);
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
);
2748 local_no_chan
->localClient
->caps
&= ~CAP_SERVER_TIME
;
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
);
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
);
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
);
2783 static void sendto_match_butone__host(void)
2787 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
2883 static void sendto_match_butone__host__tags(void)
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
;
2894 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
2990 static void sendto_match_butone__server(void)
2994 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3090 static void sendto_match_butone__server__tags(void)
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
;
3101 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3197 static void sendto_local_clients_with_capability1(void)
3201 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
3202 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
);
3217 static void sendto_local_clients_with_capability1__tags(void)
3221 local_chan_o
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
3222 local_chan_v
->localClient
->caps
|= CAP_INVITE_NOTIFY
;
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
;
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
);
3248 static void sendto_monitor1(void)
3250 struct monitor
*monptr
;
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
);
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
);
3273 static void sendto_monitor1__tags(void)
3275 struct monitor
*monptr
;
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
;
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
);
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
);
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
);
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
);
3319 static void sendto_anywhere1(void)
3323 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3364 static void sendto_anywhere1__tags(void)
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
;
3378 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3446 static void sendto_anywhere_echo1(void)
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
);
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
);
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
);
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
);
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
);
3476 static void sendto_anywhere_echo1__tags(void)
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
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3595 static void sendto_match_servs1(void)
3599 server
->localClient
->caps
= CAP_ENCAP
;
3600 server2
->localClient
->caps
= CAP_ENCAP
;
3601 server2
->localClient
->caps
|= CAP_KNOCK
;
3602 server3
->localClient
->caps
= CAP_BAN
;
3604 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3736 static void sendto_match_servs1__tags(void)
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
;
3745 server
->localClient
->caps
= CAP_ENCAP
;
3746 server2
->localClient
->caps
= CAP_ENCAP
;
3747 server2
->localClient
->caps
|= CAP_KNOCK
;
3748 server3
->localClient
->caps
= CAP_BAN
;
3750 // This function does not support TS5...
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
3882 static void sendto_realops_snomask1(void)
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");
3891 make_local_person_oper(oper1
);
3892 make_local_person_oper(oper2
);
3893 make_local_person_oper(oper3
);
3894 make_local_person_oper(oper4
);
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
;
3901 oper3
->user
->privset
= privilegeset_get("admin");
3902 oper4
->user
->privset
= privilegeset_get("admin");
3904 server
->localClient
->caps
= CAP_ENCAP
| CAP_TS6
;
3905 server2
->localClient
->caps
= 0;
3907 ConfigFileEntry
.global_snotices
= 0;
3908 remote_rehash_oper_p
= NULL
;
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
);
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
);
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
);
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
);
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
);
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
);
3952 remote_rehash_oper_p
= remote
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
4040 // This feature does not support TS5...
4041 ConfigFileEntry
.global_snotices
= 1;
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
);
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
);
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
);
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
);
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
);
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
);
4091 remove_local_person(oper1
);
4092 remove_local_person(oper2
);
4093 remove_local_person(oper3
);
4094 remove_local_person(oper4
);
4099 static void sendto_realops_snomask1__tags(void)
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");
4108 strcpy(oper1
->user
->suser
, "test1");
4109 strcpy(oper2
->user
->suser
, "test2");
4110 strcpy(oper3
->user
->suser
, "test3");
4111 strcpy(oper4
->user
->suser
, "test4");
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
;
4118 make_local_person_oper(oper1
);
4119 make_local_person_oper(oper2
);
4120 make_local_person_oper(oper3
);
4121 make_local_person_oper(oper4
);
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
;
4128 oper3
->user
->privset
= privilegeset_get("admin");
4129 oper4
->user
->privset
= privilegeset_get("admin");
4131 server
->localClient
->caps
= CAP_ENCAP
| CAP_TS6
;
4132 server2
->localClient
->caps
= 0;
4134 ConfigFileEntry
.global_snotices
= 0;
4135 remote_rehash_oper_p
= NULL
;
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
);
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
);
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
);
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
);
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
);
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
);
4179 remote_rehash_oper_p
= remote
;
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
4267 // This feature does not support TS5...
4268 ConfigFileEntry
.global_snotices
= 1;
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
);
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
);
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
);
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
);
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
);
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
);
4318 remove_local_person(oper1
);
4319 remove_local_person(oper2
);
4320 remove_local_person(oper3
);
4321 remove_local_person(oper4
);
4326 static void sendto_realops_snomask_from1(void)
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");
4333 make_local_person_oper(oper1
);
4334 make_local_person_oper(oper2
);
4335 make_local_person_oper(oper3
);
4336 make_local_person_oper(oper4
);
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
;
4343 oper3
->user
->privset
= privilegeset_get("admin");
4344 oper4
->user
->privset
= privilegeset_get("admin");
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
4430 remove_local_person(oper1
);
4431 remove_local_person(oper2
);
4432 remove_local_person(oper3
);
4433 remove_local_person(oper4
);
4436 static void sendto_realops_snomask_from1__tags(void)
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");
4443 strcpy(oper1
->user
->suser
, "test1");
4444 strcpy(oper2
->user
->suser
, "test2");
4445 strcpy(oper3
->user
->suser
, "test3");
4446 strcpy(oper4
->user
->suser
, "test4");
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
;
4453 make_local_person_oper(oper1
);
4454 make_local_person_oper(oper2
);
4455 make_local_person_oper(oper3
);
4456 make_local_person_oper(oper4
);
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
;
4463 oper3
->user
->privset
= privilegeset_get("admin");
4464 oper4
->user
->privset
= privilegeset_get("admin");
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
4550 remove_local_person(oper1
);
4551 remove_local_person(oper2
);
4552 remove_local_person(oper3
);
4553 remove_local_person(oper4
);
4556 static void sendto_wallops_flags1(void)
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");
4565 make_local_person_oper(oper1
);
4566 make_local_person_oper(oper2
);
4567 make_local_person_oper(oper3
);
4568 make_local_person_oper(oper4
);
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
;
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
);
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
);
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
);
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
);
4611 static void sendto_wallops_flags1__tags(void)
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");
4620 strcpy(oper1
->user
->suser
, "test1");
4621 strcpy(oper2
->user
->suser
, "test2");
4622 strcpy(oper3
->user
->suser
, "test3");
4623 strcpy(oper4
->user
->suser
, "test4");
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
;
4630 make_local_person_oper(oper1
);
4631 make_local_person_oper(oper2
);
4632 make_local_person_oper(oper3
);
4633 make_local_person_oper(oper4
);
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
;
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
);
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
);
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
);
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
);
4676 static void kill_client1(void)
4680 kill_client(server
, remote
, "Hello %s!", "World");
4681 is_client_sendq(":" TEST_ME_NAME
" KILL " TEST_REMOTE_NICK
" :Hello World!" CRLF
, server
, MSG
);
4682 is_client_sendq_empty(server2
, MSG
);
4686 kill_client(server
, remote
, "Hello %s!", "World");
4687 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4688 is_client_sendq_empty(server2
, MSG
);
4693 static void kill_client1__tags(void)
4697 strcpy(remote
->user
->suser
, "test");
4699 kill_client(server
, remote
, "Hello %s!", "World");
4700 is_client_sendq(":" TEST_ME_NAME
" KILL " TEST_REMOTE_NICK
" :Hello World!" CRLF
, server
, MSG
);
4701 is_client_sendq_empty(server2
, MSG
);
4705 kill_client(server
, remote
, "Hello %s!", "World");
4706 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4707 is_client_sendq_empty(server2
, MSG
);
4712 static void kill_client_serv_butone1(void)
4716 // This function does not support TS5...
4719 // If the server being sent to (or the kill target) is TS6,
4720 // then "but one" is ignored and the kill is sent anyway
4721 kill_client_serv_butone(remote
, remote
, "Hello %s!", "World");
4722 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4723 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server2
, MSG
);
4724 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server3
, MSG
);
4726 kill_client_serv_butone(remote
, remote2
, "Hello %s!", "World");
4727 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server
, MSG
);
4728 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server2
, MSG
);
4729 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server3
, MSG
);
4731 kill_client_serv_butone(remote2
, remote
, "Hello %s!", "World");
4732 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4733 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server2
, MSG
);
4734 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server3
, MSG
);
4736 kill_client_serv_butone(remote2
, remote2
, "Hello %s!", "World");
4737 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server
, MSG
);
4738 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server2
, MSG
);
4739 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server3
, MSG
);
4744 static void kill_client_serv_butone1__tags(void)
4748 strcpy(remote2
->user
->suser
, "test");
4749 strcpy(remote2
->user
->suser
, "test2");
4751 // This function does not support TS5...
4754 // If the server being sent to (or the kill target) is TS6,
4755 // then "but one" is ignored and the kill is sent anyway
4756 kill_client_serv_butone(remote
, remote
, "Hello %s!", "World");
4757 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4758 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server2
, MSG
);
4759 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server3
, MSG
);
4761 kill_client_serv_butone(remote
, remote2
, "Hello %s!", "World");
4762 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server
, MSG
);
4763 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server2
, MSG
);
4764 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server3
, MSG
);
4766 kill_client_serv_butone(remote2
, remote
, "Hello %s!", "World");
4767 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server
, MSG
);
4768 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server2
, MSG
);
4769 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE_ID
" :Hello World!" CRLF
, server3
, MSG
);
4771 kill_client_serv_butone(remote2
, remote2
, "Hello %s!", "World");
4772 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server
, MSG
);
4773 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server2
, MSG
);
4774 is_client_sendq(":" TEST_ME_ID
" KILL " TEST_REMOTE2_ID
" :Hello World!" CRLF
, server3
, MSG
);
4779 int main(int argc
, char *argv
[])
4783 ircd_util_init(__FILE__
);
4786 // Load modules in a predictable order so that tags are added in the same order every time
4787 ircd_util_reload_module("cap_account_tag");
4788 ircd_util_reload_module("cap_server_time");
4790 CAP_ACCOUNT_TAG
= capability_get(cli_capindex
, "account-tag", NULL
);
4791 ok(CAP_ACCOUNT_TAG
!= 0, "CAP_ACCOUNT_TAG missing; " MSG
);
4793 CAP_SERVER_TIME
= capability_get(cli_capindex
, "server-time", NULL
);
4794 ok(CAP_SERVER_TIME
!= 0, "CAP_SERVER_TIME missing; " MSG
);
4796 CAP_INVITE_NOTIFY
= capability_get(cli_capindex
, "invite-notify", NULL
);
4797 ok(CAP_INVITE_NOTIFY
!= 0, "CAP_INVITE_NOTIFY missing; " MSG
);
4800 sendto_one1__tags();
4801 sendto_one_prefix1();
4802 sendto_one_prefix1__tags();
4803 sendto_one_notice1();
4804 sendto_one_notice1__tags();
4805 sendto_one_numeric1();
4806 sendto_one_numeric1__tags();
4808 sendto_server1__tags();
4810 sendto_channel_flags__local__all_members();
4811 sendto_channel_flags__remote__all_members();
4812 sendto_channel_flags__local__all_members__tags();
4813 sendto_channel_flags__remote__all_members__tags();
4814 sendto_channel_flags__local__voice();
4815 sendto_channel_flags__remote__voice();
4816 sendto_channel_flags__local__chanop();
4817 sendto_channel_flags__remote__chanop();
4818 sendto_channel_flags__local__chanop_voice();
4819 sendto_channel_flags__remote__chanop_voice();
4821 sendto_channel_opmod__local();
4822 sendto_channel_opmod__local__tags();
4823 sendto_channel_opmod__remote();
4824 sendto_channel_opmod__remote__tags();
4825 sendto_channel_local1();
4826 sendto_channel_local1__tags();
4827 sendto_channel_local_with_capability1();
4828 sendto_channel_local_with_capability1__tags();
4829 sendto_channel_local_with_capability_butone1();
4830 sendto_channel_local_with_capability_butone1__tags();
4831 sendto_channel_local_butone1();
4832 sendto_channel_local_butone1__tags();
4833 sendto_common_channels_local1();
4834 sendto_common_channels_local1__tags();
4835 sendto_common_channels_local_butone1();
4836 sendto_common_channels_local_butone1__tags();
4838 sendto_match_butone__host();
4839 sendto_match_butone__host__tags();
4840 sendto_match_butone__server();
4841 sendto_match_butone__server__tags();
4842 sendto_match_servs1();
4843 sendto_match_servs1__tags();
4844 sendto_local_clients_with_capability1();
4845 sendto_local_clients_with_capability1__tags();
4847 sendto_monitor1__tags();
4849 sendto_anywhere1__tags();
4850 sendto_anywhere_echo1();
4851 sendto_anywhere_echo1__tags();
4853 sendto_realops_snomask1();
4854 sendto_realops_snomask1__tags();
4855 sendto_realops_snomask_from1();
4856 sendto_realops_snomask_from1__tags();
4857 sendto_wallops_flags1();
4858 sendto_wallops_flags1__tags();
4861 kill_client1__tags();
4862 kill_client_serv_butone1();
4863 kill_client_serv_butone1__tags();