return std::make_pair(false, parameter);
}
- bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel)
- {
- /* When TS is equal, the alphabetically later one wins */
- return (their_param < our_param);
- }
-
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool)
{
nickfloodsettings* dummy;
class ModuleNickFlood : public Module
{
- NickFlood* jf;
+ NickFlood jf;
public:
ModuleNickFlood(InspIRCd* Me)
- : Module(Me)
+ : Module(Me), jf(Me)
{
-
- jf = new NickFlood(ServerInstance);
- if (!ServerInstance->Modes->AddMode(jf))
+ if (!ServerInstance->Modes->AddMode(&jf))
throw ModuleException("Could not add new modes!");
Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreNick, I_OnUserPostNick };
ServerInstance->Modules->Attach(eventlist, this, 3);
/*
* XXX: HACK: We do the increment on the *POST* event here (instead of all together) because we have no way of knowing whether other modules would block a nickchange.
*/
- virtual void OnUserPostNick(User* user, const std::string oldnick)
+ virtual void OnUserPostNick(User* user, const std::string &oldnick)
{
if (isdigit(user->nick[0])) /* allow switches to UID */
return;
virtual ~ModuleNickFlood()
{
- ServerInstance->Modes->DelMode(jf);
- delete jf;
+ ServerInstance->Modes->DelMode(&jf);
}
virtual Version GetVersion()