/* This is an oper-only mode */
OperChans(InspIRCd* Instance) : ModeHandler(Instance, 'O', 0, 0, false, MODETYPE_CHANNEL, true) { }
- ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
+ ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
if (adding)
{
{
oc = new OperChans(ServerInstance);
- if (!ServerInstance->AddMode(oc, 'O'))
+ if (!ServerInstance->AddMode(oc))
throw ModuleException("Could not add new modes!");
+ Implementation eventlist[] = { I_OnUserPreJoin };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
}
void Implements(char* List)
List[I_OnUserPreJoin] = 1;
}
- virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname, std::string &privs)
+ virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs)
{
if (!IS_OPER(user))
{
virtual ~ModuleOperChans()
{
ServerInstance->Modes->DelMode(oc);
- DELETE(oc);
+ delete oc;
}
virtual Version GetVersion()