summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-26 17:30:41 -0400
committerAdam <Adam@anope.org>2012-10-26 17:30:41 -0400
commite1dcf24c98a14340e3c05388b749fb6069592d0e (patch)
tree51bb3bfbc4240d0130293c53f2926727f712ebb5
parent3b24311db6664407b34cce4080b48d18ff2eb997 (diff)
Add nickserv:modesonid config option to set what modes users get on identify
-rw-r--r--data/nickserv.example.conf7
-rw-r--r--include/config.h2
-rw-r--r--modules/protocol/inspircd-ts6.h2
-rw-r--r--modules/pseudoclients/nickserv.cpp3
-rw-r--r--src/config.cpp1
5 files changed, 14 insertions, 1 deletions
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf
index 5db22cfdc..20a9f8163 100644
--- a/data/nickserv.example.conf
+++ b/data/nickserv.example.conf
@@ -263,6 +263,13 @@ nickserv
*/
killquick = 20s
kill = 60s
+
+ /*
+ * If set, Services will set these user modes on any user who identifies.
+ *
+ * This directive is optional.
+ */
+ #modesonid = "+R"
}
/*
diff --git a/include/config.h b/include/config.h
index d1e7210e0..0f2e127c2 100644
--- a/include/config.h
+++ b/include/config.h
@@ -568,6 +568,8 @@ class CoreExport ServerConfig
/* Kill & killquick delays before force changing off users */
time_t NSKillQuick;
time_t NSKill;
+ /* Modes set on a user when they identify */
+ Anope::string NSModesOnID;
/* Core ChanServ modules */
Anope::string ChanCoreModules;
diff --git a/modules/protocol/inspircd-ts6.h b/modules/protocol/inspircd-ts6.h
index fefff1d15..f01184d12 100644
--- a/modules/protocol/inspircd-ts6.h
+++ b/modules/protocol/inspircd-ts6.h
@@ -587,7 +587,7 @@ struct IRCDMessageMetadata : IRCDMessage
/* Sometimes a user connects, we send them the usual "this nickname is registered" mess (if
* their server isn't syncing) and then we receive this.. so tell them about it.
*/
- if (bi)
+ if (u->server->IsSynced() && bi)
u->SendMessage(bi, _("You have been logged in as \2%s\2."), nc->display.c_str());
}
}
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 4115ee9b0..34e8a5524 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -253,6 +253,9 @@ class NickServCore : public Module
chan_set_correct_modes(u, c, 1, true);
}
+ if (!Config->NSModesOnID.empty())
+ u->SetModes(NickServ, "%s", Config->NSModesOnID.c_str());
+
if (Config->NSForceEmail && u->Account()->email.empty())
{
u->SendMessage(NickServ, _("You must now supply an e-mail for your nick.\n"
diff --git a/src/config.cpp b/src/config.cpp
index b8ee7d5a2..839a82c18 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -1283,6 +1283,7 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"nickserv", "ajoinmax", "10", new ValueContainerUInt(&conf->AJoinMax), DT_UINTEGER, NoValidation},
{"nickserv", "killquick", "20", new ValueContainerTime(&conf->NSKillQuick), DT_TIME, NoValidation},
{"nickserv", "kill", "60", new ValueContainerTime(&conf->NSKill), DT_TIME, NoValidation},
+ {"nickserv", "modesonid", "", new ValueContainerString(&conf->NSModesOnID), DT_STRING, NoValidation},
{"mail", "usemail", "no", new ValueContainerBool(&conf->UseMail), DT_BOOLEAN, ValidateEmailReg},
{"mail", "sendmailpath", "", new ValueContainerString(&conf->SendMailPath), DT_STRING, ValidateMail},
{"mail", "sendfrom", "", new ValueContainerString(&conf->SendFrom), DT_STRING, ValidateMail},