comparison src/protocols/yahoo/yahoo.c @ 4732:c15e0699acae

[gaim-migrate @ 5047] hopefully this doesn't break anything. - Capabilities are back in the tooltips - Jabber does the neat status thing in the buddy list - jabber "broken" buddies are gone! woohoo! - most of the right-click menu items moved back to where they used to live, but Get Info remains at the top, because that's where it should be. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 13 Mar 2003 06:08:56 +0000
parents 6f0ecc21db46
children 01cae9259e2f
comparison
equal deleted inserted replaced
4731:6f0ecc21db46 4732:c15e0699acae
406 case 17: /* in chat? */ 406 case 17: /* in chat? */
407 break; 407 break;
408 case 13: /* in pager? */ 408 case 13: /* in pager? */
409 if (pkt->service == YAHOO_SERVICE_LOGOFF || 409 if (pkt->service == YAHOO_SERVICE_LOGOFF ||
410 strtol(pair->value, NULL, 10) == 0) { 410 strtol(pair->value, NULL, 10) == 0) {
411 serv_got_update(gc, name, 0, 0, 0, 0, 0, 0); 411 serv_got_update(gc, name, 0, 0, 0, 0, 0);
412 break; 412 break;
413 } 413 }
414 if (g_hash_table_lookup(yd->games, name)) 414 if (g_hash_table_lookup(yd->games, name))
415 gamestate = YAHOO_STATUS_GAME; 415 gamestate = YAHOO_STATUS_GAME;
416 if (state == YAHOO_STATUS_AVAILABLE) 416 if (state == YAHOO_STATUS_AVAILABLE)
417 serv_got_update(gc, name, 1, 0, 0, 0, gamestate, 0); 417 serv_got_update(gc, name, 1, 0, 0, 0, gamestate);
418 else 418 else
419 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE | gamestate, 0); 419 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE | gamestate);
420 if (state == YAHOO_STATUS_CUSTOM) { 420 if (state == YAHOO_STATUS_CUSTOM) {
421 gpointer val = g_hash_table_lookup(yd->hash, name); 421 gpointer val = g_hash_table_lookup(yd->hash, name);
422 if (val) { 422 if (val) {
423 g_free(val); 423 g_free(val);
424 g_hash_table_insert(yd->hash, name, 424 g_hash_table_insert(yd->hash, name,
525 g_free(free1); 525 g_free(free1);
526 g_free(free2); 526 g_free(free2);
527 } 527 }
528 g_hash_table_insert (yd->games, g_strdup(from), g_strdup(game)); 528 g_hash_table_insert (yd->games, g_strdup(from), g_strdup(game));
529 if (bud) 529 if (bud)
530 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc | YAHOO_STATUS_GAME, 0); 530 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc | YAHOO_STATUS_GAME);
531 } else { 531 } else {
532 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) { 532 if (g_hash_table_lookup_extended (yd->games, from, free1, free2)) {
533 g_free(free1); 533 g_free(free1);
534 g_free(free2); 534 g_free(free2);
535 g_hash_table_remove (yd->games, from); 535 g_hash_table_remove (yd->games, from);
536 } 536 }
537 if (bud) 537 if (bud)
538 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc & ~YAHOO_STATUS_GAME, 0); 538 serv_got_update(gc, from, 1, 0, 0, 0, bud->uc & ~YAHOO_STATUS_GAME);
539 } 539 }
540 } 540 }
541 } 541 }
542 542
543 static void yahoo_process_message(struct gaim_connection *gc, struct yahoo_packet *pkt) 543 static void yahoo_process_message(struct gaim_connection *gc, struct yahoo_packet *pkt)
612 612
613 if (id) 613 if (id)
614 show_got_added(gc, id, who, NULL, msg); 614 show_got_added(gc, id, who, NULL, msg);
615 if (name) { 615 if (name) {
616 if (state == YAHOO_STATUS_AVAILABLE) 616 if (state == YAHOO_STATUS_AVAILABLE)
617 serv_got_update(gc, name, 1, 0, 0, 0, 0, 0); 617 serv_got_update(gc, name, 1, 0, 0, 0, 0);
618 else if (state == YAHOO_STATUS_IDLE) 618 else if (state == YAHOO_STATUS_IDLE)
619 serv_got_update(gc, name, 1, 0, 0, time(NULL) - 600, (state << 2), 0); 619 serv_got_update(gc, name, 1, 0, 0, time(NULL) - 600, (state << 2));
620 else 620 else
621 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE, 0); 621 serv_got_update(gc, name, 1, 0, 0, 0, (state << 2) | UC_UNAVAILABLE);
622 if (state == YAHOO_STATUS_CUSTOM) { 622 if (state == YAHOO_STATUS_CUSTOM) {
623 gpointer val = g_hash_table_lookup(yd->hash, name); 623 gpointer val = g_hash_table_lookup(yd->hash, name);
624 if (val) { 624 if (val) {
625 g_free(val); 625 g_free(val);
626 g_hash_table_insert(yd->hash, name, 626 g_hash_table_insert(yd->hash, name,
1065 g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game); 1065 g_snprintf(url, sizeof url, "http://games.yahoo.com/games/%s", game);
1066 open_url(NULL, url); 1066 open_url(NULL, url);
1067 g_free(game); 1067 g_free(game);
1068 } 1068 }
1069 1069
1070 static const char *yahoo_status_text(struct buddy *b) 1070 static char *yahoo_status_text(struct buddy *b)
1071 {
1072 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
1073 if (b->uc & UC_UNAVAILABLE) {
1074 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
1075 return yahoo_get_status_string(b->uc >> 2);
1076 else
1077 return g_hash_table_lookup(yd->hash, b->name);
1078 }
1079 return NULL;
1080 }
1081
1082 static char *yahoo_tooltip_text(struct buddy *b)
1083 { 1071 {
1084 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data; 1072 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
1085 if (b->uc & UC_UNAVAILABLE) { 1073 if (b->uc & UC_UNAVAILABLE) {
1086 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM) 1074 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
1087 return g_strdup(yahoo_get_status_string(b->uc >> 2)); 1075 return g_strdup(yahoo_get_status_string(b->uc >> 2));
1088 else 1076 else
1089 return g_strdup(g_hash_table_lookup(yd->hash, b->name)); 1077 return strip_html(g_hash_table_lookup(yd->hash, b->name));
1078 }
1079 return NULL;
1080 }
1081
1082 static char *yahoo_tooltip_text(struct buddy *b)
1083 {
1084 struct yahoo_data *yd = (struct yahoo_data*)b->account->gc->proto_data;
1085 if (b->uc & UC_UNAVAILABLE) {
1086 if ((b->uc >> 2) != YAHOO_STATUS_CUSTOM)
1087 return g_strdup(yahoo_get_status_string(b->uc >> 2));
1088 else
1089 return strip_html(g_hash_table_lookup(yd->hash, b->name));
1090 } 1090 }
1091 return NULL; 1091 return NULL;
1092 } 1092 }
1093 1093
1094 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who) 1094 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who)