summaryrefslogtreecommitdiff
path: root/modules/hostserv/main/hostserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-09 19:51:39 -0400
committerAdam <Adam@anope.org>2016-10-09 19:51:39 -0400
commite7dd7159b1e1ab5b3edabc44ece5338672f8fbb4 (patch)
tree9517f02ca1c29fa247f6914398f35a44052c22ff /modules/hostserv/main/hostserv.cpp
parent8ceca4fd3f9cb82bc93801d5eb682d27b2ad2f54 (diff)
Make vhosts assignable to accounts, not nicks. Allow multiple vhosts per account.
Diffstat (limited to 'modules/hostserv/main/hostserv.cpp')
-rw-r--r--modules/hostserv/main/hostserv.cpp14
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());