From: pk910 Date: Thu, 7 Jul 2011 20:07:40 +0000 (+0200) Subject: ignore MODE -z but allow MODE +z X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=3591aaf90419e4e5f92defcd9958ac4b2dd9b184;p=srvx.git ignore MODE -z but allow MODE +z --- diff --git a/src/chanserv.c b/src/chanserv.c index f04c3fb..0b1eb40 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -4399,7 +4399,7 @@ static CHANSERV_FUNC(cmd_mode) base_oplevel = 1; else base_oplevel = 1 + UL_OWNER - uData->access; - change = mod_chanmode_parse(channel, argv+1, argc-1, MCP_KEY_FREE|MCP_REGISTERED|MCP_NO_APASS, base_oplevel); + change = mod_chanmode_parse(channel, argv+1, argc-1, MCP_KEY_FREE|MCP_IGN_REGISTERED|MCP_NO_APASS, base_oplevel); if(!change) { reply("MSG_INVALID_MODES", unsplit_string(argv+1, argc-1, NULL)); @@ -5653,7 +5653,7 @@ static MODCMD_FUNC(chan_opt_modes) { memset(&channel->channel_info->modes, 0, sizeof(channel->channel_info->modes)); } - else if(!(new_modes = mod_chanmode_parse(channel, argv+1, argc-1, MCP_KEY_FREE|MCP_REGISTERED|MCP_NO_APASS, 0))) + else if(!(new_modes = mod_chanmode_parse(channel, argv+1, argc-1, MCP_KEY_FREE|MCP_IGN_REGISTERED|MCP_NO_APASS, 0))) { reply("CSMSG_INVALID_MODE_LOCK", unsplit_string(argv+1, argc-1, NULL)); return 0; diff --git a/src/proto-p10.c b/src/proto-p10.c index 3b68011..d2f20a0 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -2427,8 +2427,14 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un case 's': do_chan_mode(MODE_SECRET); break; case 't': do_chan_mode(MODE_TOPICLIMIT); break; case 'z': - if (!(flags & MCP_REGISTERED)) - do_chan_mode(MODE_REGISTERED); + if (!(flags & MCP_REGISTERED) && (!(flags & MCP_IGN_REGISTERED) || add)) { + do_chan_mode(MODE_REGISTERED); ++ } else if (flags & MCP_IGN_REGISTERED) { ++ /* ignore the modechange but continue parsing */ + } else { + mod_chanmode_free(change); + return NULL; + } break; #undef do_chan_mode case 'l':