1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 22:53:13 +02:00

Rework the interface for service references.

This commit is contained in:
Sadie Powell
2026-01-10 21:23:23 +00:00
parent 25cd6c96e3
commit bfb47ab5a6
14 changed files with 82 additions and 55 deletions
+3 -2
View File
@@ -15,7 +15,7 @@
#include "webcpanel.h"
Module *me;
Anope::string provider_name, template_base, page_title;
Anope::string template_base, page_title;
class ModuleWebCPanel final
: public Module
@@ -53,6 +53,7 @@ class ModuleWebCPanel final
public:
ModuleWebCPanel(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR),
provider(HTTP_PROVIDER),
panel(this, "webcpanel"),
id(this, "webcpanel_id"), ip(this, "webcpanel_ip"), last_login(this, "webcpanel_last_login"),
style_css("style.css", "/static/style.css", "text/css"), logo_png("logo.png", "/static/logo.png", "image/png"), cubes_png("cubes.png", "/static/cubes.png", "image/png"), favicon_ico("favicon.ico", "/favicon.ico", "image/x-icon"),
@@ -70,7 +71,7 @@ public:
template_base = Anope::ExpandData(block.Get<const Anope::string>("template_dir", "webcpanel/templates/default"));
page_title = block.Get<const Anope::string>("title", "Anope IRC Services");
provider = ServiceReference<HTTP::Provider>(HTTP_PROVIDER, provider_name);
provider.SetServiceName(block.Get<const Anope::string>("server", "httpd/main"));
if (!provider)
throw ModuleException("Unable to find HTTPD provider. Is httpd loaded?");