# HG changeset patch # User Matti Hamalainen # Date 1337828295 -10800 # Node ID 4556174b5be80d9b6d848d615406536497b99d6e # Parent 65bef93e44e79b4947b66cb4f21ac11efac258e3 Make nickname autocomplete separator configurable. diff -r 65bef93e44e7 -r 4556174b5be8 nnchat.c --- a/nnchat.c Thu May 24 05:47:15 2012 +0300 +++ b/nnchat.c Thu May 24 05:58:15 2012 +0300 @@ -32,6 +32,8 @@ #define SET_DELAY (5) #endif +#define SET_NICK_SEPARATOR ':' + #define SET_MAX_HISTORY (16) /* Command history length */ #define SET_KEEPALIVE (15*60) /* Ping/keepalive period in seconds */ #define SET_MAX_WINDOWS (32) @@ -51,8 +53,9 @@ *optPassword = NULL, *optPasswordCmd = NULL, *optLogFilename = NULL, - *optSite = "NN"; -char optNickSep = ':'; + *optSite = "NN", + *optNickSepStr = NULL; +char optNickSep; BOOL optDaemon = FALSE; FILE *optLogFile = NULL; BOOL setIgnoreMode = FALSE; @@ -1437,6 +1440,7 @@ th_cfg_add_comment(&tmpcfg, "General settings"); th_cfg_add_string(&tmpcfg, "username", &optUserName, NULL); th_cfg_add_string(&tmpcfg, "password", &optPassword, NULL); + th_cfg_add_comment(&tmpcfg, "Default color as a hex-triplet"); th_cfg_add_hexvalue(&tmpcfg, "color", &optUserColor, optUserColor); @@ -1448,6 +1452,9 @@ th_cfg_add_comment(&tmpcfg, "Random messages for idle timeout protection. If none are set, plain '.' is used."); th_cfg_add_string_list(&tmpcfg, "idle_messages", &setIdleMessages); + th_cfg_add_comment(&tmpcfg, "Character used as nickname auto-completion separator (default is ':')"); + th_cfg_add_string(&tmpcfg, "nick_separator", &optNickSepStr, NULL); + th_cfg_add_section(&cfg, "general", tmpcfg); @@ -1500,6 +1507,12 @@ } } + if (optNickSepStr) + optNickSep = optNickSepStr[0]; + else + optNickSep = SET_NICK_SEPARATOR; + + setBrowser = getenv("BROWSER"); if (setBrowser == NULL) setBrowser = "firefox";