diff options
Diffstat (limited to 'modules/hostserv/off.cpp')
-rw-r--r-- | modules/hostserv/off.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/hostserv/off.cpp b/modules/hostserv/off.cpp index e8c191164..95c27532a 100644 --- a/modules/hostserv/off.cpp +++ b/modules/hostserv/off.cpp @@ -32,16 +32,21 @@ class CommandHSOff : public Command { User *u = source.GetUser(); NickServ::Nick *na = NickServ::FindNick(u->nick); + HostServ::VHost *vhost = nullptr; - if (!na || na->GetAccount() != u->Account() || !na->HasVhost()) - na = NickServ::FindNick(u->Account()->GetDisplay()); + if (na && na->GetAccount() == source.GetAccount()) + vhost = na->GetVHost(); - if (!na || !na->HasVhost() || na->GetAccount() != source.GetAccount()) + if (vhost == nullptr) + vhost = NickServ::FindNick(u->Account()->GetDisplay())->GetVHost(); + + if (vhost == nullptr) { source.Reply(_("There is no vhost assigned to this nickname.")); return; } + // XXX vident? u->vhost.clear(); IRCD->SendVhostDel(u); Log(LOG_COMMAND, source, this) << "to disable their vhost"; |