summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command.cpp6
-rw-r--r--src/operserv.cpp2
-rw-r--r--src/regchannel.cpp49
3 files changed, 39 insertions, 18 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 8803edf05..0663ec2fa 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -56,7 +56,7 @@ void CommandSource::DoReply()
}
}
-Command::Command(Module *owner, const Anope::string &sname, size_t min_params, size_t max_params, const Anope::string &spermission) : Service(owner, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), permission(spermission), module(owner)
+Command::Command(Module *o, const Anope::string &sname, size_t min_params, size_t max_params, const Anope::string &spermission) : Service(o, sname), Flags<CommandFlag>(CommandFlagStrings), MaxParams(max_params), MinParams(min_params), permission(spermission), module(owner)
{
}
@@ -89,9 +89,9 @@ void Command::SendSyntax(CommandSource &source)
}
}
-void Command::SendSyntax(CommandSource &source, const Anope::string &syntax)
+void Command::SendSyntax(CommandSource &source, const Anope::string &syn)
{
- source.Reply(_("Syntax: \002%s %s\002"), source.command.c_str(), syntax.c_str());
+ source.Reply(_("Syntax: \002%s %s\002"), source.command.c_str(), syn.c_str());
source.Reply(MORE_INFO, Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str(), source.command.c_str());
}
diff --git a/src/operserv.cpp b/src/operserv.cpp
index 9546b7ee1..116fe2a98 100644
--- a/src/operserv.cpp
+++ b/src/operserv.cpp
@@ -61,7 +61,7 @@ Anope::string XLine::GetHost() const
/** Constructor
*/
-XLineManager::XLineManager(Module *creator, const Anope::string &name, char t) : Service(creator, name), type(t)
+XLineManager::XLineManager(Module *creator, const Anope::string &xname, char t) : Service(creator, xname), type(t)
{
}
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 1220669e0..7ab251fc9 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -61,9 +61,9 @@ ChannelInfo::ChannelInfo(const Anope::string &chname) : Flags<ChannelInfoFlag, C
/** Copy constructor
* @param ci The ChannelInfo to copy settings to
*/
-ChannelInfo::ChannelInfo(ChannelInfo *ci) : Flags<ChannelInfoFlag, CI_END>(ChannelInfoFlagStrings), botflags(BotServFlagStrings)
+ChannelInfo::ChannelInfo(ChannelInfo &ci) : Flags<ChannelInfoFlag, CI_END>(ChannelInfoFlagStrings), botflags(BotServFlagStrings)
{
- *this = *ci;
+ *this = ci;
if (this->founder)
++this->founder->channelcount;
@@ -76,21 +76,35 @@ ChannelInfo::ChannelInfo(ChannelInfo *ci) : Flags<ChannelInfoFlag, CI_END>(Chann
++this->bi->chancount;
for (int i = 0; i < TTB_SIZE; ++i)
- this->ttb[i] = ci->ttb[i];
+ this->ttb[i] = ci.ttb[i];
- // XXX access
+ for (unsigned i = 0; i < ci.GetAccessCount(); ++i)
+ {
+ ChanAccess *taccess = ci.GetAccess(i);
+ AccessProvider *provider = taccess->provider;
+
+ ChanAccess *newaccess = provider->Create();
+ newaccess->ci = taccess->ci;
+ newaccess->mask = taccess->mask;
+ newaccess->creator = taccess->creator;
+ newaccess->last_seen = taccess->last_seen;
+ newaccess->created = taccess->created;
+ newaccess->Unserialize(taccess->Serialize());
+
+ this->AddAccess(newaccess);
+ }
- for (unsigned i = 0; i < ci->GetAkickCount(); ++i)
+ for (unsigned i = 0; i < ci.GetAkickCount(); ++i)
{
- AutoKick *takick = ci->GetAkick(i);
+ AutoKick *takick = ci.GetAkick(i);
if (takick->HasFlag(AK_ISNICK))
this->AddAkick(takick->creator, takick->nc, takick->reason, takick->addtime, takick->last_used);
else
this->AddAkick(takick->creator, takick->mask, takick->reason, takick->addtime, takick->last_used);
}
- for (unsigned i = 0; i < ci->GetBadWordCount(); ++i)
+ for (unsigned i = 0; i < ci.GetBadWordCount(); ++i)
{
- BadWord *bw = ci->GetBadWord(i);
+ BadWord *bw = ci.GetBadWord(i);
this->AddBadWord(bw->word, bw->type);
}
}
@@ -158,20 +172,20 @@ BotInfo *ChannelInfo::WhoSends()
{
if (this && this->bi)
return this->bi;
- BotInfo *bi = findbot(Config->ChanServ);
- if (bi)
- return bi;
+ BotInfo *tbi = findbot(Config->ChanServ);
+ if (tbi)
+ return tbi;
else if (!BotListByNick.empty())
return BotListByNick.begin()->second;
return NULL;
}
/** Add an entry to the channel access list
- * @param access The entry
+ * @param taccess The entry
*/
-void ChannelInfo::AddAccess(ChanAccess *access)
+void ChannelInfo::AddAccess(ChanAccess *taccess)
{
- this->access.push_back(access);
+ this->access.push_back(taccess);
}
/** Get an entry from the channel access list by index
@@ -752,6 +766,13 @@ bool ChannelInfo::CheckKick(User *user)
}
}
+ if (!do_kick && this->HasFlag(CI_RESTRICTED) && this->AccessFor(user).empty() && (!this->founder || user->Account() != this->founder))
+ {
+ do_kick = true;
+ get_idealban(this, user, mask);
+ reason = translate(user->Account(), CHAN_NOT_ALLOWED_TO_JOIN);
+ }
+
if (!do_kick)
return false;