From ebe5b201aab71cf2ead1e068889be736314fbb73 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Wed, 3 Apr 2013 19:10:18 +0200 Subject: Migrate u_listmode.h into the core, change +b to use it --- src/modules/m_check.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/modules/m_check.cpp') 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 = "||| "; } @@ -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 stackresult; - std::vector 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(*ban); + banlm->DoSyncChannel(targchan, creator, user); + + // Show other listmodes as well FOREACH_MOD(I_OnSyncChannel,OnSyncChannel(targchan,creator,user)); dumpExt(user, checkstr, targchan); } -- cgit v1.3.1-10-gc9f91