diff options
author | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-09 03:21:33 +0000 |
---|---|---|
committer | cyberbotx <cyberbotx@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-03-09 03:21:33 +0000 |
commit | 174bb94648eb9927255bed79f0ec09da4fbfd4d9 (patch) | |
tree | 1ab11a9f73f455f7a02090960ca27ff3fac77d90 | |
parent | 3b634c37703423e670509313ff7816a34b4cac31 (diff) |
Fix bug #1020, +f and +L parameters are read from and written to the database regardless of what the IRCd says it can handle, as the databases are loaded prior to Anope connecting to the IRCd and the InspIRCd protocol modules default to saying +f is a mode they don't support until after Anope connects to InspIRCd.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2150 5417fbe8-f217-4b02-8779-1006273d7864
-rw-r--r-- | src/chanserv.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/src/chanserv.c b/src/chanserv.c index 0c950d1ee..a4079cd8b 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -455,20 +455,8 @@ void load_cs_dbase() SAFE(read_int32(&ci->mlock_off, f)); SAFE(read_int32(&ci->mlock_limit, f)); SAFE(read_string(&ci->mlock_key, f)); - if (ircd->fmode) { - SAFE(read_string(&ci->mlock_flood, f)); - } else { - SAFE(read_string(&s, f)); - if (s) - delete [] s; - } - if (ircd->Lmode) { - SAFE(read_string(&ci->mlock_redirect, f)); - } else { - SAFE(read_string(&s, f)); - if (s) - delete [] s; - } + SAFE(read_string(&ci->mlock_flood, f)); + SAFE(read_string(&ci->mlock_redirect, f)); SAFE(read_int16(&tmp16, f)); if (tmp16) ci->memos.memos.resize(tmp16); @@ -650,16 +638,8 @@ void save_cs_dbase() 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)); SAFE(write_int16(ci->memos.memos.size(), f)); SAFE(write_int16(ci->memos.memomax, f)); for (j = 0; j < ci->memos.memos.size(); j++) { @@ -1974,7 +1954,7 @@ int get_idealban(ChannelInfo * ci, User * u, char *ret, int retlen) return 0; std::string vident = u->GetIdent(); - + switch (ci->bantype) { case 0: snprintf(ret, retlen, "*!%s@%s", vident.c_str(), @@ -2010,7 +1990,10 @@ 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; } } @@ -2050,7 +2033,10 @@ 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; } } |