From 5fd2d0ee3e136e01926f21edc759a4ab9fd48806 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 9 Oct 2016 12:00:15 -0400 Subject: Split vhosts into its own structure --- modules/hostserv/request.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'modules/hostserv/request.cpp') 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(); + 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("memouser") && memoserv) -- cgit