* ---------------------------------------------------
*/
-#include <stdio.h>
-#include <vector>
+#include "inspircd.h"
#include "users.h"
#include "channels.h"
-#include "inspircd.h"
#include "modules.h"
#include "wildcard.h"
public:
ModuleModesOnConnect(InspIRCd* Me)
- : Module::Module(Me)
+ : Module(Me)
{
Conf = new ConfigReader(ServerInstance);
if ((match(user->GetIPString(),hostn.c_str(),true)) || (match(user->host,hostn.c_str())))
{
std::string ThisModes = Conf->ReadValue("connect","modes",j);
- if (ThisModes != "")
+ if (!ThisModes.empty())
{
std::string buf;
stringstream ss(ThisModes);
tokens.push_back(buf);
int size = tokens.size() + 1;
- const char* modes[size];
+ const char** modes = new const char*[size];
modes[0] = user->nick;
modes[1] = tokens[0].c_str();
}
ServerInstance->Parser->CallHandler("MODE", modes, size, user);
+ delete [] modes;
}
break;
}
};
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
{
return new ModuleModesOnConnectFactory;
}