summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-10-08 15:59:26 -0400
committerAdam <Adam@anope.org>2010-10-08 15:59:26 -0400
commit7e62fcf4b330ea95d20d21cfddeef736effdf903 (patch)
treeb8a683ab8bfef1923470a8a8da9fb38b25f4d095 /modules
parent21a61f162e876cbd61d04a0e430a9fdad2cd7750 (diff)
Fixed handling fmodes on inspircd12
Diffstat (limited to 'modules')
-rw-r--r--modules/protocol/inspircd12.cpp37
1 files changed, 16 insertions, 21 deletions
diff --git a/modules/protocol/inspircd12.cpp b/modules/protocol/inspircd12.cpp
index 6b50eff52..abcd53082 100644
--- a/modules/protocol/inspircd12.cpp
+++ b/modules/protocol/inspircd12.cpp
@@ -374,34 +374,29 @@ bool event_fmode(const Anope::string &source, const std::vector<Anope::string> &
return true;
Channel *c = findchan(params[0]);
+ if (!c)
+ return true;
+
/* Checking the TS for validity to avoid desyncs */
- if ((c = findchan(params[0])))
+ time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : 0;
+ if (c->creation_time > ts)
{
- time_t ts = Anope::string(params[1]).is_pos_number_only() ? convertTo<time_t>(params[1]) : 0;
- if (c->creation_time > ts)
- {
- /* Our TS is bigger, we should lower it */
- c->creation_time = ts;
- c->Reset();
- }
- else if (c->creation_time < ts)
- /* The TS we got is bigger, we should ignore this message. */
- return true;
+ /* Our TS is bigger, we should lower it */
+ c->creation_time = ts;
+ c->Reset();
}
- else
- /* Got FMODE for a non-existing channel */
+ else if (c->creation_time < ts)
+ /* The TS we got is bigger, we should ignore this message. */
return true;
/* TS's are equal now, so we can proceed with parsing */
std::vector<Anope::string> newparams;
- for (unsigned n = 0; n < params.size(); ++n)
- {
- if (n != 1)
- {
- newparams.push_back(params[n]);
- Log(LOG_DEBUG) << "Param: " << params[n];
- }
- }
+ newparams.push_back(params[0]);
+ newparams.push_back(params[1]);
+ Anope::string modes = params[2];
+ for (unsigned n = 3; n < params.size(); ++n)
+ modes += " " + params[n];
+ newparams.push_back(modes);
return event_mode(source, newparams);
}