summaryrefslogtreecommitdiff
path: root/modules/commands/hs_group.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-06-25 11:02:19 -0400
committerAdam <Adam@anope.org>2014-06-25 11:02:19 -0400
commitee3289029d61da12013e0f5a3e4faf2d07543a0e (patch)
treedf7391c321a913fc56db2d075292c0a6ddb0536d /modules/commands/hs_group.cpp
parentfd9bb0ea7e3c8a39f1632c2ebbdc25d0fac192a0 (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.cpp21
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