diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-01 16:49:19 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-01 16:49:19 +0000 |
commit | 9bbd2847218700fcce6a795c93b4e49508dbf892 (patch) | |
tree | 6adf768ce6b191e0184a47030d3af0e46261cdaf | |
parent | 6046bf4c5bd9c0c5047269bf690eed03a6848b0b (diff) | |
download | irssi-9bbd2847218700fcce6a795c93b4e49508dbf892.zip |
/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
-rw-r--r-- | src/fe-text/statusbar-items.c | 13 | ||||
-rw-r--r-- | src/irc/core/irc-commands.c | 10 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index 8e4a3420..a19232d2 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -590,13 +590,14 @@ static void statusbar_topic(SBAR_ITEM_REC *item, int ypos) query = irc_item_query(active_win->active); if (channel != NULL && channel->topic != NULL) topic = channel->topic; if (query != NULL && query->address != NULL) topic = query->address; - if (topic == NULL) return; - topic = strip_codes(topic); - str = g_strdup_printf("%.*s", item->size, topic); - set_color((1<<4)+15); addstr(str); - g_free(str); - g_free(topic); + if (topic != NULL) { + topic = strip_codes(topic); + str = g_strdup_printf("%.*s", item->size, topic); + set_color((1<<4)+15); addstr(str); + g_free(str); + g_free(topic); + } screen_refresh(); } diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index fe2a6281..59d85da3 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -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) { - char *params, *channame, *topic; + char *params, *args, *channame, *topic; g_return_if_fail(data != NULL); if (server == NULL || !server->connected || !irc_server_check(server)) 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", - channame, topic); + irc_send_cmdv(server, *topic == '\0' && strstr(args, "-d") == NULL ? + "TOPIC %s" : "TOPIC %s :%s", channame, topic); g_free(params); } |