diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-10 17:14:59 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-10 17:14:59 +0000 |
commit | 3eefd1dfbdf611e526670b89dbd738e17c392c2c (patch) | |
tree | cb8f3727365ecd85c0b2f47d4ac1d37a333380c0 /src/modules/m_joinflood.cpp | |
parent | b4f14f68e498d219c7595cdc507accac63b6ec81 (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_joinflood.cpp')
-rw-r--r-- | src/modules/m_joinflood.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index cd233a01c..ac966cc39 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -101,6 +101,8 @@ class JoinFlood : public ModeHandler ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { + joinfloodsettings* dummy; + if (adding) { char ndata[MAXBUF]; @@ -132,11 +134,11 @@ class JoinFlood : public ModeHandler } else { - if (!channel->GetExt("joinflood")) + if (!channel->GetExt("joinflood", dummy)) { parameter = ConvToStr(njoins) + ":" +ConvToStr(nsecs); joinfloodsettings *f = new joinfloodsettings(nsecs,njoins); - channel->Extend("joinflood",(char*)f); + channel->Extend("joinflood", f); channel->SetMode('j', true); channel->SetModeParam('j', parameter.c_str(), true); return MODEACTION_ALLOW; @@ -151,9 +153,10 @@ class JoinFlood : public ModeHandler } else { - if (channel->GetExt("joinflood")) + if (channel->GetExt("joinflood", dummy)) { - joinfloodsettings *f = (joinfloodsettings*)channel->GetExt("joinflood"); + joinfloodsettings *f; + channel->GetExt("joinflood", f); DELETE(f); channel->Shrink("joinflood"); channel->SetMode('j', false); @@ -183,8 +186,8 @@ class ModuleJoinFlood : public Module { if (chan) { - joinfloodsettings *f = (joinfloodsettings*)chan->GetExt("joinflood"); - if (f) + joinfloodsettings *f; + if (chan->GetExt("joinflood", f)) { if (f->islocked()) { @@ -198,8 +201,8 @@ class ModuleJoinFlood : public Module virtual void OnUserJoin(userrec* user, chanrec* channel) { - joinfloodsettings *f = (joinfloodsettings*)channel->GetExt("joinflood"); - if (f) + joinfloodsettings *f; + if (channel->GetExt("joinflood",f)) { f->addjoin(); if (f->shouldlock()) @@ -213,9 +216,9 @@ class ModuleJoinFlood : public Module void OnChannelDelete(chanrec* chan) { - if (chan->GetExt("joinflood")) + joinfloodsettings *f; + if (chan->GetExt("joinflood",f)) { - joinfloodsettings *f = (joinfloodsettings*)chan->GetExt("joinflood"); DELETE(f); chan->Shrink("joinflood"); } |