diff options
author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-06-04 02:17:58 +0000 |
---|---|---|
committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2010-06-04 02:17:58 +0000 |
commit | 2cc4cd016530cb31d09aa3aa3fa8d3de7d63550c (patch) | |
tree | 3cad2e0b551a24ec2d042c5775bf072ab393bddb /src/hostserv.c | |
parent | 9abdb4e2e96b7b7699ce3ec66633bcc8f14e025d (diff) |
Only enable vhosts automatically if the user doesn't already have the vhost set
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2998 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/hostserv.c')
-rw-r--r-- | src/hostserv.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/hostserv.c b/src/hostserv.c index cf8a6b146..262bf30b0 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -198,23 +198,26 @@ void do_on_id(User *u) if (!na || !na->hostinfo.HasVhost()) return; - ircdproto->SendVhost(u, na->hostinfo.GetIdent(), na->hostinfo.GetHost()); - if (ircd->vhost) + if (!u->vhost || u->vhost != na->hostinfo.GetHost() || (!na->hostinfo.GetIdent().empty() && u->GetVIdent() != na->hostinfo.GetIdent())) { - if (u->vhost) - delete [] u->vhost; - u->vhost = sstrdup(na->hostinfo.GetHost().c_str()); - } - if (ircd->vident && !na->hostinfo.GetIdent().empty()) - { - u->SetVIdent(na->hostinfo.GetIdent()); - } - u->UpdateHost(); + ircdproto->SendVhost(u, na->hostinfo.GetIdent(), na->hostinfo.GetHost()); + if (ircd->vhost) + { + if (u->vhost) + delete [] u->vhost; + u->vhost = sstrdup(na->hostinfo.GetHost().c_str()); + } + if (ircd->vident && !na->hostinfo.GetIdent().empty()) + { + u->SetVIdent(na->hostinfo.GetIdent()); + } + u->UpdateHost(); - if (!na->hostinfo.GetIdent().empty()) - notice_lang(Config.s_HostServ, u, HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str()); - else - notice_lang(Config.s_HostServ, u, HOST_ACTIVATED, na->hostinfo.GetHost().c_str()); + if (!na->hostinfo.GetIdent().empty()) + notice_lang(Config.s_HostServ, u, HOST_IDENT_ACTIVATED, na->hostinfo.GetIdent().c_str(), na->hostinfo.GetHost().c_str()); + else + notice_lang(Config.s_HostServ, u, HOST_ACTIVATED, na->hostinfo.GetHost().c_str()); + } } |