# HG changeset patch # User Rob Flynn # Date 976822847 0 # Node ID b319e507a36a663dbfe66b4c38ffed22e68e90fd # Parent ba196bf5c4cd7169baeea8bd958677357f8ef2ad [gaim-migrate @ 1288] Away/Idle now works. committer: Tailor Script diff -r ba196bf5c4cd -r b319e507a36a STATUS --- a/STATUS Thu Dec 14 19:31:51 2000 +0000 +++ b/STATUS Thu Dec 14 19:40:47 2000 +0000 @@ -1,4 +1,4 @@ -STATUS of GAIM CVS tree. Last modified $Date: 2000-12-14 14:31:51 -0500 (Thu, 14 Dec 2000) $ by $Author: robflynn $. +STATUS of GAIM CVS tree. Last modified $Date: 2000-12-14 14:40:47 -0500 (Thu, 14 Dec 2000) $ by $Author: robflynn $. This file is meant to provide gaim users who use the CVS version to see whether they actually want to compile what they just checked out. Gaim CVS is usually @@ -99,10 +99,12 @@ === MSN currently supports signing on/off, sending and receiving messages. The -buddylist is functional. It also supports permit and deny lists. When sending -the initial message (to start a conversation) there will be a small delay. It -will appear as if the client has frozen. This will not always be the case. -I have a fix that I havent taken the time to write yet. +buddylist is functional. It also supports permi/deny lists and going +away/idle. + +When sending the initial message (to start a conversation) there will be a small +delay. It will appear as if the client has frozen. This will not always be the +case. I have a fix that I havent taken the time to write yet. ICQ diff -r ba196bf5c4cd -r b319e507a36a plugins/msn/msn.c --- a/plugins/msn/msn.c Thu Dec 14 19:31:51 2000 +0000 +++ b/plugins/msn/msn.c Thu Dec 14 19:40:47 2000 +0000 @@ -751,6 +751,38 @@ } +static void msn_set_away(struct gaim_connection *gc, char *msg) { + struct msn_data *mdata = (struct msn_data *)gc->proto_data; + time_t trId = time((time_t *)NULL); + gchar buf[4096]; + + if (msg) { + g_snprintf(buf, 4096, "CHG %d AWY\n", trId); + } else if (gc->is_idle) { + g_snprintf(buf, 4096, "CHG %d IDL\n", trId); + } else { + g_snprintf(buf, 4096, "CHG %d NLN\n", trId); + } + + write(mdata->fd, buf, strlen(buf)); + +} + +static void msn_set_idle(struct gaim_connection *gc, int idle) { + struct msn_data *mdata = (struct msn_data *)gc->proto_data; + time_t trId = time((time_t *)NULL); + gchar buf[4096]; + + if (idle) { + g_snprintf(buf, 4096, "CHG %d IDL\n", trId); + } else { + g_snprintf(buf, 4096, "CHG %d NLN\n", trId); + } + + write(mdata->fd, buf, strlen(buf)); + +} + static struct prpl *my_protocol = NULL; void msn_init(struct prpl *ret) { @@ -764,12 +796,12 @@ ret->send_im = msn_send_im; ret->set_info = NULL; ret->get_info = NULL; - ret->set_away = NULL; + ret->set_away = msn_set_away; ret->get_away_msg = NULL; ret->set_dir = NULL; ret->get_dir = NULL; ret->dir_search = NULL; - ret->set_idle = NULL; + ret->set_idle = msn_set_idle; ret->change_passwd = NULL; ret->add_buddy = msn_add_buddy; ret->add_buddies = NULL;