/* +------------------------------------+ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * * InspIRCd: (C) 2002-2010 InspIRCd Development Team * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. * * --------------------------------------------------- */ #include "inspircd.h" class ModeChannelHalfOp : public ModeHandler { public: ModeChannelHalfOp(Module* parent); ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding); unsigned int GetPrefixRank(); ModResult AccessCheck(User* src, Channel*, std::string& value, bool adding) { if (!adding && src->nick == value) return MOD_RES_ALLOW; return MOD_RES_PASSTHRU; } }; ModeChannelHalfOp::ModeChannelHalfOp(Module* parent) : ModeHandler(parent, "halfop", 'h', PARAM_ALWAYS, MODETYPE_CHANNEL) { list = true; prefix = '%'; levelrequired = OP_VALUE; m_paramtype = TR_NICK; fixed_letter = false; } unsigned int ModeChannelHalfOp::GetPrefixRank() { return HALFOP_VALUE; } ModeAction ModeChannelHalfOp::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { return MODEACTION_ALLOW; } class ModuleHalfop : public Module { ModeChannelHalfOp mh; public: ModuleHalfop() : mh(this) { ServerInstance->Modules->AddService(mh); } ~ModuleHalfop() { ServerInstance->Modes->DelMode(&mh); } Version GetVersion() { return Version("Channel half-operator mode provider", VF_VENDOR); } }; MODULE_INIT(ModuleHalfop)