1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 06:16:38 +02:00

Fixed ns_ajoin to check if adding a duplicate channel

This commit is contained in:
lethality
2011-08-06 00:31:24 +01:00
parent d6a8d27265
commit e03efdee97
+7
View File
@@ -36,8 +36,15 @@ class CommandNSAJoin : public Command
std::vector<std::pair<Anope::string, Anope::string> > channels;
source.u->Account()->GetExtRegular("ns_ajoin_channels", channels);
unsigned i;
for (i = 0; i < channels.size(); ++i)
if (channels[i].first.equals_ci(params[1]))
break;
if (channels.size() >= Config->AJoinMax)
source.Reply(_("Your auto join list is full."));
else if (i != channels.size())
source.Reply(_("%s is already on your auto join list."), params[1].c_str());
else if (ircdproto->IsChannelValid(params[1]) == false)
source.Reply(CHAN_X_INVALID, params[1].c_str());
else