diff options
| author | Adam <Adam@anope.org> | 2016-10-22 16:43:18 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2016-10-22 16:52:29 -0400 |
| commit | fce6169f4e134a99dbb19997337b1bb250889147 (patch) | |
| tree | b6f2f6c1bc7094a32b5dc6bb1df97fc4b675e9e0 /modules/nickserv | |
| parent | 06f40cabcb167e2764c03092f6ec3f7383983f95 (diff) | |
Various codestyle cleanup in most of the core modules
Diffstat (limited to 'modules/nickserv')
| -rw-r--r-- | modules/nickserv/access.cpp | 6 | ||||
| -rw-r--r-- | modules/nickserv/cert.cpp | 2 | ||||
| -rw-r--r-- | modules/nickserv/main/nickserv.cpp | 5 | ||||
| -rw-r--r-- | modules/nickserv/recover.cpp | 2 | ||||
| -rw-r--r-- | modules/nickserv/register.cpp | 4 | ||||
| -rw-r--r-- | modules/nickserv/resetpass.cpp | 2 | ||||
| -rw-r--r-- | modules/nickserv/set.cpp | 13 | ||||
| -rw-r--r-- | modules/nickserv/status.cpp | 2 |
8 files changed, 33 insertions, 3 deletions
diff --git a/modules/nickserv/access.cpp b/modules/nickserv/access.cpp index fb068e92b..48d2e3bdc 100644 --- a/modules/nickserv/access.cpp +++ b/modules/nickserv/access.cpp @@ -198,14 +198,18 @@ class CommandNSAccess : public Command nc = na->GetAccount(); } else + { nc = source.nc; + } if (!mask.empty() && (mask.find('@') == Anope::string::npos || mask.find('!') != Anope::string::npos)) { source.Reply(_("Mask must be in the form \037user\037@\037host\037.")); source.Reply(_("\002%s%s HELP %s\002 for more information."), Config->StrictPrivmsg, source.service->nick, source.command); // XXX + return; } - else if (cmd.equals_ci("LIST")) + + if (cmd.equals_ci("LIST")) return this->DoList(source, nc, mask); else if (nc->HasFieldS("NS_SUSPENDED")) source.Reply(_("\002{0}\002 is suspended."), nc->GetDisplay()); diff --git a/modules/nickserv/cert.cpp b/modules/nickserv/cert.cpp index 94978fd88..93804d3ed 100644 --- a/modules/nickserv/cert.cpp +++ b/modules/nickserv/cert.cpp @@ -279,7 +279,9 @@ class CommandNSCert : public Command nc = na->GetAccount(); } else + { nc = source.nc; + } if (cmd.equals_ci("LIST")) return this->DoList(source, nc); diff --git a/modules/nickserv/main/nickserv.cpp b/modules/nickserv/main/nickserv.cpp index 461925927..c41f3b3f3 100644 --- a/modules/nickserv/main/nickserv.cpp +++ b/modules/nickserv/main/nickserv.cpp @@ -240,7 +240,8 @@ class NickServCore : public Module, public NickServ::NickServService this->Collide(u, na); return; } - else if (MOD_RESULT == EVENT_ALLOW) + + if (MOD_RESULT == EVENT_ALLOW) return; if (!na->GetAccount()->HasFieldS("NS_SECURE") && u->IsRecognized()) @@ -327,7 +328,9 @@ class NickServCore : public Module, public NickServ::NickServService } } else + { u->Kill(*NickServ, "Services nickname-enforcer kill"); + } } void Release(NickServ::Nick *na) override diff --git a/modules/nickserv/recover.cpp b/modules/nickserv/recover.cpp index 0196b518d..6e4c7c6b3 100644 --- a/modules/nickserv/recover.cpp +++ b/modules/nickserv/recover.cpp @@ -145,7 +145,9 @@ class NSRecoverRequestListener : public NickServ::IdentifyRequestListener } } else + { source.Reply(_("\002{0}\002 isn't registered."), user); + } } }; diff --git a/modules/nickserv/register.cpp b/modules/nickserv/register.cpp index 7a392dd7c..e3d4d4d23 100644 --- a/modules/nickserv/register.cpp +++ b/modules/nickserv/register.cpp @@ -97,7 +97,9 @@ class CommandNSConfirm : public Command } } else + { source.Reply(_("Invalid passcode.")); + } } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override @@ -250,7 +252,9 @@ class CommandNSRegister : public Command na->SetLastRealname(u->realname); } else + { na->SetLastRealname(source.GetNick()); + } Log(LOG_COMMAND, source, this) << "to register " << na->GetNick() << " (email: " << (!na->GetAccount()->GetEmail().empty() ? na->GetAccount()->GetEmail() : "none") << ")"; diff --git a/modules/nickserv/resetpass.cpp b/modules/nickserv/resetpass.cpp index 2a70a6ebd..6acfc905e 100644 --- a/modules/nickserv/resetpass.cpp +++ b/modules/nickserv/resetpass.cpp @@ -118,7 +118,9 @@ class NSResetPass : public Module } } else + { return EVENT_CONTINUE; + } return EVENT_STOP; } diff --git a/modules/nickserv/set.cpp b/modules/nickserv/set.cpp index 7637c8e47..7b1034eca 100644 --- a/modules/nickserv/set.cpp +++ b/modules/nickserv/set.cpp @@ -53,6 +53,7 @@ class CommandNSSet : public Command if (c_name.find_ci(this_name + " ") == 0) { ServiceReference<Command> c(info.name); +#warning "set duplication" // XXX dup if (!c) continue; @@ -273,7 +274,9 @@ class CommandNSSetAutoOp : public Command source.Reply(_("Services will no longer set status modes on \002{0}\002 in channels."), nc->GetDisplay()); } else + { this->OnSyntaxError(source, "AUTOOP"); + } } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -573,7 +576,9 @@ class CommandNSSetKeepModes : public Command source.Reply(_("Keep modes for \002{0}\002 is now \002off\002."), nc->GetDisplay()); } else + { this->OnSyntaxError(source, ""); + } } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -683,7 +688,9 @@ class CommandNSSetKill : public Command source.Reply(_("Protection is now \002off\002 for \002{0}\002."), nc->GetDisplay()); } else + { this->OnSyntaxError(source, "KILL"); + } } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -881,7 +888,9 @@ class CommandNSSetMessage : public Command source.Reply(_("Services will now reply to \002{0}\002 with \002notices\002."), nc->GetDisplay()); } else + { this->OnSyntaxError(source, "MSG"); + } } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -976,7 +985,9 @@ class CommandNSSetSecure : public Command source.Reply(_("Secure option is now \002off\002 for \002{0}\002."), nc->GetDisplay()); } else + { this->OnSyntaxError(source, "SECURE"); + } } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override @@ -1058,7 +1069,9 @@ class CommandNSSASetNoexpire : public Command source.Reply(_("\002{0}\002 \002will\002 expire."), na->GetNick()); } else + { this->OnSyntaxError(source, "NOEXPIRE"); + } } bool OnHelp(CommandSource &source, const Anope::string &) override diff --git a/modules/nickserv/status.cpp b/modules/nickserv/status.cpp index c092a9b46..d31622d3d 100644 --- a/modules/nickserv/status.cpp +++ b/modules/nickserv/status.cpp @@ -36,6 +36,7 @@ class CommandNSStatus : public Command spacesepstream sep(nick); Anope::string nickbuf; +#warning "this is all disabled" while (sep.GetToken(nickbuf)) { #if 0 @@ -89,7 +90,6 @@ class NSStatus : public Module NSStatus(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) , commandnsstatus(this) { - throw ModuleException("Remind Adam to fix this"); } }; |
