From ef07b59ac8b60bec3cb532137921b7703494766d Mon Sep 17 00:00:00 2001 From: JD Horelick Date: Sun, 28 Mar 2010 14:08:47 -0400 Subject: [PATCH] Add helpchan and helpurl that tell users the official help channel and (optionally) link them to your network's specific helppages on the intertubes. It is shown in /quote help (with no extra parameters). --- doc/example.conf | 2 ++ doc/reference.conf | 8 ++++++++ include/s_conf.h | 2 ++ modules/m_help.c | 8 ++++++++ src/newconf.c | 2 ++ src/s_conf.c | 6 ++++++ 6 files changed, 28 insertions(+) diff --git a/doc/example.conf b/doc/example.conf index aaf47cf..d2153ae 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -51,6 +51,8 @@ serverinfo { description = "shadowircd test server"; network_name = "AthemeNET"; network_desc = "Your IRC network."; + helpchan = "#help"; + helpurl = "http://www.mynet.net/help"; hub = yes; /* On multi-homed hosts you may need the following. These define diff --git a/doc/reference.conf b/doc/reference.conf index b915dfc..2cdc13f 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -140,6 +140,14 @@ serverinfo { network_name = "MyNet"; network_desc = "This is My Network"; + /* helpchan/helpurl: These 2 items are shown when a user does + * /quote help with no additional parameters to direct them + * to a channel/URL where they can get more or network-specific help. + * They can be commented out and will not show to users if they are. + */ + helpchan = "#help"; + helpurl = "http://www.mynet.net/help"; + /* hub: allow this server to act as a hub and have multiple servers * connected to it. */ diff --git a/include/s_conf.h b/include/s_conf.h index 31b9a74..d9e3b1f 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -286,6 +286,8 @@ struct server_info char *description; char *network_name; char *network_desc; + char *helpchan; + char *helpurl; int hub; struct sockaddr_in ip; int default_max_clients; diff --git a/modules/m_help.c b/modules/m_help.c index f1f1d2e..ab94ed0 100644 --- a/modules/m_help.c +++ b/modules/m_help.c @@ -97,7 +97,15 @@ dohelp(struct Client *source_p, int flags, const char *topic) rb_dlink_node *fptr; if(EmptyString(topic)) + { topic = ntopic; + if(!EmptyString(ServerInfo.helpchan)) + sendto_one(source_p, ":%s 525 %s :Official Help Channel: %s", + me.name, source_p->name, ServerInfo.helpchan); + if(!EmptyString(ServerInfo.helpurl)) + sendto_one(source_p, ":%s 526 %s :Official Help URL: %s", + me.name, source_p->name, ServerInfo.helpurl); + } hptr = irc_dictionary_retrieve(flags & HELP_OPER ? help_dict_oper : help_dict_user, topic); diff --git a/src/newconf.c b/src/newconf.c index d71788a..cdd3a99 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2063,6 +2063,8 @@ static struct ConfEntry conf_serverinfo_table[] = { { "description", CF_QSTRING, NULL, 0, &ServerInfo.description }, { "network_desc", CF_QSTRING, NULL, 0, &ServerInfo.network_desc }, + { "helpchan", CF_QSTRING, NULL, 0, &ServerInfo.helpchan }, + { "helpurl", CF_QSTRING, NULL, 0, &ServerInfo.helpurl }, { "hub", CF_YESNO, NULL, 0, &ServerInfo.hub }, { "network_name", CF_QSTRING, conf_set_serverinfo_network_name, 0, NULL }, diff --git a/src/s_conf.c b/src/s_conf.c index 5f91e6c..c1d6234 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -674,6 +674,8 @@ set_default_conf(void) ServerInfo.description = NULL; ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT); ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT); + ServerInfo.helpchan = rb_strdup(""); + ServerInfo.helpurl = rb_strdup(""); memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip)); ServerInfo.specific_ipv4_vhost = 0; @@ -1473,6 +1475,10 @@ clear_out_old_conf(void) ServerInfo.network_name = NULL; rb_free(ServerInfo.network_desc); ServerInfo.network_desc = NULL; + rb_free(ServerInfo.helpchan); + ServerInfo.helpchan = NULL; + rb_free(ServerInfo.helpurl); + ServerInfo.helpurl = NULL; ServerInfo.ssld_count = 1;