# HG changeset patch # User Rob Flynn # Date 986078814 0 # Node ID a3d857c8984e8adac5f7feefc25b13579e48fee6 # Parent 3232467ae220cf74e289650531fe38439e360083 [gaim-migrate @ 1686] IRC got away message support. committer: Tailor Script diff -r 3232467ae220 -r a3d857c8984e ChangeLog --- a/ChangeLog Sat Mar 31 07:06:55 2001 +0000 +++ b/ChangeLog Sat Mar 31 22:46:54 2001 +0000 @@ -5,6 +5,7 @@ * Can choose to not send away auto-response (thanks phzzzt) * Uh... Oscar works? For now? * IRC Plugin can do whois (right click and info) + * IRC Plugin got away message support version 0.11.0-pre9 (03/26/2001): * Can register Jabber accounts (load the Jabber plugin and click diff -r 3232467ae220 -r a3d857c8984e plugins/irc.c --- a/plugins/irc.c Sat Mar 31 07:06:55 2001 +0000 +++ b/plugins/irc.c Sat Mar 31 22:46:54 2001 +0000 @@ -450,6 +450,18 @@ g_strfreev(res); } + /* Autoresponse to an away message */ + if (((strstr(buf, " 301 ")) && (!strstr(buf, "PRIVMSG")) && (!strstr(buf, "NOTICE")))) { + char **res; + + res = g_strsplit(buf, " ", 5); + + if (!strcmp(res[1], "301")) + serv_got_im(gc, res[3], res[4] + 1, 1); + + g_strfreev(res); + } + /* Parse the list of names that we receive when we first sign on to * a channel */ @@ -1254,6 +1266,19 @@ } +static void irc_set_away(struct gaim_connection *gc, char *state, char *msg) +{ + struct irc_data *idata = (struct irc_data *)gc->proto_data; + char buf[BUF_LEN]; + + if (msg) + g_snprintf(buf, BUF_LEN, "AWAY :%s\n", msg); + else + g_snprintf(buf, BUF_LEN, "AWAY\n"); + + write(idata->fd, buf, strlen(buf)); +} + static struct prpl *my_protocol = NULL; static void irc_init(struct prpl *ret) @@ -1270,6 +1295,7 @@ ret->chat_leave = irc_chat_leave; ret->chat_send = irc_chat_send; ret->get_info = irc_get_info; + ret->set_away = irc_set_away; my_protocol = ret; }