comparison src/protocols/yahoo/yahoo.c @ 10141:e47d1bf844c9

[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 <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Mon, 25 Oct 2004 19:36:23 +0000
parents 3c3795562256
children c0ea78153d6f
comparison
equal deleted inserted replaced
10140:eab672917bcd 10141:e47d1bf844c9
364 if (!f->away) 364 if (!f->away)
365 status = "avaiablewm"; 365 status = "avaiablewm";
366 else 366 else
367 status = "away"; 367 status = "away";
368 break; 368 break;
369 case YAHOO_STATUS_IDLE: /* FIXME: handle this */ 369 case YAHOO_STATUS_IDLE:
370 break; 370 break;
371 default: 371 default:
372 gaim_debug_warning("yahoo", "Warning, unknown status %d\n", f->status); 372 gaim_debug_warning("yahoo", "Warning, unknown status %d\n", f->status);
373 break; 373 break;
374 } 374 }
379 yahoo_friend_get_status_message(f), NULL); 379 yahoo_friend_get_status_message(f), NULL);
380 else 380 else
381 gaim_prpl_got_user_status(gaim_connection_get_account(gc), name, status, NULL); 381 gaim_prpl_got_user_status(gaim_connection_get_account(gc), name, status, NULL);
382 } 382 }
383 383
384 if (f->idle != 0)
385 gaim_prpl_got_user_idle(gaim_connection_get_account(gc), name, TRUE, f->idle);
386 else
387 gaim_prpl_got_user_idle(gaim_connection_get_account(gc), name, FALSE, 0);
384 } 388 }
385 389
386 static void yahoo_process_status(GaimConnection *gc, struct yahoo_packet *pkt) 390 static void yahoo_process_status(GaimConnection *gc, struct yahoo_packet *pkt)
387 { 391 {
388 GaimAccount *account = gaim_connection_get_account(gc); 392 GaimAccount *account = gaim_connection_get_account(gc);
445 f->status = strtol(pair->value, NULL, 10); 449 f->status = strtol(pair->value, NULL, 10);
446 if ((f->status >= YAHOO_STATUS_BRB) && (f->status <= YAHOO_STATUS_STEPPEDOUT)) 450 if ((f->status >= YAHOO_STATUS_BRB) && (f->status <= YAHOO_STATUS_STEPPEDOUT))
447 f->away = 1; 451 f->away = 1;
448 else 452 else
449 f->away = 0; 453 f->away = 0;
450 if (f->status == YAHOO_STATUS_IDLE) 454
451 f->idle = time(NULL); 455 if (f->status == YAHOO_STATUS_IDLE) {
452 else 456 /* Idle may have already been set in a more precise way in case 137 */
457 if (f->idle == 0)
458 f->idle = time(NULL);
459 } else
453 f->idle = 0; 460 f->idle = 0;
461
454 if (f->status != YAHOO_STATUS_CUSTOM) 462 if (f->status != YAHOO_STATUS_CUSTOM)
455 yahoo_friend_set_status_message(f, NULL); 463 yahoo_friend_set_status_message(f, NULL);
456 464
457 f->sms = 0; 465 f->sms = 0;
458 break; 466 break;
471 /* I have no idea what it means when this is 479 /* I have no idea what it means when this is
472 * set when someone's available, but it doesn't 480 * set when someone's available, but it doesn't
473 * mean idle. */ 481 * mean idle. */
474 if (f->status == YAHOO_STATUS_AVAILABLE) 482 if (f->status == YAHOO_STATUS_AVAILABLE)
475 break; 483 break;
484
476 f->away = strtol(pair->value, NULL, 10); 485 f->away = strtol(pair->value, NULL, 10);
477 if (f->away == 2) 486 if (f->away == 2) {
478 f->idle = time(NULL); 487 /* Idle may have already been set in a more precise way in case 137 */
488 if (f->idle == 0)
489 f->idle = time(NULL);
490 }
491
479 break; 492 break;
480 case 138: /* either we're not idle, or we are but won't say how long */ 493 case 138: /* either we're not idle, or we are but won't say how long */
481 if (!f) 494 if (!f)
482 break; 495 break;
483 496