diff options
| author | 2013-04-03 19:10:18 +0200 | |
|---|---|---|
| committer | 2013-04-08 23:13:24 +0200 | |
| commit | ebe5b201aab71cf2ead1e068889be736314fbb73 (patch) | |
| tree | 33bc1cc227073304f5e25731fa35a60cfd2712a3 /src/modules/m_check.cpp | |
| parent | Add builtin modes using AddService() (diff) | |
Migrate u_listmode.h into the core, change +b to use it
Diffstat (limited to 'src/modules/m_check.cpp')
| -rw-r--r-- | src/modules/m_check.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index a19b20477..662e512f9 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -23,13 +23,17 @@ /* $ModDesc: Provides the /CHECK command to retrieve information on a user, channel, hostname or IP address */ #include "inspircd.h" +#include "listmode.h" /** Handle /CHECK */ class CommandCheck : public Command { + ModeReference ban; public: - CommandCheck(Module* parent) : Command(parent,"CHECK", 1) + CommandCheck(Module* parent) + : Command(parent,"CHECK", 1) + , ban(parent, "ban") { flags_needed = 'o'; syntax = "<nickname>|<ip>|<hostmask>|<channel> <server>"; } @@ -198,18 +202,11 @@ class CommandCheck : public Command user->SendText(checkstr + " member " + tmpbuf); } - irc::modestacker modestack(true); - for(BanList::iterator b = targchan->bans.begin(); b != targchan->bans.end(); ++b) - { - modestack.Push('b', b->data); - } - std::vector<std::string> stackresult; - std::vector<TranslateType> dummy; - while (modestack.GetStackedLine(stackresult)) - { - creator->ProtoSendMode(user, TYPE_CHANNEL, targchan, stackresult, dummy); - stackresult.clear(); - } + // We know that the mode handler for bans is in the core and is derived from ListModeBase + ListModeBase* banlm = static_cast<ListModeBase*>(*ban); + banlm->DoSyncChannel(targchan, creator, user); + + // Show other listmodes as well FOREACH_MOD(I_OnSyncChannel,OnSyncChannel(targchan,creator,user)); dumpExt(user, checkstr, targchan); } |
