diff --git a/docs/special_vars.txt b/docs/special_vars.txt index c56c452f..7b6640ef 100644 --- a/docs/special_vars.txt +++ b/docs/special_vars.txt @@ -62,6 +62,7 @@ $A .. $Z is important. $I channel you were last INVITEd to $J client version text string $K current value of CMDCHARS + $k first character in CMDCHARS $L current contents of the input line $M modes of current channel, if any $N current nickname diff --git a/src/core/expandos.c b/src/core/expandos.c index 7267c214..7f3a9420 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -318,6 +318,17 @@ static char *expando_cmdchars(SERVER_REC *server, void *item, int *free_ret) return (char *) settings_get_str("cmdchars"); } +/* first CMDCHAR */ +static char *expando_cmdchar(SERVER_REC *server, void *item, int *free_ret) +{ + char str[2] = { 0, 0 }; + + str[0] = *settings_get_str("cmdchar"); + + *free_ret = TRUE; + return g_strdup(str); +} + /* modes of current channel, if any */ static char *expando_chanmode(SERVER_REC *server, void *item, int *free_ret) { @@ -585,6 +596,8 @@ void expandos_init(void) "", EXPANDO_NEVER, NULL); expando_create("K", expando_cmdchars, "setup changed", EXPANDO_ARG_NONE, NULL); + expando_create("k", expando_cmdchar, + "setup changed", EXPANDO_ARG_NONE, NULL); expando_create("M", expando_chanmode, "window changed", EXPANDO_ARG_NONE, "window item changed", EXPANDO_ARG_WINDOW,