diff options
-rw-r--r-- | include/u_listmode.h | 40 | ||||
-rw-r--r-- | src/modules/m_banexception.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_chanfilter.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_inviteexception.cpp | 8 |
4 files changed, 43 insertions, 11 deletions
diff --git a/include/u_listmode.h b/include/u_listmode.h index 6bcbb728a..ff62f2089 100644 --- a/include/u_listmode.h +++ b/include/u_listmode.h @@ -65,22 +65,22 @@ class ListModeBase : public ModeHandler infokey = "exceptionbase_mode_" + std::string(1, mode) + "_list"; } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) - { + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + { modelist* el; channel->GetExt(infokey, el); if (el) { - for (modelist::iterator it = el->begin(); it != el->end(); it++) - { - if(parameter == it->mask) - { + for (modelist::iterator it = el->begin(); it != el->end(); it++) + { + if(parameter == it->mask) + { return std::make_pair(true, parameter); } - } + } } return std::make_pair(false, parameter); - } + } virtual void DisplayList(userrec* user, chanrec* channel) { @@ -96,6 +96,30 @@ class ListModeBase : public ModeHandler user->WriteServ( "%s %s %s %s", endoflistnumeric.c_str(), user->nick, channel->name, endofliststring.c_str()); } + virtual void RemoveMode(chanrec* channel) + { + modelist* el; + channel->GetExt(infokey, el); + if (el) + { + char moderemove[MAXBUF]; + userrec* n = new userrec(ServerInstance); + n->SetFd(FD_MAGIC_NUMBER); + for(modelist::iterator it = el->begin(); it != el->end(); it++) + { + sprintf(moderemove,"-%c",this->GetModeChar()); + const char* parameters[] = { channel->name, moderemove, it->mask.c_str() }; + ServerInstance->SendMode(parameters, 3, n); + } + delete n; + } + } + + virtual void RemoveMode(userrec* user) + { + /* Listmodes dont get set on users */ + } + virtual void DoRehash() { ConfigReader Conf(ServerInstance); diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index 5f2f6f92a..9ac3d0dc7 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -93,11 +93,12 @@ public: virtual Version GetVersion() { - return Version(1, 0, 0, 3, VF_STATIC | VF_VENDOR); + return Version(1, 0, 0, 3, VF_COMMON | VF_VENDOR); } virtual ~ModuleBanException() { + ServerInstance->Modes->DelMode(be); DELETE(be); } }; diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index ed231df9c..458d1a29d 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -141,11 +141,12 @@ class ModuleChanFilter : public Module virtual Version GetVersion() { - return Version(1,0,0,1,VF_STATIC|VF_VENDOR); + return Version(1, 0, 0, 1, VF_COMMON | VF_VENDOR); } virtual ~ModuleChanFilter() { + ServerInstance->Modes->DelMode(cf); DELETE(cf); } }; diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index 234f7bfbc..c7cfa739e 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -95,7 +95,13 @@ public: virtual Version GetVersion() { - return Version(1, 0, 0, 3, VF_VENDOR | VF_STATIC); + return Version(1, 0, 0, 3, VF_VENDOR | VF_COMMON); + } + + ~ModuleInviteException() + { + ServerInstance->Modes->DelMode(ie); + DELETE(ie); } }; |