summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/nickserv.example.conf8
-rw-r--r--modules/commands/cs_access.cpp20
-rw-r--r--modules/commands/cs_mode.cpp17
-rw-r--r--modules/commands/ns_set.cpp9
4 files changed, 32 insertions, 22 deletions
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf
index 5685d184b..0c7fd49c6 100644
--- a/data/nickserv.example.conf
+++ b/data/nickserv.example.conf
@@ -361,13 +361,13 @@ module
maxaliases = 16
/*
- * If set, the NickServ GROUP command won't allow any group change. This is recommended for
- * better performance and to protect against nick stealing, however users will have less
- * flexibility.
+ * If set, the NickServ GROUP command won't allow any group changes. This is recommended to
+ * prevent users from accidentally dropping their nicks, as it forces users to explicitly
+ * drop their nicks before adding it to another group.
*
* This directive is optional, but recommended.
*/
- #nogroupchange = yes
+ nogroupchange = yes
}
command { service = "NickServ"; name = "GLIST"; command = "nickserv/glist"; }
command { service = "NickServ"; name = "GROUP"; command = "nickserv/group"; }
diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp
index 63304b603..d098e4c59 100644
--- a/modules/commands/cs_access.cpp
+++ b/modules/commands/cs_access.cpp
@@ -642,12 +642,12 @@ class CommandCSLevels : public Command
source.Reply(_("Setting \002%s\002 not known. Type \002%s%s HELP LEVELS\002 for a list of valid settings."), what.c_str(), Config->StrictPrivmsg.c_str(), source.service->nick.c_str());
else
{
- ci->SetLevel(p->name, level);
- FOREACH_MOD(OnLevelChange, (source, ci, p->name, level));
-
bool override = !source.AccessFor(ci).HasPriv("FOUNDER");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to set " << p->name << " to level " << level;
+ ci->SetLevel(p->name, level);
+ FOREACH_MOD(OnLevelChange, (source, ci, p->name, level));
+
if (level == ACCESS_FOUNDER)
source.Reply(_("Level for %s on channel %s changed to founder only."), p->name.c_str(), ci->name.c_str());
else
@@ -661,7 +661,7 @@ class CommandCSLevels : public Command
const Anope::string &what = params[2];
/* Don't allow disabling of the founder level. It would be hard to change it back if you dont have access to use this command */
- if (!what.equals_ci("FOUNDER"))
+ if (what.equals_ci("FOUNDER"))
{
source.Reply(_("You can not disable the founder privilege because it would be impossible to reenable it at a later time."));
return;
@@ -670,12 +670,12 @@ class CommandCSLevels : public Command
Privilege *p = PrivilegeManager::FindPrivilege(what);
if (p != NULL)
{
- ci->SetLevel(p->name, ACCESS_INVALID);
- FOREACH_MOD(OnLevelChange, (source, ci, p->name, ACCESS_INVALID));
-
bool override = !source.AccessFor(ci).HasPriv("FOUNDER");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to disable " << p->name;
+ ci->SetLevel(p->name, ACCESS_INVALID);
+ FOREACH_MOD(OnLevelChange, (source, ci, p->name, ACCESS_INVALID));
+
source.Reply(_("\002%s\002 disabled on channel %s."), p->name.c_str(), ci->name.c_str());
return;
}
@@ -719,12 +719,12 @@ class CommandCSLevels : public Command
void DoReset(CommandSource &source, ChannelInfo *ci)
{
- reset_levels(ci);
- FOREACH_MOD(OnLevelChange, (source, ci, "ALL", 0));
-
bool override = !source.AccessFor(ci).HasPriv("FOUNDER");
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to reset all levels";
+ reset_levels(ci);
+ FOREACH_MOD(OnLevelChange, (source, ci, "ALL", 0));
+
source.Reply(_("Access levels for \002%s\002 reset to defaults."), ci->name.c_str());
return;
}
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index 03a3d2b60..77312b0c1 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -296,7 +296,8 @@ class CommandCSMode : public Command
Anope::string pos = "+", neg = "-", pos_params, neg_params;
- int adding = -1;
+ int adding = 1;
+ bool needreply = true;
for (size_t i = 0; i < modes.length(); ++i)
{
switch (modes[i])
@@ -308,8 +309,7 @@ class CommandCSMode : public Command
adding = 0;
break;
default:
- if (adding == -1)
- break;
+ needreply = false;
ChannelMode *cm = ModeManager::FindChannelModeByChar(modes[i]);
if (!cm)
{
@@ -358,6 +358,8 @@ class CommandCSMode : public Command
source.Reply(_("%s locked on %s."), reply.c_str(), ci->name.c_str());
Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "to lock " << reply;
}
+ else if (needreply)
+ source.Reply(_("Nothing to do."));
if (ci->c)
ci->c->CheckModes();
@@ -369,7 +371,8 @@ class CommandCSMode : public Command
sep.GetToken(modes);
- int adding = -1;
+ int adding = 1;
+ bool needreply = true;
for (size_t i = 0; i < modes.length(); ++i)
{
switch (modes[i])
@@ -381,8 +384,7 @@ class CommandCSMode : public Command
adding = 0;
break;
default:
- if (adding == -1)
- break;
+ needreply = false;
ChannelMode *cm = ModeManager::FindChannelModeByChar(modes[i]);
if (!cm)
{
@@ -412,6 +414,9 @@ class CommandCSMode : public Command
}
}
}
+
+ if (needreply)
+ source.Reply(_("Nothing to do."));
}
else if (subcommand.equals_ci("LIST"))
{
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index a1e37e15e..7a69e33e0 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -924,11 +924,16 @@ class CommandNSSetMessage : public Command
bool OnHelp(CommandSource &source, const Anope::string &) anope_override
{
+ Anope::string cmd = source.command;
+ size_t i = cmd.find_last_of(' ');
+ if (i != Anope::string::npos)
+ cmd = cmd.substr(i + 1);
+
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Allows you to choose the way Services are communicating with\n"
- "you. With \002MSG\002 set, Services will use messages, else they'll\n"
- "use notices."));
+ "you. With \002%s\002 set, Services will use messages, else they'll\n"
+ "use notices."), cmd.upper().c_str());
return true;
}