- bool candepriv_founder = (DeprivOthers && source->GetExt(founder));
- bool candepriv_protected = (source->GetExt(founder) || (DeprivOthers && source->GetExt(protect))); // Can the source remove +a?
-
- switch (access_type)
- {
- // a user has been deopped. Do we let them? hmmm...
- case AC_DEOP:
- if (dest->GetExt(founder) && !candepriv_founder)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't deop "+dest->nick+" as they're a channel founder");
- return MOD_RES_DENY;
- }
- if ((dest->GetExt(protect)) && !candepriv_protected)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't deop "+dest->nick+" as they're protected (+a)");
- return MOD_RES_DENY;
- }
- break;
-
- // a user is being kicked. do we chop off the end of the army boot?
- case AC_KICK:
- if (dest->GetExt(founder) && !candepriv_founder)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't kick "+dest->nick+" as they're a channel founder");
- return MOD_RES_DENY;
- }
- if ((dest->GetExt(protect)) && !candepriv_protected)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't kick "+dest->nick+" as they're protected (+a)");
- return MOD_RES_DENY;
- }
- break;
-
- // a user is being dehalfopped. Yes, we do disallow -h of a +ha user
- case AC_DEHALFOP:
- if (dest->GetExt(founder) && !candepriv_founder)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't de-halfop "+dest->nick+" as they're a channel founder");
- return MOD_RES_DENY;
- }
- if ((dest->GetExt(protect)) && !candepriv_protected)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't de-halfop "+dest->nick+" as they're protected (+a)");
- return MOD_RES_DENY;
- }
- break;
-
- // same with devoice.
- case AC_DEVOICE:
- if (dest->GetExt(founder) && !candepriv_founder)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't devoice "+dest->nick+" as they're a channel founder");
- return MOD_RES_DENY;
- }
- if ((dest->GetExt(protect)) && !candepriv_protected)
- {
- source->WriteNumeric(484, source->nick+" "+channel->name+" :Can't devoice "+dest->nick+" as they're protected (+a)");
- return MOD_RES_DENY;
- }
- break;
- }
-
- // we dont know what this access check is, or dont care. just carry on, nothing to see here.