summaryrefslogtreecommitdiff
path: root/modules/hostserv/del.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/del.cpp
parentcffbf4e8fd93ae28f1c6d6fde221e72d70015942 (diff)
Split vhosts into its own structure
Diffstat (limited to 'modules/hostserv/del.cpp')
-rw-r--r--modules/hostserv/del.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/hostserv/del.cpp b/modules/hostserv/del.cpp
index bc9b08533..48a1209fc 100644
--- a/modules/hostserv/del.cpp
+++ b/modules/hostserv/del.cpp
@@ -42,9 +42,16 @@ class CommandHSDel : public Command
return;
}
+ HostServ::VHost *vhost = na->GetVHost();
+ if (vhost == nullptr)
+ {
+ source.Reply(_("\002{0}\002 doesn't have a vhost."), na->GetNick());
+ return;
+ }
+
Log(LOG_ADMIN, source, this) << "for user " << na->GetNick();
EventManager::Get()->Dispatch(&Event::DeleteVhost::OnDeleteVhost, na);
- na->RemoveVhost();
+ vhost->Delete();
source.Reply(_("Vhost for \002{0}\002 has been removed."), na->GetNick());
}
@@ -81,7 +88,14 @@ class CommandHSDelAll : public Command
NickServ::Account *nc = na->GetAccount();
for (NickServ::Nick *na2 : nc->GetRefs<NickServ::Nick *>())
- na2->RemoveVhost();
+ {
+ HostServ::VHost *vhost = na2->GetVHost();
+ if (vhost != nullptr)
+ {
+ vhost->Delete();
+ }
+ }
+
Log(LOG_ADMIN, source, this) << "for all nicks in group " << nc->GetDisplay();
source.Reply(_("Vhosts for group \002{0}\002 have been removed."), nc->GetDisplay());
}