X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_delayjoin.cpp;h=8b5e83e88b5b6d3e82ced1e3929aec1ec0165857;hb=b5e220008782b2d538cb8e6e3b1923af0c13fb99;hp=651cbb23e66aede32b25adf5beea7febe68fc921;hpb=ebab04970b30ad26fbd9dcba2e49c0ff7d41196f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index 651cbb23e..8b5e83e88 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -28,13 +28,12 @@ class DelayJoinMode : public ModeHandler class ModuleDelayJoin : public Module { private: - DelayJoinMode* djm; + DelayJoinMode djm; CUList nl; public: - ModuleDelayJoin(InspIRCd* Me) : Module(Me) + ModuleDelayJoin(InspIRCd* Me) : Module(Me), djm(Me, this) { - djm = new DelayJoinMode(ServerInstance, this); - if (!ServerInstance->Modes->AddMode(djm)) + if (!ServerInstance->Modes->AddMode(&djm)) throw ModuleException("Could not add new modes!"); Implementation eventlist[] = { I_OnUserJoin, I_OnUserPart, I_OnUserKick, I_OnUserQuit, I_OnNamesListItem, I_OnText, I_OnHostCycle }; ServerInstance->Modules->Attach(eventlist, this, 7); @@ -42,7 +41,7 @@ class ModuleDelayJoin : public Module virtual ~ModuleDelayJoin(); virtual Version GetVersion(); virtual void OnNamesListItem(User* issuer, User* user, Channel* channel, std::string &prefixes, std::string &nick); - virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent); + virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created); void CleanUser(User* user); bool OnHostCycle(User* user); void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent); @@ -76,8 +75,7 @@ ModeAction DelayJoinMode::OnModeChange(User* source, User* dest, Channel* channe ModuleDelayJoin::~ModuleDelayJoin() { - ServerInstance->Modes->DelMode(djm); - delete djm; + ServerInstance->Modes->DelMode(&djm); } Version ModuleDelayJoin::GetVersion() @@ -102,7 +100,7 @@ void ModuleDelayJoin::OnNamesListItem(User* issuer, User* user, Channel* channel nick.clear(); } -void ModuleDelayJoin::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent) +void ModuleDelayJoin::OnUserJoin(User* user, Channel* channel, bool sync, bool &silent, bool created) { if (channel->IsModeSet('D')) {