diff options
author | Adam <Adam@anope.org> | 2010-08-21 01:40:36 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-08-21 01:40:36 -0400 |
commit | fb551f0d5d412246a5221e8e9e310c191033b317 (patch) | |
tree | e737cdf9db93d53313701695c338ab9c96e83e9f /modules/extra/db_mysql.cpp | |
parent | 931b0777fbd961a4ca961ddfa763af92dcce946c (diff) |
Made Anope keep track of channels its clients are in if it splits from its uplink, then burst them back to its uplink once connection is reestablished.
Also made Anope use TS enforcement to change persistant channels creation time to the time they were registered.
Diffstat (limited to 'modules/extra/db_mysql.cpp')
-rw-r--r-- | modules/extra/db_mysql.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index 27a1226d1..4aeac0322 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -199,15 +199,11 @@ static Anope::string MakeMLock(ChannelInfo *ci, bool status) { Anope::string ret; - for (std::list<Mode *>::iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it) + for (std::map<char, ChannelMode *>::iterator it = ModeManager::ChannelModesByChar.begin(), it_end = ModeManager::ChannelModesByChar.end(); it != it_end; ++it) { - if ((*it)->Class == MC_CHANNEL) - { - ChannelMode *cm = debug_cast<ChannelMode *>(*it); - - if (ci->HasMLock(cm->Name, status)) - ret += " " + cm->NameAsString; - } + ChannelMode *cm = it->second; + if (ci->HasMLock(cm->Name, status)) + ret += " " + cm->NameAsString; } if (!ret.empty()) @@ -230,16 +226,13 @@ static Anope::string GetMLockParams(ChannelInfo *ci) { Anope::string ret; - for (std::list<Mode *>::iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it) + for (std::map<char, ChannelMode *>::iterator it = ModeManager::ChannelModesByChar.begin(), it_end = ModeManager::ChannelModesByChar.end(); it != it_end; ++it) { - if ((*it)->Class == MC_CHANNEL) - { - ChannelMode *cm = debug_cast<ChannelMode *>(*it); + ChannelMode *cm = it->second; - Anope::string param; - if (ci->GetParam(cm->Name, param)) - ret += " " + cm->NameAsString + " " + param; - } + Anope::string param; + if (ci->GetParam(cm->Name, param)) + ret += " " + cm->NameAsString + " " + param; } if (!ret.empty()) |