summaryrefslogtreecommitdiff
path: root/src/modules/m_messageflood.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 17:14:59 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 17:14:59 +0000
commit3eefd1dfbdf611e526670b89dbd738e17c392c2c (patch)
treecb8f3727365ecd85c0b2f47d4ac1d37a333380c0 /src/modules/m_messageflood.cpp
parentb4f14f68e498d219c7595cdc507accac63b6ec81 (diff)
Change to templated GetExt()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4284 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_messageflood.cpp')
-rw-r--r--src/modules/m_messageflood.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 04f9766d5..b41c71da9 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -90,6 +90,8 @@ class MsgFlood : public ModeHandler
ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string &parameter, bool adding)
{
+ floodsettings *f;
+
if (adding)
{
char ndata[MAXBUF];
@@ -131,11 +133,11 @@ class MsgFlood : public ModeHandler
}
else
{
- if (!channel->GetExt("flood"))
+ if (!channel->GetExt("flood", f))
{
parameter = ConvToStr(nlines) + ":" +ConvToStr(nsecs);
floodsettings *f = new floodsettings(ban,nsecs,nlines);
- channel->Extend("flood",(char*)f);
+ channel->Extend("flood",f);
channel->SetMode('f', true);
channel->SetModeParam('f', parameter.c_str(), true);
return MODEACTION_ALLOW;
@@ -151,9 +153,8 @@ class MsgFlood : public ModeHandler
}
else
{
- if (channel->GetExt("flood"))
+ if (channel->GetExt("flood", f))
{
- floodsettings *f = (floodsettings*)channel->GetExt("flood");
DELETE(f);
channel->Shrink("flood");
channel->SetMode('f', false);
@@ -184,8 +185,8 @@ class ModuleMsgFlood : public Module
{
if (IS_LOCAL(user))
{
- floodsettings *f = (floodsettings*)dest->GetExt("flood");
- if (f)
+ floodsettings *f;
+ if (dest->GetExt("flood", f))
{
f->addmessage(user);
if (f->shouldkick(user))
@@ -236,9 +237,9 @@ class ModuleMsgFlood : public Module
void OnChannelDelete(chanrec* chan)
{
- if (chan->GetExt("flood"))
+ floodsettings* f;
+ if (chan->GetExt("flood", f))
{
- floodsettings *f = (floodsettings*)chan->GetExt("flood");
DELETE(f);
chan->Shrink("flood");
}