mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-22 17:09:03 -04:00
Stripcolor completed
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4214 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
6dfc984709
commit
f9900a3e43
@ -94,6 +94,8 @@ class ModuleStripColor : public Module
|
||||
{
|
||||
Server *Srv;
|
||||
ConfigReader *Conf, *MyConf;
|
||||
ChannelStripColor *csc;
|
||||
UserStripColor *usc;
|
||||
|
||||
public:
|
||||
ModuleStripColor(Server* Me)
|
||||
@ -101,26 +103,16 @@ class ModuleStripColor : public Module
|
||||
{
|
||||
Srv = Me;
|
||||
|
||||
Srv->AddExtendedMode('S',MT_CHANNEL,false,0,0);
|
||||
Srv->AddExtendedMode('S',MT_CLIENT,false,0,0);
|
||||
usc = new UserStripColor();
|
||||
csc = new ChannelStripColor();
|
||||
|
||||
Srv->AddMode(usc, 'S');
|
||||
Srv->AddMode(csc, 'S');
|
||||
}
|
||||
|
||||
void Implements(char* List)
|
||||
{
|
||||
List[I_OnExtendedMode] = List[I_On005Numeric] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
|
||||
}
|
||||
|
||||
virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
|
||||
{
|
||||
// check if this is our mode character...
|
||||
if (modechar == 'S')
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
List[I_On005Numeric] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
|
||||
}
|
||||
|
||||
virtual void On005Numeric(std::string &output)
|
||||
@ -130,6 +122,8 @@ class ModuleStripColor : public Module
|
||||
|
||||
virtual ~ModuleStripColor()
|
||||
{
|
||||
DELETE(usc);
|
||||
DELETE(csc);
|
||||
}
|
||||
|
||||
// ANSI colour stripping by Doc (Peter Wood)
|
||||
@ -139,7 +133,7 @@ class ModuleStripColor : public Module
|
||||
char sentence[MAXBUF];
|
||||
strlcpy(sentence,text.c_str(),MAXBUF);
|
||||
|
||||
len = strlen(sentence);
|
||||
len = text.length();
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user