summaryrefslogtreecommitdiff
path: root/modules/pseudoclients/hostserv.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-01 01:56:57 -0400
committerAdam <Adam@anope.org>2012-10-01 01:56:57 -0400
commit89428a9d1032e3c2a6e397629a32862b3e58d708 (patch)
treed507904b3fa1cc084f0f3e688c839bcdd47f79d7 /modules/pseudoclients/hostserv.cpp
parentb937d6310d9a7c0e2434200306b63d513cb2ae61 (diff)
Cleanup of all of the protocol modules, rewrote message handling system to be a bit more C++ ish
Diffstat (limited to 'modules/pseudoclients/hostserv.cpp')
-rw-r--r--modules/pseudoclients/hostserv.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/pseudoclients/hostserv.cpp b/modules/pseudoclients/hostserv.cpp
index c350903d0..33d183b9a 100644
--- a/modules/pseudoclients/hostserv.cpp
+++ b/modules/pseudoclients/hostserv.cpp
@@ -20,8 +20,8 @@ class HostServCore : public Module
{
this->SetAuthor("Anope");
- if (!ircd || !ircd->vhost)
- throw ModuleException("Your IRCd does not suppor vhosts");
+ if (!ircdproto || !ircdproto->CanSetVHost)
+ throw ModuleException("Your IRCd does not support vhosts");
const BotInfo *HostServ = findbot(Config->HostServ);
if (HostServ == NULL)
@@ -36,18 +36,17 @@ class HostServCore : public Module
const NickAlias *na = findnick(u->nick);
if (!na || !na->HasVhost())
na = findnick(u->Account()->display);
- if (!na || !na->HasVhost())
+ if (!ircdproto->CanSetVHost || !na || !na->HasVhost())
return;
if (u->vhost.empty() || !u->vhost.equals_cs(na->GetVhostHost()) || (!na->GetVhostIdent().empty() && !u->GetVIdent().equals_cs(na->GetVhostIdent())))
{
ircdproto->SendVhost(u, na->GetVhostIdent(), na->GetVhostHost());
- if (ircd->vhost)
- {
- u->vhost = na->GetVhostHost();
- u->UpdateHost();
- }
- if (ircd->vident && !na->GetVhostIdent().empty())
+
+ u->vhost = na->GetVhostHost();
+ u->UpdateHost();
+
+ if (ircdproto->CanSetVIdent && !na->GetVhostIdent().empty())
u->SetVIdent(na->GetVhostIdent());
const BotInfo *bi = findbot(Config->HostServ);