diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-09 23:23:27 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-09 23:23:27 +0000 |
commit | 9bb905229d832827b585e589bfcd99625be313f2 (patch) | |
tree | 52debd7d35c25a563c3af2df47d440abdaca33e5 | |
parent | f98a3a85d688c40640c4821ae50a6728037a43a8 (diff) |
Backport of bugfix for bug #1020 from SVN r2150, read and write the mlock for flood and redirect regardless of the IRCd's setting for the mode.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2151 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/chanserv.c | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/src/chanserv.c b/src/chanserv.c index 79a4edb05..4fdaa212c 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -665,30 +665,12 @@ void load_cs_dbase(void) SAFE(read_int32(&ci->mlock_limit, f)); SAFE(read_string(&ci->mlock_key, f)); if (ver >= 10) { - if (ircd->fmode) { - SAFE(read_string(&ci->mlock_flood, f)); - } else { - SAFE(read_string(&s, f)); - if (s) - free(s); - } - if (ircd->Lmode) { - SAFE(read_string(&ci->mlock_redirect, f)); - } else { - SAFE(read_string(&s, f)); - if (s) - free(s); - } + SAFE(read_string(&ci->mlock_flood, f)); + SAFE(read_string(&ci->mlock_redirect, f)); /* We added support for channelmode +j tracking, * however unless for some other reason we need to * change the DB format, it is being saved to DB. ~ Viper - if (ircd->jmode) { - SAFE(read_string(&ci->mlock_throttle, f)); - } else { - SAFE(read_string(&s, f)); - if (s) - free(s); - }*/ + SAFE(read_string(&ci->mlock_throttle, f));*/ } SAFE(read_int16(&tmp16, f)); @@ -938,23 +920,10 @@ void save_cs_dbase(void) SAFE(write_int32(ci->mlock_off, f)); SAFE(write_int32(ci->mlock_limit, f)); SAFE(write_string(ci->mlock_key, f)); - if (ircd->fmode) { - SAFE(write_string(ci->mlock_flood, f)); - } else { - SAFE(write_string(NULL, f)); - } - if (ircd->Lmode) { - SAFE(write_string(ci->mlock_redirect, f)); - } else { - SAFE(write_string(NULL, f)); - } + SAFE(write_string(ci->mlock_flood, f)); + SAFE(write_string(ci->mlock_redirect, f)); /* Current DB format does not hold +j yet.. ~ Viper - if (ircd->jmode) { - SAFE(write_string(ci->mlock_throttle, f)); - } else { - SAFE(write_string(NULL, f)); - } - */ + SAFE(write_string(ci->mlock_throttle, f));*/ SAFE(write_int16(ci->memos.memocount, f)); SAFE(write_int16(ci->memos.memomax, f)); memos = ci->memos.memos; @@ -2429,7 +2398,11 @@ char *cs_get_flood(ChannelInfo * ci) if (!ci) { return NULL; } else { - return ci->mlock_flood; + if (ircd->fmode) { + return ci->mlock_flood; + } else { + return NULL; + } } } @@ -2440,7 +2413,11 @@ char *cs_get_throttle(ChannelInfo * ci) if (!ci) { return NULL; } else { - return ci->mlock_throttle; + if (ircd->jmode) { + return ci->mlock_throttle; + } else { + return NULL; + } } } @@ -2480,7 +2457,11 @@ char *cs_get_redirect(ChannelInfo * ci) if (!ci) { return NULL; } else { - return ci->mlock_redirect; + if (ircd->Lmode) { + return ci->mlock_redirect; + } else { + return NULL; + } } } |