*/
-/* $ModDesc: Provides more advanced UnrealIRCd SAMODE command */
+/* $ModDesc: Provides command SAMODE to allow opers to change modes on channels and users */
#include "inspircd.h"
bool active;
CommandSamode(Module* Creator) : Command(Creator,"SAMODE", 2)
{
+ allow_empty_last_param = false;
flags_needed = 'o'; Penalty = 0; syntax = "<target> <modes> {<mode-parameters>}";
active = false;
}
this->active = true;
ServerInstance->Parser->CallHandler("MODE", parameters, user);
if (ServerInstance->Modes->GetLastParse().length())
- ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick) + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
+ ServerInstance->SNO->WriteGlobalSno('a', user->nick + " used SAMODE: " +ServerInstance->Modes->GetLastParse());
this->active = false;
return CMD_SUCCESS;
}
ModuleSaMode()
: cmd(this)
{
- ServerInstance->AddCommand(&cmd);
+ }
+
+ void init()
+ {
+ ServerInstance->Modules->AddService(cmd);
ServerInstance->Modules->Attach(I_OnPreMode, this);
}
Version GetVersion()
{
- return Version("Provides more advanced UnrealIRCd SAMODE command", VF_VENDOR);
+ return Version("Provides command SAMODE to allow opers to change modes on channels and users", VF_VENDOR);
}
ModResult OnPreMode(User* source,User* dest,Channel* channel, const std::vector<std::string>& parameters)