diff options
author | Timo Sirainen <cras@irssi.org> | 2001-10-30 12:12:25 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-10-30 12:12:25 +0000 |
commit | 6bc16fc0eda51648b0c569104b91c82c861424ae (patch) | |
tree | cbc94f2e3234d892a59e47a9cfac0e81bae191bf /src/irc/core/irc-expandos.c | |
parent | 8b6d6b086e6adfb391ab51caaf40127efe5e5c8f (diff) | |
download | irssi-6bc16fc0eda51648b0c569104b91c82c861424ae.zip |
added $cumode_space expando. Like $cumode, but gives " " if there's no mode.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1947 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/core/irc-expandos.c')
-rw-r--r-- | src/irc/core/irc-expandos.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/irc/core/irc-expandos.c b/src/irc/core/irc-expandos.c index ccd64324..2825dfc9 100644 --- a/src/irc/core/irc-expandos.c +++ b/src/irc/core/irc-expandos.c @@ -94,6 +94,16 @@ static char *expando_cumode(SERVER_REC *server, void *item, int *free_ret) return ""; } +/* expands to your usermode on channel, + op '@', halfop '%', "+" voice, " " normal */ +static char *expando_cumode_space(SERVER_REC *server, void *item, int *free_ret) +{ + char *ret; + + ret = expando_cumode(server, item, free_ret); + return *ret == '\0' ? " " : ret; +} + static void event_join(IRC_SERVER_REC *server, const char *data, const char *nick, const char *address) { @@ -127,6 +137,10 @@ void irc_expandos_init(void) "window changed", EXPANDO_ARG_NONE, "window item changed", EXPANDO_ARG_WINDOW, "nick mode changed", EXPANDO_ARG_WINDOW_ITEM, NULL); + expando_create("cumode_space", expando_cumode_space, + "window changed", EXPANDO_ARG_NONE, + "window item changed", EXPANDO_ARG_WINDOW, + "nick mode changed", EXPANDO_ARG_WINDOW_ITEM, NULL); expando_add_signal("I", "event invite", EXPANDO_ARG_SERVER); |