diff options
| author | Adam <Adam@anope.org> | 2014-06-25 11:02:19 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-06-25 11:02:19 -0400 |
| commit | ee3289029d61da12013e0f5a3e4faf2d07543a0e (patch) | |
| tree | df7391c321a913fc56db2d075292c0a6ddb0536d /modules/commands/hs_group.cpp | |
| parent | fd9bb0ea7e3c8a39f1632c2ebbdc25d0fac192a0 (diff) | |
Remove the rest of the 1.8 logic "let's write all of the command handler with no return statement!"
Fix if (something) else if (!something) tests
Remove returns at the bottom of void functions
Diffstat (limited to 'modules/commands/hs_group.cpp')
| -rw-r--r-- | modules/commands/hs_group.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/modules/commands/hs_group.cpp b/modules/commands/hs_group.cpp index 8b84d0f65..a3d68844b 100644 --- a/modules/commands/hs_group.cpp +++ b/modules/commands/hs_group.cpp @@ -52,16 +52,23 @@ class CommandHSGroup : public Command } NickServ::Nick *na = NickServ::FindNick(source.GetNick()); - if (na && source.GetAccount() == na->nc && na->HasVhost()) + if (!na || na->nc != source.GetAccount()) { - this->Sync(na); - if (!na->GetVhostIdent().empty()) - source.Reply(_("All vhosts in the group \002{0}\002 have been set to \002{1}\002@\002{2}\002."), source.nc->display, na->GetVhostIdent(), na->GetVhostHost()); - else - source.Reply(_("All vhosts in the group \002{0}\002 have been set to \002{1}\002."), source.nc->display, na->GetVhostHost()); + source.Reply(_("Access denied.")); + return; } - else + + if (!na->HasVhost()) + { source.Reply(_("There is no vhost assigned to this nickname.")); + return; + } + + this->Sync(na); + if (!na->GetVhostIdent().empty()) + source.Reply(_("All vhosts in the group \002{0}\002 have been set to \002{1}\002@\002{2}\002."), source.nc->display, na->GetVhostIdent(), na->GetVhostHost()); + else + source.Reply(_("All vhosts in the group \002{0}\002 have been set to \002{1}\002."), source.nc->display, na->GetVhostHost()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) override |
