diff options
author | Timo Sirainen <cras@irssi.org> | 2000-12-10 05:41:01 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-12-10 05:41:01 +0000 |
commit | 9681252b4c4d44a9d2c8d6ea1ddd0476a20e1fc3 (patch) | |
tree | d33653d240239c38a15974918705dd73aeabe1b7 /src | |
parent | 9157c49b84445afdfdba489496ffdbfa58c05b59 (diff) | |
download | irssi-9681252b4c4d44a9d2c8d6ea1ddd0476a20e1fc3.zip |
added $topic expando
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@988 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/core/expandos.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/expandos.c b/src/core/expandos.c index 757f6b82..2dbb252e 100644 --- a/src/core/expandos.c +++ b/src/core/expandos.c @@ -302,6 +302,13 @@ static char *expando_sysrelease(SERVER_REC *server, void *item, int *free_ret) return sysrelease; } +/* Topic of active channel (or address of queried nick) */ +static char *expando_topic(SERVER_REC *server, void *item, int *free_ret) +{ + return IS_CHANNEL(item) ? CHANNEL(item)->topic : + IS_QUERY(item) ? QUERY(item)->address : ""; +} + /* Server tag */ static char *expando_servertag(SERVER_REC *server, void *item, int *free_ret) { @@ -436,6 +443,11 @@ void expandos_init(void) "", EXPANDO_NEVER, NULL); expando_create("sysrelease", expando_sysrelease, "", EXPANDO_NEVER, NULL); + expando_create("topic", expando_topic, + "window changed", EXPANDO_ARG_NONE, + "window item changed", EXPANDO_ARG_WINDOW, + "channel topic changed", EXPANDO_ARG_WINDOW_ITEM, + "query address changed", EXPANDO_ARG_WINDOW_ITEM, NULL); expando_create("tag", expando_servertag, "window changed", EXPANDO_ARG_NONE, "window server changed", EXPANDO_ARG_WINDOW, NULL); @@ -457,6 +469,7 @@ void expandos_deinit(void) expando_destroy("sysname", expando_sysname); expando_destroy("sysrelease", expando_sysrelease); + expando_destroy("topic", expando_servertag); expando_destroy("tag", expando_servertag); expando_destroy("chatnet", expando_chatnet); |