summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-01-17 15:46:53 -0500
committerAdam <Adam@anope.org>2011-01-17 15:46:53 -0500
commit8975b52cc3087db9504de7ad6e707234cb158a36 (patch)
treed666c5abe448e5451edbd9c0993a46f28cbc6c04 /src
parent7acbbbbf5b661fd2d7b42f3e3adaea949f68cbef (diff)
Added ns_ajoin
Diffstat (limited to 'src')
-rw-r--r--src/botserv.cpp3
-rw-r--r--src/config.cpp1
-rw-r--r--src/language.cpp22
-rw-r--r--src/regchannel.cpp2
-rw-r--r--src/users.cpp7
5 files changed, 28 insertions, 7 deletions
diff --git a/src/botserv.cpp b/src/botserv.cpp
index 78e29451a..fac49761d 100644
--- a/src/botserv.cpp
+++ b/src/botserv.cpp
@@ -329,7 +329,6 @@ void botchanmsgs(User *u, ChannelInfo *ci, const Anope::string &buf)
{
Anope::string message = sep.GetRemaining();
- EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnPreCommandRun, OnPreCommandRun(u, ci->bi, command, message, ci));
if (MOD_RESULT == EVENT_STOP)
return;
@@ -529,7 +528,7 @@ void bot_raw_ban(User *requester, ChannelInfo *ci, User *u, const Anope::string
if (ci->HasFlag(CI_PEACE) && !requester->nick.equals_ci(u->nick) && u_level >= req_level)
return;
- if (ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(ci, u) == 1)
+ if (matches_list(ci->c, u, CMODE_EXCEPT))
{
ircdproto->SendPrivmsg(ci->bi, ci->name, "%s", GetString(requester, BOT_EXCEPT).c_str());
return;
diff --git a/src/config.cpp b/src/config.cpp
index 330594c13..9804161b1 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -1115,6 +1115,7 @@ void ServerConfig::Read()
{"nickserv", "strictprivileges", "no", new ValueContainerBool(&this->NSStrictPrivileges), DT_BOOLEAN, NoValidation},
{"nickserv", "modeonid", "no", new ValueContainerBool(&this->NSModeOnID), DT_BOOLEAN, NoValidation},
{"nickserv", "addaccessonreg", "no", new ValueContainerBool(&this->NSAddAccessOnReg), DT_BOOLEAN, NoValidation},
+ {"nickserv", "ajoinmax", "10", new ValueContainerUInt(&this->AJoinMax), DT_UINTEGER, NoValidation},
{"mail", "usemail", "no", new ValueContainerBool(&this->UseMail), DT_BOOLEAN, ValidateEmailReg},
{"mail", "sendmailpath", "", new ValueContainerString(&this->SendMailPath), DT_STRING, ValidateMail},
{"mail", "sendfrom", "", new ValueContainerString(&this->SendFrom), DT_STRING, ValidateMail},
diff --git a/src/language.cpp b/src/language.cpp
index f6a2d432e..e91f45638 100644
--- a/src/language.cpp
+++ b/src/language.cpp
@@ -505,6 +505,21 @@ const char *const language_strings[LANG_STRING_COUNT] = {
_("Your access list is empty."),
/* NICK_ACCESS_LIST_X_EMPTY */
_("Access list for %s is empty."),
+ /* NICK_AJOIN_SYNTAX */
+ _("AJOIN {ADD | DEL | LIST} [\037channel\037] [\037key\037]"),
+ /* NICK_AJOIN_LIST_EMPTY */
+ _("Your auto join list is empty."),
+ /* NICK_AJOIN_LIST_HEAD */
+ _("Your auto join list:\n"
+ " Num Channel Key"),
+ /* NICK_AJOIN_LIST_FULL */
+ _("Your auto join list is full."),
+ /* NICK_AJOIN_ADDED */
+ _("Added %s to your auto join list."),
+ /* NICK_AJOIN_NOTFOUND */
+ _("%s was not found on your auto join list."),
+ /* NICK_AJOIN_DELETED */
+ _("%s was removed from your auto join list."),
/* NICK_STATUS_REPLY */
_("STATUS %s %d %s"),
/* NICK_INFO_SYNTAX */
@@ -2671,6 +2686,8 @@ const char *const language_strings[LANG_STRING_COUNT] = {
_(" SUSPEND Suspend a given nick"),
/* NICK_HELP_CMD_UNSUSPEND */
_(" UNSUSPEND Unsuspend a given nick"),
+ /* NICK_HELP_CMD_AJOIN */
+ _(" AJOIN Manage your auto join list"),
/* NICK_HELP */
_("%S allows you to \"register\" a nickname and\n"
"prevent others from using it. The following\n"
@@ -3203,6 +3220,11 @@ const char *const language_strings[LANG_STRING_COUNT] = {
" \n"
"This command will re-send the auth code (also called passcode)\n"
"to the e-mail address of the user whom is performing it."),
+ /* NICK_HELP_AJOIN */
+ _("Syntax: \002AJOIN {ADD | DEL | LIST} [\037channel\037] [\037key\037]\002\n"
+ " \n"
+ "This command manages your auto join list. When you identify\n"
+ "you will automatically join the channels on your auto join list"),
/* NICK_SERVADMIN_HELP */
_(" \n"
"Services Operators can also drop any nickname without needing\n"
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 0d0f5dc54..16e90bebb 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -749,7 +749,7 @@ bool ChannelInfo::CheckKick(User *user)
do_kick = true;
}
- if (!do_kick && ModeManager::FindChannelModeByName(CMODE_EXCEPT) && is_excepted(this, user) == 1)
+ if (!do_kick && matches_list(this->c, user, CMODE_EXCEPT))
return false;
const NickCore *nc = user->Account() || user->IsRecognized() ? user->Account() : NULL;
diff --git a/src/users.cpp b/src/users.cpp
index 5e406ced2..488f143c8 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -876,14 +876,13 @@ void do_kill(User *user, const Anope::string &msg)
/*************************************************************************/
/*************************************************************************/
-/* Is the given user ban-excepted? */
-bool is_excepted(ChannelInfo *ci, User *user)
+bool matches_list(Channel *c, User *user, ChannelModeName mode)
{
- if (!ci->c || !ModeManager::FindChannelModeByName(CMODE_EXCEPT))
+ if (!c || !c->HasMode(mode))
return false;
- std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = ci->c->GetModeList(CMODE_EXCEPT);
+ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> modes = c->GetModeList(mode);
for (; modes.first != modes.second; ++modes.first)
{
Entry e(modes.first->second);