keep in sync with OGN upstream (SVN-317)
authorpk910 <philipp@zoelle1.de>
Wed, 2 Nov 2011 05:27:46 +0000 (06:27 +0100)
committerpk910 <philipp@zoelle1.de>
Wed, 2 Nov 2011 05:27:46 +0000 (06:27 +0100)
http://websvn.onlinegamesnet.net/revision.php?repname=ircu&path=%2F&rev=317
also documented some undocumented already build in features

doc/example.conf
doc/readme.features
include/ircd_features.h
ircd/ircd_features.c
ircd/m_join.c
ircd/m_relay.c
ircd/s_err.c

index 473efb946a33479d02642f9092b010a88bc6c7d1..235bd31b8e19ab9022c58b737329e13e5f9edc59 100644 (file)
@@ -928,12 +928,22 @@ features
 #  "HIS_REWRITE" = "TRUE";
 #  "HIS_REMOTE" = "TRUE";
 #  "HIS_NETSPLIT" = "TRUE";
+#  "ERR_CHANNELISFULL" = "Cannot join channel, channel is full (+l)";
+#  "ERR_INVITEONLYCHAN" = "Cannot join channel, you must be invited (+i)";
+#  "ERR_BANNEDFROMCHAN" = "Cannot join channel, you are banned (+b)";
+#  "ERR_BADCHANNELKEY" = "Cannot join channel, you need the correct key (+k)";
+#  "ERR_NEEDREGGEDNICK" = "Cannot join channel, you must be authed to join (+r)";
+#  "ERR_JOINACCESS" = "Cannot join channel, you don't have enough ChanServ access (+a)";
 #  "HIS_SERVERNAME" = "*.undernet.org";
 #  "HIS_SERVERINFO" = "The Undernet Underworld";
 #  "HIS_URLSERVERS" = "http://www.undernet.org/servers.php";
-#  "URLREG" = "http://cservice.undernet.org/live/";
 #  "LOC_ENABLE" = "FALSE";
 #  "LOC_TARGET" = "somenick";
+#  "CHMODE_A_ENABLE" = "TRUE";
+#  "CHMODE_A_TARGET" = "ChanServ";
+#  "CHMODE_F_ENABLE" = "TRUE";
+#  "UNKNOWN_CMD_ENABLE" = "TRUE";
+#  "UNKNOWN_CMD_TARGET" = "OpServ";
 #  "NOAMSG_TIME" = "0";
 #  "NOAMSG_NUM" = "1";
 };
index 587ad762e8f42bbd8dcdb4dbd321763d5d044813..7723b883abbf7948f7c8f987e46dfe1d96a07b0a 100644 (file)
@@ -765,14 +765,6 @@ URL_CLIENTS
 
 This defines a URL that users may visit to find compatible IRC clients.
 
-URLREG
- * Type: string
- * Default: "http://cservice.undernet.org/live/"
-
-This defines a URL that is used in server response 477 (ERR_NEEDREGGEDNICK) to
-let users know which website they must visit to obtain a proper account for
-authentication.
-
 NICKLEN
  * Type: integer
  * Default: 12
@@ -916,6 +908,26 @@ If LOC_ENABLE is on, this is the target nick where to send the requests
 to. If the nick is not online or has not umode +S or is not on a
 services server, the LOC request is discarded.
 
+CHMODE_A_ENABLE
+ * Type: boolean
+ * Default: FALSE
+
+Enable ChannelMode +a (ChanServ access).
+
+CHMODE_A_TARGET
+ * Type: string
+ * Default: NULL
+
+If CHMODE_A_ENABLE is on, this is the target nick where to send the requests
+to. If the nick is not online or has not umode +S or is not on a
+services server, the JOIN request is discarded.
+
+CHMODE_F_ENABLE
+ * Type: boolean
+ * Default: FALSE
+
+Enable ChannelMode +F (Foreward Channel).
+
 NOAMSG_TIME
  * Type: integer
  * Default: 0
