X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_wallops.cpp;h=e0e832ff7a413d6ecdda2863f9d3a861e36f585f;hb=992674362c5f64bdb8e1942eeaa7612524529cd6;hp=0effa3c5a88b9da8b553a993338af624312eb368;hpb=44f42a13de52c8025942ddab42f51feb36821782;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_wallops.cpp b/src/commands/cmd_wallops.cpp index 0effa3c5a..e0e832ff7 100644 --- a/src/commands/cmd_wallops.cpp +++ b/src/commands/cmd_wallops.cpp @@ -27,10 +27,19 @@ */ class CommandWallops : public Command { + UserModeReference wallopsmode; + public: /** Constructor for wallops. */ - CommandWallops ( Module* parent) : Command(parent,"WALLOPS",1,1) { flags_needed = 'o'; syntax = ""; } + CommandWallops(Module* parent) + : Command(parent, "WALLOPS", 1, 1) + , wallopsmode(parent, "wallops") + { + flags_needed = 'o'; + syntax = ""; + } + /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command @@ -38,6 +47,11 @@ class CommandWallops : public Command * @return A value from CmdResult to indicate command success or failure. */ CmdResult Handle(const std::vector& parameters, User *user); + + RouteDescriptor GetRouting(User* user, const std::vector& parameters) + { + return ROUTE_BROADCAST; + } }; CmdResult CommandWallops::Handle (const std::vector& parameters, User *user) @@ -45,14 +59,13 @@ CmdResult CommandWallops::Handle (const std::vector& parameters, Us std::string wallop("WALLOPS :"); wallop.append(parameters[0]); - for (std::vector::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++) + for (LocalUserList::const_iterator i = ServerInstance->Users->local_users.begin(); i != ServerInstance->Users->local_users.end(); i++) { User* t = *i; - if (t->IsModeSet('w')) + if (t->IsModeSet(wallopsmode)) user->WriteTo(t,wallop); } - FOREACH_MOD(I_OnWallops,OnWallops(user,parameters[0])); return CMD_SUCCESS; }