From: Tim R. <ma...@us...> - 2004-10-25 19:36:35
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8480/src/protocols/yahoo Modified Files: yahoo.c Log Message: 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. Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.284 retrieving revision 1.285 diff -u -d -p -r1.284 -r1.285 --- yahoo.c 19 Oct 2004 05:17:14 -0000 1.284 +++ yahoo.c 25 Oct 2004 19:36:23 -0000 1.285 @@ -366,7 +366,7 @@ static void yahoo_update_status(GaimConn 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 @@ static void yahoo_update_status(GaimConn 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 @@ static void yahoo_process_status(GaimCon 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 @@ static void yahoo_process_status(GaimCon * 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) |