+ irc::string x = cname;
+ if (!IS_LOCAL(user))
+ return MOD_RES_PASSTHRU;
+
+ // channel does not yet exist (record is null, about to be created IF we were to allow it)
+ if (!chan)
+ {
+ // user is not an oper and its not in the allow list
+ if ((!IS_OPER(user)) && (allowchans.find(x) == allowchans.end()))
+ {
+ user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Only IRC operators may create new channels",user->nick.c_str(),cname);
+ return MOD_RES_DENY;
+ }
+ }
+ return MOD_RES_PASSTHRU;