class AuditoriumMode : public ModeHandler
{
public:
- AuditoriumMode(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'u', 0, 0, false, MODETYPE_CHANNEL, false, 0, '@') { }
+ AuditoriumMode(Module* Creator) : ModeHandler(Creator, 'u', PARAM_NONE, MODETYPE_CHANNEL)
+ {
+ levelrequired = OP_VALUE;
+ }
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
bool ShowOps;
bool OperOverride;
public:
- ModuleAuditorium(InspIRCd* Me)
- : Module(Me), aum(Me, this)
+ ModuleAuditorium()
+ : aum(this)
{
if (!ServerInstance->Modes->AddMode(&aum))
throw ModuleException("Could not add new modes!");
OnRehash(NULL);
Implementation eventlist[] = { I_OnUserJoin, I_OnUserPart, I_OnUserKick, I_OnUserQuit, I_OnNamesListItem, I_OnRehash, I_OnHostCycle };
- Me->Modules->Attach(eventlist, this, 7);
+ ServerInstance->Modules->Attach(eventlist, this, 7);
}
~ModuleAuditorium()
{
- ServerInstance->Modes->DelMode(&aum);
}
void OnRehash(User* user)
{
- ConfigReader conf(ServerInstance);
+ ConfigReader conf;
ShowOps = conf.ReadFlag("auditorium", "showops", 0);
OperOverride = conf.ReadFlag("auditorium", "operoverride", 0);
}
Version GetVersion()
{
- return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("Allows for auditorium channels (+u) where nobody can see others joining and parting or the nick list", VF_COMMON | VF_VENDOR, API_VERSION);
}
void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick)