From 9bac1580319dacbb95ac22b906d3ee949e23db41 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 5 Jan 2010 19:02:36 +0000 Subject: Show channel listmodes (+beIg) in /CHECK output git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12243 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_cgiirc.cpp | 4 ++-- src/modules/m_check.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index 07cf3c376..01276275e 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -155,8 +155,8 @@ public: ServerInstance->Extensions.Register(&cmd.webirc_hostname); ServerInstance->Extensions.Register(&cmd.webirc_ip); - Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnSyncUser, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect }; - ServerInstance->Modules->Attach(eventlist, this, 6); + Implementation eventlist[] = { I_OnRehash, I_OnUserRegister, I_OnDecodeMetaData, I_OnUserDisconnect, I_OnUserConnect }; + ServerInstance->Modules->Attach(eventlist, this, 5); } diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index a907b06e8..831a8ba39 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -157,6 +157,20 @@ class CommandCheck : public Command user->SendText(checkstr + " member " + tmpbuf); } + irc::modestacker modestack(true); + std::string letter_b("b"); + 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(); + } + FOREACH_MOD(I_OnSyncChannel,OnSyncChannel(targchan,creator,user)); dumpExt(user, checkstr, targchan); } else @@ -211,6 +225,22 @@ class ModuleCheck : public Module { } + void ProtoSendMode(void* uv, TargetTypeFlags, void*, const std::vector& result, const std::vector&) + { + User* user = (User*)uv; + std::string checkstr(":"); + checkstr.append(ServerInstance->Config->ServerName); + checkstr.append(" 304 "); + checkstr.append(user->nick); + checkstr.append(" :CHECK modelist"); + for(unsigned int i=0; i < result.size(); i++) + { + checkstr.append(" "); + checkstr.append(result[i]); + } + user->SendText(checkstr); + } + Version GetVersion() { return Version("CHECK command, view user/channel details", VF_VENDOR|VF_OPTCOMMON); -- cgit v1.2.3