* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
* ---------------------------------------------------
*/
+using namespace std;
+
#include <stdio.h>
#include "users.h"
#include "channels.h"
/* $ModDesc: Provides support for unreal-style oper-override */
-char dummyvalue[] = "on";
-
class ModuleOverride : public Module
{
Server *Srv;
public:
- ModuleOverride()
+ ModuleOverride(Server* Me)
+ : Module::Module(Me)
{
// here we initialise our module. Use new to create new instances of the required
// classes.
- Srv = new Server;
+ Srv = Me;
Conf = new ConfigReader;
// read our config options (main config file)
NoisyOverride = Conf->ReadFlag("override","noisy",0);
}
- virtual void OnRehash()
+ virtual void OnRehash(std::string parameter)
{
// on a rehash we delete our classes for good measure and create them again.
delete Conf;
NoisyOverride = Conf->ReadFlag("override","noisy",0);
}
+ void Implements(char* List)
+ {
+ List[I_OnRehash] = List[I_OnAccessCheck] = List[I_On005Numeric] = List[I_OnUserPreJoin] = 1;
+ }
+
virtual void On005Numeric(std::string &output)
{
output = output + std::string(" OVERRIDE");
{
if (NoisyOverride)
{
- if (!user->IsInvited(chan->name))
+ irc::string x = chan->name;
+ if (!user->IsInvited(x))
{
WriteChannelWithServ((char*)Srv->GetServerName().c_str(),chan,"NOTICE %s :%s invited himself into the channel",cname,user->nick);
}
virtual ~ModuleOverride()
{
delete Conf;
- delete Srv;
}
virtual Version GetVersion()
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleOverride;
+ return new ModuleOverride(Me);
}
};