diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-26 21:54:36 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-26 21:54:36 +0000 |
commit | f4d202cdbbcaa9e17c21e3f74d7816f58b2ffc6a (patch) | |
tree | 82709f66aa42e3ffcd96cd261a368d66f65a186c /src/modules/m_messageflood.cpp | |
parent | deb290af0f0200d530ba10e4c6c3f6a45b4971c5 (diff) |
Add extra method to mode handler, ModeHandler::ModeSet().
Returns a std::pair<bool,string>.
if the bool is true, the mode is set, and the second item in the pair is the parameter set on it, if any
If the bool is false, the mode is not set, and the parameter given is returned as the second item of the pair
To be used in mode bouncing, to build a safe set of bounced modes (dont ask yet)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4549 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_messageflood.cpp')
-rw-r--r-- | src/modules/m_messageflood.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 52fed00f0..7efe8e8ec 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -88,6 +88,15 @@ class MsgFlood : public ModeHandler public: MsgFlood() : ModeHandler('f', 1, 0, false, MODETYPE_CHANNEL, false) { } + std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + { + floodsettings* x; + if (channel->GetExt("flood",x)) + return std::make_pair(true, (x->ban ? "*" : "")+ConvToStr(x->lines)+":"+ConvToStr(x->secs)); + else + return std::make_pair(false, parameter); + } + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { floodsettings *f; |