1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
15 #include "commands/cmd_modules.h"
17 extern "C" DllExport Command* init_command(InspIRCd* Instance)
19 return new CommandModules(Instance);
24 CmdResult CommandModules::Handle (const std::vector<std::string>&, User *user)
26 std::vector<std::string> module_names = ServerInstance->Modules->GetAllModuleNames(0);
28 for (unsigned int i = 0; i < module_names.size(); i++)
30 Module* m = ServerInstance->Modules->Find(module_names[i]);
31 Version V = m->GetVersion();
33 if (user->HasPrivPermission("servers/auspex"))
35 std::string flags("Svsc");
37 for (int mult = 1; mult <= VF_SERVICEPROVIDER; mult *= 2, ++pos)
38 if (!(V.Flags & mult))
41 user->WriteNumeric(702, "%s :0x%08lx %s %s :%s", user->nick.c_str(), (unsigned long)m, module_names[i].c_str(), flags.c_str(), V.version.c_str());
45 user->WriteNumeric(702, "%s :%s",user->nick.c_str(), module_names[i].c_str());
48 user->WriteNumeric(703, "%s :End of MODULES list",user->nick.c_str());