Просмотр исходного кода

* Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)

svn: 3773
Bryan Drewery 18 лет назад
Родитель
Сommit
7ab81c4795
4 измененных файлов с 6 добавлено и 4 удалено
  1. 1 0
      doc/UPDATES
  2. 2 3
      src/mod/server.mod/servmsg.c
  3. 2 0
      src/set.c
  4. 1 1
      src/set.h

+ 1 - 0
doc/UPDATES

@@ -1,4 +1,5 @@
 1.2.16 - http://wraith.botpack.net/milestone/1.2.16
 1.2.16 - http://wraith.botpack.net/milestone/1.2.16
+* Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)
 
 
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 1.2.15 - http://wraith.botpack.net/milestone/1.2.15
 * Fix a possible segfault when binaries compiled wrong
 * Fix a possible segfault when binaries compiled wrong

+ 2 - 3
src/mod/server.mod/servmsg.c

@@ -12,7 +12,6 @@ static time_t last_ctcp    = (time_t) 0L;
 static int    count_ctcp   = 0;
 static int    count_ctcp   = 0;
 static char   altnick_char = 0;
 static char   altnick_char = 0;
 static unsigned int rolls = 0;
 static unsigned int rolls = 0;
-#define ALTCHARS "-_\\`^[]"
 #define ROLL_RIGHT
 #define ROLL_RIGHT
 #undef ROLL_LEFT
 #undef ROLL_LEFT
 static void rotate_nick(char *nick, char *orignick)
 static void rotate_nick(char *nick, char *orignick)
@@ -22,7 +21,7 @@ static void rotate_nick(char *nick, char *orignick)
 
 
   /* First run? */
   /* First run? */
   if (altnick_char == 0 && !rolls) {
   if (altnick_char == 0 && !rolls) {
-    altnick_char = ALTCHARS[0];
+    altnick_char = altchars[0];
     /* the nick is already as long as it can be. */
     /* the nick is already as long as it can be. */
     if (len == (unsigned) nick_len) {
     if (len == (unsigned) nick_len) {
       /* make the last char the current altnick_char */
       /* make the last char the current altnick_char */
@@ -35,7 +34,7 @@ static void rotate_nick(char *nick, char *orignick)
   } else {
   } else {
     char *p = NULL;
     char *p = NULL;
 
 
-    if ((p = strchr(ALTCHARS, altnick_char)))
+    if ((p = strchr(altchars, altnick_char)))
       p++;
       p++;
     /* if we haven't been rolling, use the ALTCHARS
     /* if we haven't been rolling, use the ALTCHARS
      */
      */

+ 2 - 0
src/set.c

@@ -22,6 +22,7 @@
 
 
 #include "set_default.h"
 #include "set_default.h"
 
 
+char *altchars = NULL;
 char alias[1024] = "";
 char alias[1024] = "";
 bool auth_chan;
 bool auth_chan;
 char auth_key[51] = "";
 char auth_key[51] = "";
@@ -64,6 +65,7 @@ char usermode[15] = "";
 
 
 static variable_t vars[] = {
 static variable_t vars[] = {
  VAR("alias", 		alias,			VAR_STRING|VAR_LIST|VAR_NOLOC|VAR_PERM,		0, 0, DEFAULT_ALIAS),
  VAR("alias", 		alias,			VAR_STRING|VAR_LIST|VAR_NOLOC|VAR_PERM,		0, 0, DEFAULT_ALIAS),
+ VAR("altchars",	altchars,		VAR_STRING|VAR_NOLHUB,				0, 0, "-_\\`^[]"),
  VAR("auth-chan",	&auth_chan,		VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "1"),
  VAR("auth-chan",	&auth_chan,		VAR_INT|VAR_BOOL|VAR_NOLHUB,			0, 1, "1"),
  VAR("auth-key",	auth_key,		VAR_STRING|VAR_PERM,				0, 0, NULL),
  VAR("auth-key",	auth_key,		VAR_STRING|VAR_PERM,				0, 0, NULL),
  VAR("auth-prefix",	auth_prefix,		VAR_STRING|VAR_NOLHUB|VAR_PERM,			0, 0, "+"),
  VAR("auth-prefix",	auth_prefix,		VAR_STRING|VAR_NOLHUB|VAR_PERM,			0, 0, "+"),

+ 1 - 1
src/set.h

@@ -64,7 +64,7 @@ typedef struct rate_b {
 
 
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 extern char		auth_key[], auth_prefix[2], motd[], *def_chanset, alias[],
 			msgident[], msginvite[], msgop[], msgpass[],
 			msgident[], msginvite[], msgop[], msgpass[],
-                        homechan[];
+                        homechan[], *altchars;
 extern bool		dccauth, auth_obscure, offensive_bans, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway;
 extern bool		dccauth, auth_obscure, offensive_bans, manop_warn, auth_chan, oidentd, ident_botnick, irc_autoaway;
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 extern int		cloak_script, fight_threshold, fork_interval, in_bots, set_noshare, dcc_autoaway,
 			kill_threshold, lag_threshold, op_bots, hijack, login, promisc, trace,
 			kill_threshold, lag_threshold, op_bots, hijack, login, promisc, trace,