diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:45:55 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:45:55 +0000 |
commit | f63fee17a950dfc6128179e176181ea41a35f784 (patch) | |
tree | 00e683a8633ff144406094f72e1c74d289d817c8 /src/modules/m_check.cpp | |
parent | 7c340cba11b16d3c4a95c274c22f1617ac4711f2 (diff) |
Include untranslated user/channel metadata in CHECK output
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11609 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_check.cpp')
-rw-r--r-- | src/modules/m_check.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
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<std::string> 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<std::string> extlist; + ext->GetExtList(extlist); + std::stringstream dumpkeys; + for(std::deque<std::string>::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<std::string> ¶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<User*>(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) |