summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-04 02:17:58 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-06-04 02:17:58 +0000
commit2cc4cd016530cb31d09aa3aa3fa8d3de7d63550c (patch)
tree3cad2e0b551a24ec2d042c5775bf072ab393bddb
parent9abdb4e2e96b7b7699ce3ec66633bcc8f14e025d (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
-rw-r--r--src/hostserv.c33
-rw-r--r--src/protocol/unreal32.c4
-rw-r--r--src/users.c4
3 files changed, 22 insertions, 19 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());
+ }
}
diff --git a/src/protocol/unreal32.c b/src/protocol/unreal32.c
index 131989509..7cf9b26f5 100644
--- a/src/protocol/unreal32.c
+++ b/src/protocol/unreal32.c
@@ -810,7 +810,7 @@ int anope_event_setident(const char *source, int ac, const char **av)
return MOD_CONT;
}
- u->SetIdent(av[0]);
+ u->SetVIdent(av[0]);
return MOD_CONT;
}
int anope_event_chgident(const char *source, int ac, const char **av)
@@ -827,7 +827,7 @@ int anope_event_chgident(const char *source, int ac, const char **av)
return MOD_CONT;
}
- u->SetIdent(av[1]);
+ u->SetVIdent(av[1]);
return MOD_CONT;
}
diff --git a/src/users.c b/src/users.c
index 4efc355b4..059d598b4 100644
--- a/src/users.c
+++ b/src/users.c
@@ -158,7 +158,7 @@ const std::string &User::GetCloakedHost() const
const std::string &User::GetUID() const
{
- return this->uid;
+ return this->uid;
}
@@ -166,7 +166,7 @@ void User::SetVIdent(const std::string &sident)
{
this->vident = sident;
- Alog(LOG_DEBUG) << this->nick << " changed ident to " << sident;
+ Alog(LOG_DEBUG) << this->nick << " changed vident to " << sident;
this->UpdateHost();
}