-
- virtual int OnAccessCheck(userrec* source,userrec* dest,chanrec* channel,int access_type)
- {
- if (*source->oper)
- {
- if (source && channel)
- {
- // Fix by brain - allow the change if they arent on channel - rely on boolean short-circuit
- // to not check the other items in the statement if they arent on the channel
- int mode = channel->GetStatus(source);
- if ((!channel->HasUser(source)) || ((mode != STATUS_HOP) && (mode != STATUS_OP)))
- {
- switch (access_type)
- {
- case AC_DEOP:
- if (CanOverride(source,"MODEDEOP"))
- {
- ServerInstance->SNO->WriteToSnoMask('O',"NOTICE: "+std::string(source->nick)+" Override-Deopped "+std::string(dest->nick)+" on "+std::string(channel->name));
- return ACR_ALLOW;
- }
- else
- {
- return ACR_DEFAULT;
- }
-
- case AC_OP:
- if (CanOverride(source,"MODEOP"))
- {
- ServerInstance->SNO->WriteToSnoMask('O',"NOTICE: "+std::string(source->nick)+" Override-Opped "+std::string(dest->nick)+" on "+std::string(channel->name));
- return ACR_ALLOW;
- }
- else
- {
- return ACR_DEFAULT;
- }
-
- case AC_VOICE:
- if (CanOverride(source,"MODEVOICE"))
- {
- ServerInstance->SNO->WriteToSnoMask('O',"NOTICE: "+std::string(source->nick)+" Override-Voiced "+std::string(dest->nick)+" on "+std::string(channel->name));
- return ACR_ALLOW;
- }
- else
- {
- return ACR_DEFAULT;
- }