1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2010 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Provides support for unreal-style channel mode +Q */
18 class NoKicks : public SimpleChannelModeHandler
21 NoKicks(Module* Creator) : SimpleChannelModeHandler(Creator, "nokick", 'Q') { }
24 class ModuleNoKicks : public Module
32 if (!ServerInstance->Modes->AddMode(&nk))
33 throw ModuleException("Could not add new modes!");
34 Implementation eventlist[] = { I_OnUserPreKick, I_On005Numeric };
35 ServerInstance->Modules->Attach(eventlist, this, 2);
38 void On005Numeric(std::string &output)
40 ServerInstance->AddExtBanChar('Q');
43 ModResult OnUserPreKick(User* source, Membership* memb, const std::string &reason)
45 if (!memb->chan->GetExtBanStatus(source, 'Q').check(!memb->chan->IsModeSet('Q')))
47 if ((ServerInstance->ULine(source->nick.c_str())) || ServerInstance->ULine(source->server))
49 // ulines can still kick with +Q in place
50 return MOD_RES_PASSTHRU;
54 // nobody else can (not even opers with override, and founders)
55 source->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s %s :Can't kick user %s from channel (+Q set)",source->nick.c_str(), memb->chan->name.c_str(), memb->user->nick.c_str());
59 return MOD_RES_PASSTHRU;
68 return Version("Provides support for unreal-style channel mode +Q", VF_VENDOR);
73 MODULE_INIT(ModuleNoKicks)