mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 00:52:30 +02:00
Better !channel support - window items now have "visual_name" and channels
and queries also have "name". Normally they're identical but with !channels
the visible_name contains the short !channel name, while name contains
full !ABCDEchannel name.
The visible_name should be used whenever displaying the channel name, or as
printtext()'s target. So, this breaks a few scripts in !channels, they need
to be modified to use $channel->{visible_name} instead.
Also /LAYOUT SAVE should finally work properly with !channels.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2797 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
ee80e7601a
commit
d346fbe1a9
44 changed files with 325 additions and 247 deletions
|
|
@ -358,7 +358,8 @@ static char *expando_serverversion(SERVER_REC *server, void *item, int *free_ret
|
|||
/* target of current input (channel or QUERY nickname) */
|
||||
static char *expando_target(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
return item == NULL ? "" : ((WI_ITEM_REC *) item)->name;
|
||||
return item == NULL ? "" :
|
||||
(char *) window_item_get_target((WI_ITEM_REC *) item);
|
||||
}
|
||||
|
||||
/* client release date (in YYYYMMDD format) */
|
||||
|
|
@ -461,6 +462,12 @@ static char *expando_chatnet(SERVER_REC *server, void *item, int *free_ret)
|
|||
return server == NULL ? "" : server->connrec->chatnet;
|
||||
}
|
||||
|
||||
/* visible_name of current window item */
|
||||
static char *expando_itemname(SERVER_REC *server, void *item, int *free_ret)
|
||||
{
|
||||
return item == NULL ? "" : ((WI_ITEM_REC *) item)->visible_name;
|
||||
}
|
||||
|
||||
static void sig_message_public(SERVER_REC *server, const char *msg,
|
||||
const char *nick, const char *address,
|
||||
const char *target)
|
||||
|
|
@ -634,6 +641,9 @@ void expandos_init(void)
|
|||
expando_create("chatnet", expando_chatnet,
|
||||
"window changed", EXPANDO_ARG_NONE,
|
||||
"window server changed", EXPANDO_ARG_WINDOW, NULL);
|
||||
expando_create("itemname", expando_itemname,
|
||||
"window changed", EXPANDO_ARG_NONE,
|
||||
"window item changed", EXPANDO_ARG_WINDOW, NULL);
|
||||
|
||||
read_settings();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue