changeset 2771:450f4f9d2f23

[gaim-migrate @ 2784] maybe this is better? committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 19 Nov 2001 22:25:40 +0000
parents 24ebd5e321e4
children f9227268db25
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Mon Nov 19 19:43:07 2001 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Nov 19 22:25:40 2001 +0000
@@ -398,6 +398,34 @@
 			buddy->msg = msg ? g_strdup(msg) : NULL;
 			yd->login = g_slist_append(yd->login, buddy);
 			break;
+		case 60: /* uh */
+			while (yd->login) {
+				buddy = yd->login->data;
+				state = buddy->state;
+				yd->login = g_slist_remove(yd->login, buddy);
+				if (state == YAHOO_STATUS_AVAILABLE)
+					serv_got_update(gc, buddy->name, 1, 0, 0, 0, 0, 0);
+				else if (state == YAHOO_STATUS_IDLE)
+					serv_got_update(gc, buddy->name, 1, 0, 0, time(NULL) - 600,
+							(state << 1), 0);
+				else
+					serv_got_update(gc, buddy->name, 1, 0, 0, 0,
+							(state << 1) | UC_UNAVAILABLE, 0);
+				if (state == YAHOO_STATUS_CUSTOM) {
+					gpointer val = g_hash_table_lookup(yd->hash, buddy->name);
+					if (val) {
+						g_free(val);
+						g_hash_table_insert(yd->hash, buddy->name,
+								    g_strdup(buddy->msg));
+					} else
+						g_hash_table_insert(yd->hash, g_strdup(buddy->name),
+								    g_strdup(buddy->msg));
+				}
+				g_free(buddy->msg);
+				g_free(buddy->name);
+				g_free(buddy);
+			}
+			break;
 		default:
 			debug_printf("unknown login key %d\n", pair->key);
 			break;
@@ -641,6 +669,7 @@
 	case YAHOO_SERVICE_LOGON:
 		yahoo_process_logon(gc, pkt);
 		break;
+	case YAHOO_SERVICE_LOGOFF:
 	case YAHOO_SERVICE_ISAWAY:
 	case YAHOO_SERVICE_ISBACK:
 		yahoo_process_status(gc, pkt);