diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_chanprotect.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_joinflood.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_kicknorejoin.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_messageflood.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_redirect.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 4 |
6 files changed, 32 insertions, 8 deletions
diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 675e95e96..95bb06a13 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -31,7 +31,7 @@ class ChanFounder : public ModeHandler public: ChanFounder(Server* s) : ModeHandler('q', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { userrec* x = Find(parameter); if (x) @@ -135,7 +135,7 @@ class ChanProtect : public ModeHandler public: ChanProtect(Server* s) : ModeHandler('a', 1, 1, true, MODETYPE_CHANNEL, false), Srv(s) { } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { userrec* x = Find(parameter); if (x) diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 0d038b48d..3068c5209 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -99,7 +99,7 @@ class JoinFlood : public ModeHandler public: JoinFlood() : ModeHandler('j', 1, 0, false, MODETYPE_CHANNEL, false) { } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { joinfloodsettings* x; if (channel->GetExt("joinflood",x)) @@ -108,6 +108,12 @@ class JoinFlood : public ModeHandler return std::make_pair(false, parameter); } + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel) + { + /* When TS is equal, the alphabetically later one wins */ + return (their_param < our_param); + } + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { joinfloodsettings* dummy; diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 97b766e36..4f415b8a9 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -25,7 +25,7 @@ class KickRejoin : public ModeHandler public: KickRejoin() : ModeHandler('J', 1, 0, false, MODETYPE_CHANNEL, false) { } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { if (channel->IsModeSet('J')) return std::make_pair(true, channel->GetModeParameter('J')); @@ -33,6 +33,12 @@ class KickRejoin : public ModeHandler return std::make_pair(false, parameter); } + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel) + { + /* When TS is equal, the alphabetically later one wins */ + return (their_param < our_param); + } + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { if (!adding) diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 7efe8e8ec..f322a63e6 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -88,7 +88,7 @@ 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) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { floodsettings* x; if (channel->GetExt("flood",x)) @@ -97,6 +97,12 @@ class MsgFlood : public ModeHandler return std::make_pair(false, parameter); } + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel) + { + /* When TS is equal, the alphabetically later one wins */ + return (their_param < our_param); + } + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { floodsettings *f; diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index b289c1a0e..7493b5c65 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -30,7 +30,7 @@ class Redirect : public ModeHandler public: Redirect(Server* s) : ModeHandler('L', 1, 0, false, MODETYPE_CHANNEL, false), Srv(s) { } - std::pair<bool,std::string> ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) + ModePair ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter) { if (channel->IsModeSet('L')) return std::make_pair(true, channel->GetModeParameter('L')); @@ -38,6 +38,12 @@ class Redirect : public ModeHandler return std::make_pair(false, parameter); } + bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel) + { + /* When TS is equal, the alphabetically later one wins */ + return (their_param < our_param); + } + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { if (adding) diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 77929b382..59b82fb5a 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -980,7 +980,7 @@ class TreeSocket : public InspSocket * modes with parameters, we are going to rewrite * those parameters */ - std::pair<bool, std::string> ret; + ModePair ret; adding ? cur_change = '+' : cur_change = '-'; ret = mh->ModeSet(smode ? NULL : who, dst, chan, params[paramptr]); @@ -1167,7 +1167,7 @@ class TreeSocket : public InspSocket */ if (mh) { - std::pair<bool, std::string> ret; + ModePair ret; std::string p = ""; /* Does the mode require a parameter right now? |