summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-03 13:16:36 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-03 13:16:36 +0000
commit6e24ac82ed5d87e98821a6af4c795f53f1958ac0 (patch)
tree0007a0ceef894c4e6c419b7597a64318789cc96b /src/core
parentab99ca723136dfbd689154bd179bf91e749ceaa9 (diff)
downloadirssi-6e24ac82ed5d87e98821a6af4c795f53f1958ac0.zip
Commands that accepeted * parameter as active channel didn't work properly -
active channel was used but the * wasn't removed from parameters. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1961 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r--src/core/commands.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/commands.c b/src/core/commands.c
index 1dedc543..daea0ea3 100644
--- a/src/core/commands.c
+++ b/src/core/commands.c
@@ -639,10 +639,14 @@ static char *get_optional_channel(WI_ITEM_REC *active_item, char **data)
origtmp = tmp = g_strdup(*data);
channel = cmd_get_param(&tmp);
- if (strcmp(channel, "*") == 0 ||
- !server_ischannel(active_item->server, channel))
+ if (strcmp(channel, "*") == 0) {
+ /* "*" means active channel */
+ cmd_get_param(data);
ret = active_item->name;
- else {
+ } else if (!server_ischannel(active_item->server, channel)) {
+ /* we don't have channel parameter - use active channel */
+ ret = active_item->name;
+ } else {
/* Find the channel first and use it's name if found.
This allows automatic !channel -> !XXXXXchannel replaces. */
channel = cmd_get_param(data);