/* 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 : "";
+ if (IS_CHANNEL(item))
+ return CHANNEL(item)->topic;
+ if (IS_QUERY(item)) {
+ QUERY_REC *query = QUERY(item);
+
+ if (query->server_tag == NULL)
+ return "";
+
+ *free_ret = TRUE;
+ return query->address == NULL ?
+ g_strdup_printf("(%s)", query->server_tag) :
+ g_strdup_printf("%s (%s)", query->address,
+ query->server_tag);
+ }
+ return "";
}
/* Server tag */