summaryrefslogtreecommitdiff
path: root/modules/core
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-21 01:40:36 -0400
committerAdam <Adam@anope.org>2010-08-21 01:40:36 -0400
commitfb551f0d5d412246a5221e8e9e310c191033b317 (patch)
treee737cdf9db93d53313701695c338ab9c96e83e9f /modules/core
parent931b0777fbd961a4ca961ddfa763af92dcce946c (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/core')
-rw-r--r--modules/core/cs_set_persist.cpp4
-rw-r--r--modules/core/db_plain.cpp38
-rw-r--r--modules/core/os_chanlist.cpp4
3 files changed, 20 insertions, 26 deletions
diff --git a/modules/core/cs_set_persist.cpp b/modules/core/cs_set_persist.cpp
index fe3c84242..955e2082f 100644
--- a/modules/core/cs_set_persist.cpp
+++ b/modules/core/cs_set_persist.cpp
@@ -33,6 +33,8 @@ class CommandCSSetPersist : public Command
if (!ci->HasFlag(CI_PERSIST))
{
ci->SetFlag(CI_PERSIST);
+ if (ci->c)
+ ci->c->SetFlag(CH_PERSIST);
/* Channel doesn't exist, create it */
if (!ci->c)
@@ -65,6 +67,8 @@ class CommandCSSetPersist : public Command
if (ci->HasFlag(CI_PERSIST))
{
ci->UnsetFlag(CI_PERSIST);
+ if (ci->c)
+ ci->c->UnsetFlag(CH_PERSIST);
/* Unset perm mode */
if (cm && ci->c && ci->c->HasMode(CMODE_PERM))
diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp
index 7f90ad6f9..9c47306ca 100644
--- a/modules/core/db_plain.cpp
+++ b/modules/core/db_plain.cpp
@@ -1011,43 +1011,33 @@ class DBPlain : public Module
if (ci->GetMLockCount(true))
{
db << "MD MLOCK_ON";
- 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, true))
- db << " " << cm->NameAsString;
- }
+ ChannelMode *cm = it->second;
+ if (ci->HasMLock(cm->Name, true))
+ db << " " << cm->NameAsString;
}
db << endl;
}
if (ci->GetMLockCount(false))
{
db << "MD MLOCK_OFF";
- for (std::list<Mode *>::iterator it = ModeManager::Modes.begin(), it_end = ModeManager::Modes.end(); it != it_end; ++it)
- {
- if ((*it)->Class == MC_CHANNEL)
- {
- ChannelMode *cm = debug_cast<ChannelMode *>(*it);
- if (ci->HasMLock(cm->Name, false))
- db << " " << cm->NameAsString;
- }
+ for (std::map<char, ChannelMode *>::iterator it = ModeManager::ChannelModesByChar.begin(), it_end = ModeManager::ChannelModesByChar.end(); it != it_end; ++it)
+ {
+ ChannelMode *cm = it->second;
+ if (ci->HasMLock(cm->Name, false))
+ db << " " << cm->NameAsString;
}
db << endl;
}
- 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;
- Anope::string Param;
- if (ci->GetParam(cm->Name, Param))
- db << "MD MLP " << cm->NameAsString << " " << Param << endl;
- }
+ if (ci->GetParam(cm->Name, Param))
+ db << "MD MLP " << cm->NameAsString << " " << Param << endl;
}
if (!ci->memos.memos.empty())
{
diff --git a/modules/core/os_chanlist.cpp b/modules/core/os_chanlist.cpp
index 8fcb1c397..87b3d736d 100644
--- a/modules/core/os_chanlist.cpp
+++ b/modules/core/os_chanlist.cpp
@@ -46,7 +46,7 @@ class CommandOSChanList : public Command
if (!cc->chan->HasMode(*it))
continue;
- notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, cc->chan->name.c_str(), cc->chan->users.size(), chan_get_modes(cc->chan, 1, 1).c_str(), !cc->chan->topic.empty() ? cc->chan->topic.c_str() : "");
+ notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, cc->chan->name.c_str(), cc->chan->users.size(), cc->chan->GetModes(true, true).c_str(), !cc->chan->topic.empty() ? cc->chan->topic.c_str() : "");
}
}
else
@@ -64,7 +64,7 @@ class CommandOSChanList : public Command
if (!c->HasMode(*it))
continue;
- notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, c->name.c_str(), c->users.size(), chan_get_modes(c, 1, 1).c_str(), !c->topic.empty() ? c->topic.c_str() : "");
+ notice_lang(Config->s_OperServ, u, OPER_CHANLIST_RECORD, c->name.c_str(), c->users.size(), c->GetModes(true, true).c_str(), !c->topic.empty() ? c->topic.c_str() : "");
}
}