summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);