diff options
author | Timo Sirainen <cras@irssi.org> | 2002-10-14 11:47:10 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-10-14 11:47:10 +0000 |
commit | 42d4598e06040c7564086a3b81d4ad5c511fdf72 (patch) | |
tree | 125d5285c45380d0a56c31d35fab2798258bc60d /src/irc | |
parent | 40f2e1caf558feaad8cb335f9d41f457349dff08 (diff) | |
download | irssi-42d4598e06040c7564086a3b81d4ad5c511fdf72.zip |
/MSG !channel is now expanded to full !12345channel
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2944 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-servers.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index f715e1ee..8a3f5bed 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -74,7 +74,8 @@ static int ischannel_func(SERVER_REC *server, const char *data) static void send_message(SERVER_REC *server, const char *target, const char *msg, int target_type) { - IRC_SERVER_REC *ircserver; + IRC_SERVER_REC *ircserver; + CHANNEL_REC *channel; char *str; ircserver = IRC_SERVER(server); @@ -82,6 +83,13 @@ static void send_message(SERVER_REC *server, const char *target, g_return_if_fail(target != NULL); g_return_if_fail(msg != NULL); + if (*target == '!') { + /* !chan -> !12345chan */ + channel = channel_find(server, target); + if (channel != NULL && g_strcasecmp(channel->name, target) != 0) + target = channel->name; + } + str = g_strdup_printf("PRIVMSG %s :%s", target, msg); irc_send_cmd_split(ircserver, str, 2, ircserver->max_msgs_in_cmd); g_free(str); |