1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

/topic -d [#channel] clears the topic.

When topic cleared, the topic bar wasn't refreshed immediately.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@258 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-06-01 16:49:19 +00:00 committed by cras
parent 6046bf4c5b
commit 9bbd284721
2 changed files with 13 additions and 10 deletions

View File

@ -590,13 +590,14 @@ static void statusbar_topic(SBAR_ITEM_REC *item, int ypos)
query = irc_item_query(active_win->active); query = irc_item_query(active_win->active);
if (channel != NULL && channel->topic != NULL) topic = channel->topic; if (channel != NULL && channel->topic != NULL) topic = channel->topic;
if (query != NULL && query->address != NULL) topic = query->address; if (query != NULL && query->address != NULL) topic = query->address;
if (topic == NULL) return;
topic = strip_codes(topic); if (topic != NULL) {
str = g_strdup_printf("%.*s", item->size, topic); topic = strip_codes(topic);
set_color((1<<4)+15); addstr(str); str = g_strdup_printf("%.*s", item->size, topic);
g_free(str); set_color((1<<4)+15); addstr(str);
g_free(topic); g_free(str);
g_free(topic);
}
screen_refresh(); screen_refresh();
} }

View File

@ -334,16 +334,18 @@ static void cmd_kick(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
static void cmd_topic(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item) static void cmd_topic(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{ {
char *params, *channame, *topic; char *params, *args, *channame, *topic;
g_return_if_fail(data != NULL); g_return_if_fail(data != NULL);
if (server == NULL || !server->connected || !irc_server_check(server)) if (server == NULL || !server->connected || !irc_server_check(server))
cmd_return_error(CMDERR_NOT_CONNECTED); cmd_return_error(CMDERR_NOT_CONNECTED);
params = cmd_get_params(data, 2 | PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST, item, &channame, &topic); params = cmd_get_params(data, 3 | PARAM_FLAG_OPTCHAN |
PARAM_FLAG_OPTARGS | PARAM_FLAG_GETREST,
item, &args, &channame, &topic);
irc_send_cmdv(server, *topic == '\0' ? "TOPIC %s" : "TOPIC %s :%s", irc_send_cmdv(server, *topic == '\0' && strstr(args, "-d") == NULL ?
channame, topic); "TOPIC %s" : "TOPIC %s :%s", channame, topic);
g_free(params); g_free(params);
} }