using namespace std;
-#include <stdio.h>
-#include <string>
#include "users.h"
#include "channels.h"
#include "modules.h"
-#include "helperfuncs.h"
#include "inspircd.h"
/* $ModDesc: Provides channel +S mode (strip ansi colour) */
-extern InspIRCd* ServerInstance;
-
class ChannelStripColor : public ModeHandler
{
public:
- ChannelStripColor() : ModeHandler('S', 0, 0, false, MODETYPE_CHANNEL, false) { }
+ ChannelStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_CHANNEL, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
{
class UserStripColor : public ModeHandler
{
public:
- UserStripColor() : ModeHandler('S', 0, 0, false, MODETYPE_USER, false) { }
+ UserStripColor(InspIRCd* Instance) : ModeHandler(Instance, 'S', 0, 0, false, MODETYPE_USER, false) { }
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding)
{
class ModuleStripColor : public Module
{
- Server *Srv;
+
ConfigReader *Conf, *MyConf;
ChannelStripColor *csc;
UserStripColor *usc;
public:
- ModuleStripColor(Server* Me)
+ ModuleStripColor(InspIRCd* Me)
: Module::Module(Me)
{
- Srv = Me;
+
- usc = new UserStripColor();
- csc = new ChannelStripColor();
+ usc = new UserStripColor(ServerInstance);
+ csc = new ChannelStripColor(ServerInstance);
- Srv->AddMode(usc, 'S');
- Srv->AddMode(csc, 'S');
+ ServerInstance->AddMode(usc, 'S');
+ ServerInstance->AddMode(csc, 'S');
}
void Implements(char* List)
{
- List[I_On005Numeric] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
+ List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
}
- virtual void On005Numeric(std::string &output)
- {
- ServerInstance->ModeGrok->InsertMode(output,"S",4);
- }
-
virtual ~ModuleStripColor()
{
DELETE(usc);
{
}
- virtual Module * CreateModule(Server* Me)
+ virtual Module * CreateModule(InspIRCd* Me)
{
return new ModuleStripColor(Me);
}