]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add helpchan and helpurl that tell users the official help channel
authorJD Horelick <redacted>
Sun, 28 Mar 2010 18:08:47 +0000 (14:08 -0400)
committerJD Horelick <redacted>
Sun, 28 Mar 2010 18:08:47 +0000 (14:08 -0400)
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
doc/reference.conf
include/s_conf.h
modules/m_help.c
src/newconf.c
src/s_conf.c

index aaf47cf02c8c5290965172f0fab2b44385c367a2..d2153aea72e6744727b30131ddbaaec9033d7d7e 100755 (executable)
@@ -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
index b915dfc5cbb86f04d25f3387eed0f213ada1ce83..2cdc13f4d3dd94e36de7dbf61004df913b3cd207 100755 (executable)
@@ -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.  
         */
index 31b9a74feaf12f2ac31ca0de3bcd44b135490e88..d9e3b1fe0fd55224350c0823e64ce0e1eabfc525 100644 (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;
index f1f1d2eaeb66fb792e6733bee949c03ab1adf569..ab94ed0bbf1b0a5e35c4afd08515f828cd14ffa5 100644 (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);
 
index d71788a151493cebf9820103ac6cd54875fa396e..cdd3a99c20b004eab4b47bfb4c34f591fc026b95 100644 (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 },
index 5f91e6c0991478910799cc4fb7b4ebab964d10d4..c1d623475f35a92739fc5624d610ce4e54d145b7 100644 (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;