diff options
author | lethality <lethality@anope.org> | 2011-08-06 00:31:24 +0100 |
---|---|---|
committer | lethality <lethality@anope.org> | 2011-08-06 00:31:24 +0100 |
commit | e03efdee9743a4b7366606aebe219627984fcf3f (patch) | |
tree | fed20fdfcb30dedfd2806e0c9331a5cf0f957919 | |
parent | d6a8d272658ff56de7971acf918ab48d3c43e1d8 (diff) |
Fixed ns_ajoin to check if adding a duplicate channel
-rw-r--r-- | modules/commands/ns_ajoin.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 4f35f28b8..275f4c748 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -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 |