X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_kicknorejoin.cpp;h=16def4d7986f1cb291e59c380c85a106596d3bcf;hb=8e89fe75f9467969bce1dc6930befc6ef273edf6;hp=02f452cbae2dcef5ec8c0cd81dca07056f8a654a;hpb=7240c926c8e9aeacf95c2bd4803c8879963cca3f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 02f452cba..16def4d79 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * InspIRCd: (C) 2002-2008 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -46,7 +46,7 @@ class KickRejoin : public ModeHandler return (their_param < our_param); } - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding) + ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) { if (!adding) { @@ -55,7 +55,7 @@ class KickRejoin : public ModeHandler if (channel->GetExt("norejoinusers", dl)) { - DELETE(dl); + delete dl; channel->Shrink("norejoinusers"); } @@ -124,11 +124,13 @@ public: { kr = new KickRejoin(ServerInstance); - if (!ServerInstance->AddMode(kr)) + if (!ServerInstance->Modes->AddMode(kr)) throw ModuleException("Could not add new modes!"); + Implementation eventlist[] = { I_OnCleanup, I_OnChannelDelete, I_OnUserPreJoin, I_OnUserKick }; + ServerInstance->Modules->Attach(eventlist, this, 4); } - virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs) + virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven) { if (chan) { @@ -160,7 +162,7 @@ public: if (!dl->size()) { // Now it's empty.. - DELETE(dl); + delete dl; chan->Shrink("norejoinusers"); } } @@ -188,7 +190,7 @@ public: if (chan->GetExt("norejoinusers", dl)) { - DELETE(dl); + delete dl; chan->Shrink("norejoinusers"); } } @@ -199,20 +201,16 @@ public: OnChannelDelete((Channel*)item); } - virtual void Implements(char* List) - { - List[I_OnCleanup] = List[I_OnChannelDelete] = List[I_OnUserPreJoin] = List[I_OnUserKick] = 1; - } virtual ~ModuleKickNoRejoin() { ServerInstance->Modes->DelMode(kr); - DELETE(kr); + delete kr; } virtual Version GetVersion() { - return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); } };