X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/c092fcad1208537de0115ebac7fc7e3b043dc39e..985d4109d818518b2230dc63736800e17d153e6c:/src/chanserv.c diff --git a/src/chanserv.c b/src/chanserv.c index ef0b209..6ff9d5f 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -513,6 +513,8 @@ static const struct message_entry msgtab[] = { /* Other things */ { "CSMSG_EVENT_SEARCH_RESULTS", "$bChannel Events for %s$b" }, { "CSMSG_LAST_INVALID", "Invalid argument. must be 1-200" }, + { "CSMSG_DEFCON_NO_NEW_CHANNELS", "You cannot register new channels at this time, please try again soon." }, + { "CSMSG_DEFCON_NO_MODE_CHANGE", "You cannot change the MODE at this time, please try again soon." }, { NULL, NULL } }; @@ -1963,6 +1965,10 @@ static CHANSERV_FUNC(cmd_register) struct do_not_register *dnr; unsigned int n; + if (checkDefCon(DEFCON_NO_NEW_CHANNELS) && !IsOper(user)) { + reply("CSMSG_DEFCON_NO_NEW_CHANNELS"); + return 0; + } if(channel) { @@ -4447,6 +4453,11 @@ static CHANSERV_FUNC(cmd_mode) if(argc < 2) { + if (checkDefCon(DEFCON_NO_MODE_CHANGE) && !IsOper(user)) { + reply("CSMSG_DEFCON_NO_MODE_CHANGE"); + return 0; + } + change = &channel->channel_info->modes; if(change->modes_set || change->modes_clear) { modcmd_chanmode_announce(change); @@ -4679,9 +4690,9 @@ static CHANSERV_FUNC(cmd_info) reply("CSMSG_CHANNEL_VISITED", intervalString(buffer, now - cData->visited, user->handle_info)); privileged = IsStaff(user); - if(privileged) + /* if(privileged) */ reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info)); - if(((uData && uData->access >= UL_COOWNER) || privileged) && cData->registrar) + if(/*((uData && uData->access >= UL_COOWNER) || privileged) && */cData->registrar) reply("CSMSG_CHANNEL_REGISTRAR", cData->registrar); if(privileged && (dnr = chanserv_is_dnr(channel->name, NULL))) @@ -5750,6 +5761,11 @@ static MODCMD_FUNC(chan_opt_modes) if(argc > 1) { + if (checkDefCon(DEFCON_NO_MODE_CHANGE) && !IsOper(user)) { + reply("CSMSG_DEFCON_NO_MODE_CHANGE"); + return 0; + } + if(!check_user_level(channel, user, lvlEnfModes, 1, 0)) { reply("CSMSG_NO_ACCESS");