diff options
author | Timo Sirainen <cras@irssi.org> | 2004-01-10 16:30:31 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-01-10 16:30:31 +0000 |
commit | 20e9a7cfb65f73f748c1a9378e27580ee8e026bc (patch) | |
tree | eda1fefd07d937bb44f5ef18d79346c34893ea48 /src/core | |
parent | 2337386565cb8aff81db87880b3fc5621f3da0b5 (diff) | |
download | irssi-20e9a7cfb65f73f748c1a9378e27580ee8e026bc.zip |
/msg , fix again by c0ffee
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3199 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/chat-commands.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c index 2749c5d5..e991f6fc 100644 --- a/src/core/chat-commands.c +++ b/src/core/chat-commands.c @@ -372,28 +372,28 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) } } - if (target == NULL) - target = origtarget; - - if (strcmp(target, "*") == 0) { - /* send to active channel/query */ - if (item == NULL) - cmd_param_error(CMDERR_NOT_JOINED); - - target_type = IS_CHANNEL(item) ? - SEND_TARGET_CHANNEL : SEND_TARGET_NICK; - target = (char *) window_item_get_target(item); - } else if (g_hash_table_lookup(optlist, "channel") != NULL) - target_type = SEND_TARGET_CHANNEL; - else if (g_hash_table_lookup(optlist, "nick") != NULL) - target_type = SEND_TARGET_NICK; - else { - /* Need to rely on server_ischannel(). If the protocol - doesn't really know if it's channel or nick based on the - name, it should just assume it's nick, because when typing - text to channels it's always sent with /MSG -channel. */ - target_type = server_ischannel(server, target) ? - SEND_TARGET_CHANNEL : SEND_TARGET_NICK; + if (target != NULL) { + if (strcmp(target, "*") == 0) { + /* send to active channel/query */ + if (item == NULL) + cmd_param_error(CMDERR_NOT_JOINED); + + target_type = IS_CHANNEL(item) ? + SEND_TARGET_CHANNEL : SEND_TARGET_NICK; + target = (char *) window_item_get_target(item); + } else if (g_hash_table_lookup(optlist, "channel") != NULL) + target_type = SEND_TARGET_CHANNEL; + else if (g_hash_table_lookup(optlist, "nick") != NULL) + target_type = SEND_TARGET_NICK; + else { + /* Need to rely on server_ischannel(). If the protocol + doesn't really know if it's channel or nick based on + the name, it should just assume it's nick, because + when typing text to channels it's always sent with + /MSG -channel. */ + target_type = server_ischannel(server, target) ? + SEND_TARGET_CHANNEL : SEND_TARGET_NICK; + } } if (target != NULL) |