/* $ModDesc: Provides more advanced UnrealIRCd SAMODE command */
-#include <stdio.h>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "inspircd.h"
/** Handle /SAMODE
std::deque<std::string> n;
irc::spacesepstream spaced(ServerInstance->Modes->GetLastParse());
std::string one = "*";
- while ((one = spaced.GetToken()) != "")
+ while (spaced.GetToken(one))
n.push_back(one);
- Event rmode((char *)&n, NULL, "send_mode_explicit");
+ Event rmode((char *)&n, NULL, "send_mode");
rmode.Send(ServerInstance);
n.clear();
/* XXX: Yes, this is right. We dont want to propogate the
* actual SAMODE command, just the MODE command generated
- * by the send_mode_explicit
+ * by the send_mode
*/
- return CMD_FAILURE;
+ return CMD_LOCALONLY;
}
else
{
cmd_samode* mycommand;
public:
ModuleSaMode(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
mycommand = new cmd_samode(ServerInstance);
virtual Version GetVersion()
{
- return Version(1,1,2,2,VF_VENDOR,API_VERSION);
+ return Version(1, 1, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
}
};
-
-class ModuleSaModeFactory : public ModuleFactory
-{
- public:
- ModuleSaModeFactory()
- {
- }
-
- ~ModuleSaModeFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleSaMode(Me);
- }
-
-};
-
-
-extern "C" void * init_module( void )
-{
- return new ModuleSaModeFactory;
-}
+MODULE_INIT(ModuleSaMode)