# HG changeset patch # User Tim Ringenbach # Date 1098732983 0 # Node ID e47d1bf844c92b92f1475003d903d9eb8c77e6fa # Parent eab672917bcdda9e335414059d51491ab5ad428e [gaim-migrate @ 11212] This is the HEAD version of Evan's patch, which does what the oldstatus version did, has the same modifications by me as the oldstatus version, but also makes idle times work again in HEAD for yahoo buddies. committer: Tailor Script diff -r eab672917bcd -r e47d1bf844c9 src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Mon Oct 25 13:45:52 2004 +0000 +++ b/src/protocols/yahoo/yahoo.c Mon Oct 25 19:36:23 2004 +0000 @@ -366,7 +366,7 @@ else status = "away"; break; - case YAHOO_STATUS_IDLE: /* FIXME: handle this */ + case YAHOO_STATUS_IDLE: break; default: gaim_debug_warning("yahoo", "Warning, unknown status %d\n", f->status); @@ -381,6 +381,10 @@ gaim_prpl_got_user_status(gaim_connection_get_account(gc), name, status, NULL); } + if (f->idle != 0) + gaim_prpl_got_user_idle(gaim_connection_get_account(gc), name, TRUE, f->idle); + else + gaim_prpl_got_user_idle(gaim_connection_get_account(gc), name, FALSE, 0); } static void yahoo_process_status(GaimConnection *gc, struct yahoo_packet *pkt) @@ -447,10 +451,14 @@ f->away = 1; else f->away = 0; - if (f->status == YAHOO_STATUS_IDLE) - f->idle = time(NULL); - else + + if (f->status == YAHOO_STATUS_IDLE) { + /* Idle may have already been set in a more precise way in case 137 */ + if (f->idle == 0) + f->idle = time(NULL); + } else f->idle = 0; + if (f->status != YAHOO_STATUS_CUSTOM) yahoo_friend_set_status_message(f, NULL); @@ -473,9 +481,14 @@ * mean idle. */ if (f->status == YAHOO_STATUS_AVAILABLE) break; + f->away = strtol(pair->value, NULL, 10); - if (f->away == 2) - f->idle = time(NULL); + if (f->away == 2) { + /* Idle may have already been set in a more precise way in case 137 */ + if (f->idle == 0) + f->idle = time(NULL); + } + break; case 138: /* either we're not idle, or we are but won't say how long */ if (!f)