* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
/** Holds settings and state associated with channel mode +j
*/
-class joinfloodsettings : public classbase
+class joinfloodsettings
{
public:
int secs;
JoinFlood(Module* Creator) : ModeHandler(Creator, "joinflood", 'j', PARAM_SETONLY, MODETYPE_CHANNEL),
ext("joinflood", Creator) { }
- ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter)
- {
- joinfloodsettings* x = ext.get(channel);
- if (x)
- return std::make_pair(true, ConvToStr(x->joins)+":"+ConvToStr(x->secs));
- else
- return std::make_pair(false, parameter);
- }
-
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding)
{
if (adding)
if (!ServerInstance->Modes->AddMode(&jf))
throw ModuleException("Could not add new modes!");
ServerInstance->Extensions.Register(&jf.ext);
- Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreJoin, I_OnUserJoin };
- ServerInstance->Modules->Attach(eventlist, this, 3);
+ Implementation eventlist[] = { I_OnUserPreJoin, I_OnUserJoin };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
}
ModResult OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven)
Version GetVersion()
{
- return Version("Provides channel mode +j (join flood protection)", VF_COMMON | VF_VENDOR, API_VERSION);
+ return Version("Provides channel mode +j (join flood protection)", VF_VENDOR);
}
};