@@ -927,3 +939,16 @@ NOAMSG_NUM
  * Default: 1
 
 The number the same message must occur to be blocked in channels that block multi target messages.
+
+ERR_CHANNELISFULL
+ERR_INVITEONLYCHAN
+ERR_BANNEDFROMCHAN
+ERR_BADCHANNELKEY
+ERR_NEEDREGGEDNICK
+ERR_JOINACCESS
+ * Type: string
+ * Default: Standard error messages
+This allows network admins to set custom (friendly) error messages for several
+reasons a user is not able to join a channel. Defaults are the standard errors
+from vanilla.
index d85b8736594ba0be066413469d89c76147c7b8db..13738881f05f536b9aa609ede1fcdb9fd6f1f30b 100644 (file)
@@ -69,6 +69,14 @@ enum Feature {
   FEAT_NOAMSG_TIME,
   FEAT_NOAMSG_NUM,
 
+  /* friendly error messages */
+  FEAT_ERR_CHANNELISFULL,
+  FEAT_ERR_INVITEONLYCHAN,
+  FEAT_ERR_BANNEDFROMCHAN,
+  FEAT_ERR_BADCHANNELKEY,
+  FEAT_ERR_NEEDREGGEDNICK,
+  FEAT_ERR_JOINACCESS,
+  
   /* features that probably should not be touched */
   FEAT_KILLCHASETIMELIMIT,
   FEAT_MAXCHANNELSPERUSER,
@@ -163,7 +171,6 @@ enum Feature {
   /* Misc. random stuff */
   FEAT_NETWORK,
   FEAT_URL_CLIENTS,
-  FEAT_URLREG,
   
   FEAT_UNKNOWN_CMD_ENABLE,
   FEAT_UNKNOWN_CMD_TARGET,
index d3bd41fb52fc61fb9d3cd50b21831dea9190cec1..5c57b893d4fd0c0e0ed45f9f641c8052dc2c29a3 100644 (file)
@@ -333,6 +333,15 @@ static struct FeatureDesc {
   F_I(NOAMSG_TIME, 0, 0, 0),
   F_I(NOAMSG_NUM, 0, 1, 0),
 
+  /* friendly error messages
+   * The errors below are the default */
+  F_S(ERR_CHANNELISFULL, FEAT_CASE, "Cannot join channel (+l)", 0),
+  F_S(ERR_INVITEONLYCHAN, FEAT_CASE, "Cannot join channel (+i)", 0),
+  F_S(ERR_BANNEDFROMCHAN, FEAT_CASE, "Cannot join channel (+b)", 0),
+  F_S(ERR_BADCHANNELKEY, FEAT_CASE, "Cannot join channel (+k)", 0),
+  F_S(ERR_NEEDREGGEDNICK, FEAT_CASE, "Cannot join channel (+r)", 0),
+  F_S(ERR_JOINACCESS, FEAT_CASE, "Cannot join channel (+a)", 0),
+  
   /* features that probably should not be touched */
   F_I(KILLCHASETIMELIMIT, 0, 30, 0),
   F_I(MAXCHANNELSPERUSER, 0, 10, 0),
@@ -427,7 +436,6 @@ static struct FeatureDesc {
   /* Misc. random stuff */
   F_S(NETWORK, 0, "UnderNet", 0),
   F_S(URL_CLIENTS, 0, "ftp://ftp.undernet.org/pub/irc/clients", 0),
-  F_S(URLREG, 0, "http://cservice.undernet.org/live/", 0),
 
   F_B(UNKNOWN_CMD_ENABLE, 0, 0, 0),
   F_S(UNKNOWN_CMD_TARGET, FEAT_NULL, 0, 0),
index db04f6788ebf16ca4cfd6a954517ddb94ec7d21a..66c4379650c267d1f448eb66f9d49e1c835db6c5 100644 (file)
@@ -320,17 +320,24 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
          }
          
       if (err) {
-        switch(err) {
-          case ERR_NEEDREGGEDNICK:
-            send_reply(sptr, 
-                       ERR_NEEDREGGEDNICK, 
-                       chptr->chname, 
-                       feature_str(FEAT_URLREG));            
-            break;
-          default:
+        const char *error = NULL;
+        if (err == ERR_CHANNELISFULL)
+            error = feature_str(FEAT_ERR_CHANNELISFULL);
+        else if (err == ERR_INVITEONLYCHAN)
+            error = feature_str(FEAT_ERR_INVITEONLYCHAN);
+        else if (err == ERR_BANNEDFROMCHAN)
+            error = feature_str(FEAT_ERR_BANNEDFROMCHAN);
+        else if (err == ERR_BADCHANNELKEY)
+            error = feature_str(FEAT_ERR_BADCHANNELKEY);
+        else if (err == ERR_NEEDREGGEDNICK)
+            error = feature_str(FEAT_ERR_NEEDREGGEDNICK);
+        else if (err == ERR_JOINACCESS)
+            error = feature_str(FEAT_ERR_JOINACCESS);
+        
+        if (error)
+            send_reply(sptr, err, chptr->chname, error);
+        else
             send_reply(sptr, err, chptr->chname);
-            break;
-        }
         continue;
       }
          
index 209d65a95cbab8141b3eb832861c287ffbcd8725..ed8a758d117b43af398f0a7af53a9af09b6412d4 100644 (file)
@@ -235,7 +235,7 @@ signed int ms_relay(struct Client* cptr, struct Client* sptr, signed int parc, c
             IsChannelName(chptr->mode.altchan) && strIsIrcCh(chptr->mode.altchan)) {
        mode_a_check_altchan(acptr,chptr->mode.altchan);
          }
-         send_reply(acptr, ERR_JOINACCESS, parv[3]);
+         send_reply(acptr, ERR_JOINACCESS, parv[3], feature_str(FEAT_ERR_JOINACCESS));
         }
        }
 
index 49f8a8a56f8716c6536f6b6ccd5baf4bed400000..ede3c24b74119f2d5cfc2bb45e0b964eb15da886 100644 (file)
@@ -972,21 +972,21 @@ static Numeric replyTable[] = {
 /* 469 */
   { 0 },
 /* 470 */
-  { ERR_JOINACCESS, "%s :Cannot join channel (+a)", "470" },
+  { ERR_JOINACCESS, "%s :%s", "470" },
 /* 471 */
-  { ERR_CHANNELISFULL, "%s :Cannot join channel (+l)", "471" },
+  { ERR_CHANNELISFULL, "%s :%s", "471" },
 /* 472 */
   { ERR_UNKNOWNMODE, "%c :is unknown mode char to me", "472" },
 /* 473 */
-  { ERR_INVITEONLYCHAN, "%s :Cannot join channel (+i)", "473" },
+  { ERR_INVITEONLYCHAN, "%s :%s", "473" },
 /* 474 */
-  { ERR_BANNEDFROMCHAN, "%s :Cannot join channel (+b)", "474" },
+  { ERR_BANNEDFROMCHAN, "%s :%s", "474" },
 /* 475 */
-  { ERR_BADCHANNELKEY, "%s :Cannot join channel (+k)", "475" },
+  { ERR_BADCHANNELKEY, "%s :%s", "475" },
 /* 476 */
   { ERR_BADCHANMASK, "%s :Bad Channel Mask", "476" },
 /* 477 */
-  { ERR_NEEDREGGEDNICK, "%s :Cannot join channel (+r): this channel requires authentication -- you can obtain an account from %s", "477" },
+  { ERR_NEEDREGGEDNICK, "%s :%s", "477" },
 /* 478 */
   { ERR_BANLISTFULL, "%s %s :Channel ban/ignore list is full", "478" },
 /* 479 */