diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-27 19:40:47 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-07-27 19:40:47 +0000 |
commit | a1f073f66f4b985bf776b9be2015136209c0c311 (patch) | |
tree | 1413b1367e52ece46803c5d8fb57325c5ebbfd22 /src/modules | |
parent | 98a92e20f1fa4a9c7e5749e063414483d4615c2e (diff) |
Change std::pair<bool,std::string> to neater typedef "ModePair"
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4557 e03df62e-2008-0410-955e-edbf42e46eb7
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? |