From 98a92e20f1fa4a9c7e5749e063414483d4615c2e Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 27 Jul 2006 17:59:20 +0000 Subject: Mode merging during FJOIN with ourts==theirts. Only +k and +l have CheckTimestamp methods atm, needs to be finished by me and TIDIED. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4556 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modes/cmode_k.cpp | 5 +++++ src/modes/cmode_l.cpp | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src/modes') diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp index 5e55ce972..e54aa688a 100644 --- a/src/modes/cmode_k.cpp +++ b/src/modes/cmode_k.cpp @@ -20,6 +20,11 @@ std::pair ModeChannelKey::ModeSet(userrec* source, userrec* de } } +bool ModeChannelKey::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 channel key wins */ + return (their_param < our_param); +} ModeAction ModeChannelKey::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp index a5fa5329b..89d67026c 100644 --- a/src/modes/cmode_l.cpp +++ b/src/modes/cmode_l.cpp @@ -20,6 +20,12 @@ std::pair ModeChannelLimit::ModeSet(userrec* source, userrec* } } +bool ModeChannelLimit::CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, chanrec* channel) +{ + /* When TS is equal, the higher channel limit wins */ + return (atoi(their_param.c_str()) < atoi(our_param.c_str())); +} + ModeAction ModeChannelLimit::OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) { if (adding) -- cgit v1.2.3