summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/hostserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-06-19 18:59:26 -0400
committerAdam <Adam@anope.org>2013-06-19 19:03:56 -0400
commit5ac1e9175d90fad5feaf235dfe225ddffc47f257 (patch)
tree729e5c1b34e2c23f1c5cdba427e52958b1b17ff0 /modules/pseudoclients/hostserv.cpp
parent5695c9e079278e74692d55581769745c833bc284 (diff)
Set vhosts when users id to an account (and not a nick), add account arg to user ctor to ease handling users who connect already identified
Diffstat (limited to 'modules/pseudoclients/hostserv.cpp')
-rw-r--r--modules/pseudoclients/hostserv.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp
index 31b623895..2ac0d8f09 100644
--- a/modules/pseudoclients/hostserv.cpp
+++ b/modules/pseudoclients/hostserv.cpp
@@ -35,12 +35,15 @@ class HostServCore : public Module
HostServ = bi;
}
- void OnNickIdentify(User *u) anope_override
+ void OnUserLogin(User *u) anope_override
{
+ if (!IRCD->CanSetVHost)
+ return;
+
const NickAlias *na = NickAlias::Find(u->nick);
- if (!na || !na->HasVhost())
+ if (!na || na->nc != u->Account() || !na->HasVhost())
na = NickAlias::Find(u->Account()->display);
- if (!IRCD->CanSetVHost || !na || !na->HasVhost())
+ if (!na || !na->HasVhost())
return;
if (u->vhost.empty() || !u->vhost.equals_cs(na->GetVhostHost()) || (!na->GetVhostIdent().empty() && !u->GetVIdent().equals_cs(na->GetVhostIdent())))