From 42d4598e06040c7564086a3b81d4ad5c511fdf72 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 14 Oct 2002 11:47:10 +0000 Subject: [PATCH] /MSG !channel is now expanded to full !12345channel git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2944 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-servers.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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);