* ---------------------------------------------------
*/
+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);
return 0;
}
}
+
+ virtual void On005Numeric(std::string &output)
+ {
+ std::stringstream line(output);
+ std::string temp1, temp2;
+ while (!line.eof())
+ {
+ line >> temp1;
+ if (temp1.substr(0,10) == "CHANMODES=")
+ {
+ // append the chanmode to the end
+ temp1 = temp1.substr(10,temp1.length());
+ temp1 = "CHANMODES=" + temp1 + "S";
+ }
+ temp2 = temp2 + temp1 + " ";
+ }
+ if (temp2.length())
+ output = temp2.substr(0,temp2.length()-1);
+ }
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 Version GetVersion()
{
// This is version 2 because version 1.x is the unreleased unrealircd module
- return Version(1,0,0,0);
+ return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
}
};
{
}
- virtual Module * CreateModule()
+ virtual Module * CreateModule(Server* Me)
{
- return new ModuleStripColor;
+ return new ModuleStripColor(Me);
}
};