1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2007 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 * ---------------------------------------------------
14 // Globops and +g support module by C.J.Edwards
18 /* $ModDesc: Provides support for GLOBOPS and user mode +g */
22 class cmd_globops : public command_t
25 cmd_globops (InspIRCd* Instance) : command_t(Instance,"GLOBOPS",'o',1)
27 this->source = "m_globops.so";
28 syntax = "<any-text>";
29 TRANSLATE2(TR_TEXT, TR_END);
32 CmdResult Handle (const char** parameters, int pcnt, userrec *user)
34 std::string line = "From " + std::string(user->nick) + ": ";
35 for (int i = 0; i < pcnt; i++)
37 line = line + std::string(parameters[i]) + " ";
39 ServerInstance->SNO->WriteToSnoMask('g',line);
41 /* route it (ofc :p) */
46 class ModuleGlobops : public Module
48 cmd_globops* mycommand;
50 ModuleGlobops(InspIRCd* Me)
53 mycommand = new cmd_globops(ServerInstance);
54 ServerInstance->AddCommand(mycommand);
55 ServerInstance->SNO->EnableSnomask('g',"GLOBOPS");
58 virtual ~ModuleGlobops()
60 ServerInstance->SNO->DisableSnomask('g');
63 virtual Version GetVersion()
65 return Version(1, 1, 0, 1, VF_COMMON | VF_VENDOR, API_VERSION);
68 void Implements(char* List)
73 MODULE_INIT(ModuleGlobops)