summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
committerAdam <Adam@anope.org>2013-05-05 01:55:04 -0400
commit1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b (patch)
tree4486f0784bdf050fd7eb225c0cb9df352ce1f45a /src/regchannel.cpp
parent781defb7076ddfddf723ca08cd0a518b6657b64f (diff)
Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in.
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 48d039be3..12655533b 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -276,22 +276,12 @@ ChannelInfo::ChannelInfo(const Anope::string &chname) : Serializable("ChannelInf
this->repeattimes = 0;
this->banexpire = 0;
this->bi = NULL;
-
- this->last_topic_setter = Config->ChanServ;
- this->last_topic_time = Anope::CurTime;
+ this->last_topic_time = 0;
this->name = chname;
- /* Set default channel flags */
- for (std::set<Anope::string>::const_iterator it = Config->CSDefFlags.begin(), it_end = Config->CSDefFlags.end(); it != it_end; ++it)
- this->ExtendMetadata(*it);
-
- /* Set default bot flags */
- for (std::set<Anope::string>::const_iterator it = Config->BSDefFlags.begin(), it_end = Config->BSDefFlags.end(); it != it_end; ++it)
- this->ExtendMetadata(*it);
-
- this->bantype = Config->CSDefBantype;
- this->memos.memomax = Config->MSMaxMemos;
+ this->bantype = 2;
+ this->memos.memomax = 0;
this->last_used = this->time_registered = Anope::CurTime;
for (int i = 0; i < TTB_SIZE; ++i)
@@ -357,6 +347,8 @@ ChannelInfo::ChannelInfo(const ChannelInfo &ci) : Serializable("ChannelInfo"),
l->ci = this;
this->log_settings->push_back(l);
}
+
+ FOREACH_MOD(I_OnCreateChan, OnCreateChan(this));
}
ChannelInfo::~ChannelInfo()
@@ -474,11 +466,10 @@ Serializable* ChannelInfo::Unserialize(Serializable *obj, Serialize::Data &data)
BotInfo *bi = BotInfo::Find(sbi);
if (*ci->bi != bi)
{
- if (ci->bi)
+ if (bi)
+ bi->Assign(NULL, ci);
+ else if (ci->bi)
ci->bi->UnAssign(NULL, ci);
- ci->bi = bi;
- if (ci->bi)
- ci->bi->Assign(NULL, ci);
}
{
Anope::string ttb, tok;
@@ -1035,23 +1026,6 @@ bool ChannelInfo::CheckKick(User *user)
Log(LOG_DEBUG) << "Autokicking " << user->nick << " (" << mask << ") from " << this->name;
- /* If the channel isn't syncing and doesn't have any users, join ChanServ
- * Note that the user AND POSSIBLY the botserv bot exist here
- * ChanServ always enforces channels like this to keep people from deleting bots etc
- * that are holding channels.
- */
- if (this->c->users.size() == (this->bi && this->c->FindUser(this->bi) ? 2 : 1) && !this->c->HasExt("INHABIT") && !this->c->HasExt("SYNCING"))
- {
- /* Set +ntsi to prevent rejoin */
- c->SetMode(NULL, "NOEXTERNAL");
- c->SetMode(NULL, "TOPIC");
- c->SetMode(NULL, "SECRET");
- c->SetMode(NULL, "INVITE");
-
- /* Join ChanServ and set a timer for this channel to part ChanServ later */
- this->c->Hold();
- }
-
this->c->SetMode(NULL, "BAN", mask);
this->c->Kick(NULL, user, "%s", reason.c_str());