* ---------------------------------------------------
*/
+using namespace std;
+
#include <stdio.h>
#include <string>
#include "users.h"
ConfigReader *Conf, *MyConf;
public:
- ModuleStripColor()
+ ModuleStripColor(Server* Me)
+ : Module::Module(Me)
{
- Srv = new Server;
+ Srv = Me;
Srv->AddExtendedMode('S',MT_CHANNEL,false,0,0);
Srv->AddExtendedMode('S',MT_CLIENT,false,0,0);
virtual ~ModuleStripColor()
{
- delete Srv;
}
// ANSI colour stripping by Doc (Peter Wood)
char sentence[MAXBUF];
strncpy(sentence,text.c_str(),MAXBUF);
- len = strlen (sentence);
+ len = strlen(sentence);
for (i = 0; i < len; i++)
{
case 3:
remove = 1;
- if (isdigit (sentence[i + remove]))
+ if (isdigit(sentence[i + remove]))
remove++;
- if (isdigit (sentence[i + remove]))
+ if (isdigit(sentence[i + remove]))
remove++;
if (sentence[i + remove] == ',')
{
remove += 2;
- if (isdigit (sentence[i + remove]))
- remove++;
+ if (isdigit(sentence[i + remove]))
+ remove++;
}
break;
}
- if (remove != 0) {
+ if (remove != 0)
+ {
len -= remove;
for (a = i; a <= len; a++)
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleStripColor;
+ return new ModuleStripColor(Me);
}
};