diff options
Diffstat (limited to 'modules/hostserv/main/hostserv.cpp')
-rw-r--r-- | modules/hostserv/main/hostserv.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/hostserv/main/hostserv.cpp b/modules/hostserv/main/hostserv.cpp index ab1617a85..b0c3d04f2 100644 --- a/modules/hostserv/main/hostserv.cpp +++ b/modules/hostserv/main/hostserv.cpp @@ -66,14 +66,7 @@ class HostServCore : public Module if (!IRCD->CanSetVHost) return; - NickServ::Nick *na = NickServ::FindNick(u->nick); - HostServ::VHost *vhost = nullptr; - - if (na && na->GetAccount() == u->Account()) - vhost = na->GetVHost(); - - if (vhost == nullptr) - vhost = NickServ::FindNick(u->Account()->GetDisplay())->GetVHost(); + HostServ::VHost *vhost = HostServ::FindVHost(u->Account()); if (vhost == nullptr) return; @@ -123,7 +116,10 @@ class HostServCore : public Module if (u && u->Account() == na->GetAccount()) { - HostServ::VHost *vhost = na->GetVHost(); + HostServ::VHost *vhost = HostServ::FindVHost(u->Account()); + + if (vhost == nullptr) + return; IRCD->SendVhost(u, vhost->GetIdent(), vhost->GetHost()); |