# HG changeset patch # User Eric Warmenhoven # Date 1005091730 0 # Node ID 4836eae8dd8cdfa7ff3f5cffc59ced4db51c7637 # Parent db2b0b7337328b0b7c779c7db7197b6cd6e9104d [gaim-migrate @ 2696] more! yay! committer: Tailor Script diff -r db2b0b733732 -r 4836eae8dd8c src/protocols/yahoo/yahoo.c --- a/src/protocols/yahoo/yahoo.c Wed Nov 07 00:03:56 2001 +0000 +++ b/src/protocols/yahoo/yahoo.c Wed Nov 07 00:08:50 2001 +0000 @@ -535,9 +535,14 @@ static void yahoo_process_contact(struct gaim_connection *gc, struct yahoo_packet *pkt) { + struct yahoo_data *yd = gc->proto_data; char *id = NULL; char *who = NULL; char *msg = NULL; + char *name = NULL; + int state = YAHOO_STATUS_AVAILABLE; + int online = FALSE; + GSList *l = pkt->hash; while (l) { @@ -548,11 +553,33 @@ who = pair->value; else if (pair->key == 14) msg = pair->value; + else if (pair->key == 7) + name = pair->value; + else if (pair->key == 10) + state = strtol(pair->value, NULL, 10); + else if (pair->key == 13) + online = strtol(pair->value, NULL, 10); l = l->next; } if (id) show_got_added(gc, id, who, NULL, msg); + if (name) { + if (state == YAHOO_STATUS_AVAILABLE) + serv_got_update(gc, name, 1, 0, 0, 0, 0, 0); + else if (state == YAHOO_STATUS_IDLE) + serv_got_update(gc, name, 1, 0, 0, time(NULL) - 600, (state << 1), 0); + else + serv_got_update(gc, name, 1, 0, 0, 0, (state << 1) | UC_UNAVAILABLE, 0); + if (state == YAHOO_STATUS_CUSTOM) { + gpointer val = g_hash_table_lookup(yd->hash, name); + if (val) { + g_free(val); + g_hash_table_insert(yd->hash, name, g_strdup(msg)); + } else + g_hash_table_insert(yd->hash, g_strdup(name), g_strdup(msg)); + } + } } static void yahoo_process_mail(struct gaim_connection *gc, struct yahoo_packet *pkt)