diff options
author | Adam <Adam@anope.org> | 2016-10-09 20:51:56 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-10-09 20:51:56 -0400 |
commit | bbd41545a032713f0ce2d3a11f082c99d00e48e0 (patch) | |
tree | ff1f0215f859c66d284341406bf8452939b5d801 /modules/hostserv/main/hostserv.cpp | |
parent | e7dd7159b1e1ab5b3edabc44ece5338672f8fbb4 (diff) |
Move vhost nick info to hostserv/main, also show if show_hidden
Diffstat (limited to 'modules/hostserv/main/hostserv.cpp')
-rw-r--r-- | modules/hostserv/main/hostserv.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/modules/hostserv/main/hostserv.cpp b/modules/hostserv/main/hostserv.cpp index b0c3d04f2..4ff348f2b 100644 --- a/modules/hostserv/main/hostserv.cpp +++ b/modules/hostserv/main/hostserv.cpp @@ -18,9 +18,10 @@ */ #include "module.h" +#include "modules/help.h" #include "modules/nickserv/update.h" +#include "modules/nickserv/info.h" #include "modules/hostserv/del.h" -#include "modules/help.h" #include "vhosttype.h" class HostServCore : public Module @@ -29,6 +30,7 @@ class HostServCore : public Module , public EventHook<Event::Help> , public EventHook<Event::SetVhost> , public EventHook<Event::DeleteVhost> + , public EventHook<Event::NickInfo> { Reference<ServiceBot> HostServ; @@ -41,6 +43,7 @@ class HostServCore : public Module , EventHook<Event::Help>(this) , EventHook<Event::SetVhost>(this) , EventHook<Event::DeleteVhost>(this) + , EventHook<Event::NickInfo>(this) , vhost_type(this) { if (!IRCD || !IRCD->CanSetVHost) @@ -150,6 +153,17 @@ class HostServCore : public Module IRCD->SendVhostDel(u); } } + + void OnNickInfo(CommandSource &source, NickServ::Nick *na, InfoFormatter &info, bool show_hidden) override + { + if (show_hidden || source.HasPriv("hostserv/auspex")) + { + for (HostServ::VHost *vhost : na->GetAccount()->GetRefs<HostServ::VHost *>()) + { + info[_("VHost")] = vhost->Mask() + (vhost->IsDefault() ? " (default)" : ""); + } + } + } }; MODULE_INIT(HostServCore) |