From f63fee17a950dfc6128179e176181ea41a35f784 Mon Sep 17 00:00:00 2001 From: danieldg Date: Wed, 2 Sep 2009 00:45:55 +0000 Subject: Include untranslated user/channel metadata in CHECK output git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11609 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_check.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 42be6a350..6ba578194 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -21,7 +21,7 @@ class CommandCheck : public Command { Module* Parent; public: - bool md_sent; + std::set meta_seen; CommandCheck (InspIRCd* Instance, Module* parent) : Command(Instance,"CHECK", "o", 1), Parent(parent) { this->source = "m_check.so"; @@ -36,6 +36,21 @@ class CommandCheck : public Command return std::string(timebuf); } + void dumpExtra(User* user, std::string checkstr, Extensible* ext) + { + std::deque extlist; + ext->GetExtList(extlist); + std::stringstream dumpkeys; + for(std::deque::iterator i = extlist.begin(); i != extlist.end(); i++) + { + if (meta_seen.find(*i) == meta_seen.end()) + dumpkeys << " " << *i; + } + meta_seen.clear(); + if (!dumpkeys.str().empty()) + ServerInstance->DumpText(user,checkstr + " metadata ", dumpkeys); + } + CmdResult Handle (const std::vector ¶meters, User *user) { User *targuser; @@ -100,6 +115,7 @@ class CommandCheck : public Command ServerInstance->DumpText(user,checkstr + " onchans ", dump); FOREACH_MOD_I(ServerInstance,I_OnSyncUser,OnSyncUser(targuser,Parent,(void*)user)); + dumpExtra(user, checkstr, targuser); } else if (targchan) { @@ -133,6 +149,7 @@ class CommandCheck : public Command } FOREACH_MOD_I(ServerInstance,I_OnSyncChannel,OnSyncChannel(targchan,Parent,(void*)user)); + dumpExtra(user, checkstr, targchan); } else { @@ -188,7 +205,7 @@ class ModuleCheck : public Module { User* user = static_cast(opaque); user->WriteServ("304 " + std::string(user->nick) + " :CHECK meta:" + name + " " + value); - mycommand.md_sent = true; + mycommand.meta_seen.insert(name); } virtual std::string ProtoTranslate(Extensible* item) -- cgit v1.2.3