1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 18:03:13 +02:00

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

This commit is contained in:
Adam
2013-06-19 18:59:26 -04:00
parent 5695c9e079
commit 5ac1e9175d
14 changed files with 181 additions and 131 deletions
+6 -3
View File
@@ -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())))