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).
This commit is contained in:
JD Horelick 2010-03-28 14:08:47 -04:00
parent e59f45e361
commit ef07b59ac8
6 changed files with 28 additions and 0 deletions

View File

@ -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

View File

@ -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.
*/

View File

@ -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;

View File

@ -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);

View File

@ -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 },

View File

@ -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;