From 6bc16fc0eda51648b0c569104b91c82c861424ae Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 30 Oct 2001 12:12:25 +0000 Subject: 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 --- src/irc/core/irc-expandos.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') 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); -- cgit v1.2.3