Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv13843
Modified Files:
Tag: rel-1_0
chanserv.c
Log Message:
non-users could still use toys when disabled.. oops
also, ping cant be disabled for opers/helpers, its kinda of.. informational
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.161.2.70
retrieving revision 1.161.2.71
diff -C2 -r1.161.2.70 -r1.161.2.71
*** chanserv.c 2001/08/09 12:28:39 1.161.2.70
--- chanserv.c 2001/08/11 06:18:45 1.161.2.71
***************
*** 4274,4277 ****
--- 4274,4283 ----
{
(void)argc; (void)argv;
+
+ if (channel && channel->channel_info->options[optToys] == 'd') {
+ chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name);
+ return 1;
+ }
+
if (channel && !argv[-1] && GetChannelUser(channel->channel_info, user->handle_info)) {
char *response;
***************
*** 4283,4288 ****
case 'n':
chanserv_notice(user, CSMSG_UNF_RESPONSE); break;
- case 'd':
- chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name); break;
}
} else {
--- 4289,4292 ----
***************
*** 4295,4298 ****
--- 4299,4308 ----
{
(void)argc; (void)argv;
+
+ if (channel && channel->channel_info->options[optToys] == 'd' && !IsPrivileged(user)) {
+ chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name);
+ return 1;
+ }
+
if (channel && !argv[-1] && GetChannelUser(channel->channel_info, user->handle_info)) {
char *response;
***************
*** 4304,4309 ****
case 'n':
chanserv_notice(user, CSMSG_PING_RESPONSE); break;
- case 'd':
- chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name); break;
}
} else {
--- 4314,4317 ----
***************
*** 4316,4319 ****
--- 4324,4333 ----
{
(void)argc; (void)argv;
+
+ if (channel && channel->channel_info->options[optToys] == 'd') {
+ chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name);
+ return 1;
+ }
+
if (channel && !argv[-1] && GetChannelUser(channel->channel_info, user->handle_info)) {
char *response;
***************
*** 4326,4331 ****
case 'n':
chanserv_notice(user, CSMSG_WUT_RESPONSE); break;
- case 'd':
- chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name); break;
}
} else {
--- 4340,4343 ----
***************
*** 4346,4349 ****
--- 4358,4369 ----
}
}
+
+ /* since the switch() statement only affects users on the userlist
+ we've got to stop before it even gets there. */
+ if (channel && channel->channel_info->options[optToys] == 'd') {
+ chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name);
+ return 1;
+ }
+
resp = chanserv_conf.eightball->list[accum % chanserv_conf.eightball->used];
if (channel && !argv[-1] && GetChannelUser(channel->channel_info, user->handle_info)) {
***************
*** 4356,4361 ****
case 'n':
chanserv_notice(user, resp); break;
- case 'd':
- chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name); break;
}
} else {
--- 4376,4379 ----
***************
*** 4370,4373 ****
--- 4388,4397 ----
REQUIRE_PARAMS(2);
sides = atoi(argv[1]);
+
+ if (channel && channel->channel_info->options[optToys] == 'd') {
+ chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name);
+ return 1;
+ }
+
if (sides <= 1) {
chanserv_notice(user, CSMSG_BAD_NUMBER, argv[1]);
***************
*** 4383,4388 ****
case 'n':
chanserv_notice(user, "A %d shows on the %d-sided die.", rolled, sides); break;
- case 'd':
- chanserv_notice(user, CSMSG_TOYS_DISABLED, channel->name); break;
}
} else {
--- 4407,4410 ----
|