summaryrefslogtreecommitdiff
path: root/modules/hostserv/request.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-09 12:00:15 -0400
committerAdam <Adam@anope.org>2016-10-09 12:00:15 -0400
commit5fd2d0ee3e136e01926f21edc759a4ab9fd48806 (patch)
tree6666be3d14db12fe66a3576e889423f64e5229cc /modules/hostserv/request.cpp
parentcffbf4e8fd93ae28f1c6d6fde221e72d70015942 (diff)
Split vhosts into its own structure
Diffstat (limited to 'modules/hostserv/request.cpp')
-rw-r--r--modules/hostserv/request.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/hostserv/request.cpp b/modules/hostserv/request.cpp
index 2024ef3b3..2bad26b48 100644
--- a/modules/hostserv/request.cpp
+++ b/modules/hostserv/request.cpp
@@ -271,7 +271,21 @@ class CommandHSActivate : public Command
return;
}
- na->SetVhost(req->GetIdent(), req->GetHost(), source.GetNick(), req->GetTime());
+ HostServ::VHost *vhost = Serialize::New<HostServ::VHost *>();
+ if (vhost == nullptr)
+ {
+ source.Reply(_("Unable to create vhost, is hostserv enabled?"));
+ return;
+ }
+
+ vhost->SetOwner(na);
+ vhost->SetIdent(req->GetIdent());
+ vhost->SetHost(req->GetHost());
+ vhost->SetCreator(source.GetNick());
+ vhost->SetCreated(req->GetTime());
+
+ na->SetVHost(vhost);
+
EventManager::Get()->Dispatch(&Event::SetVhost::OnSetVhost, na);
if (Config->GetModule(this->GetOwner())->Get<bool>("memouser") && memoserv)