diff src/protocols/yahoo/yahoo.c @ 12203:0aeda1869b32

[gaim-migrate @ 14505] (20:07:48) Bleeter : This patch does the following: 1. Reduce the 'custom default' Yahoo statuses to those found in YIM6 2. Allows long server side presence lists to be processed 3. Remove idle reporting from tooltip, as this is now handled by gtkblist committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 24 Nov 2005 01:12:03 +0000
parents cda86ce5b026
children d345299ff3bc
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Wed Nov 23 22:00:19 2005 +0000
+++ b/src/protocols/yahoo/yahoo.c	Thu Nov 24 01:12:03 2005 +0000
@@ -489,7 +489,6 @@
 	char **buddies;
 	char **tmp, **bud, *norm_bud;
 	char *grp = NULL;
-	char *perm_presence_buddies = NULL;
 
 	if (pkt->id)
 		yd->session_id = pkt->id;
@@ -515,7 +514,10 @@
 			yahoo_process_cookie(yd, pair->value);
 			break;
 		case YAHOO_SERVICE_PRESENCE_PERM:
-			perm_presence_buddies = pair->value;
+			if (!yd->tmp_serv_plist)
+				yd->tmp_serv_plist = g_string_new(pair->value);
+			else
+				g_string_append(yd->tmp_serv_plist, pair->value);
 			break;
 		}
 	}
@@ -589,8 +591,8 @@
 		      gc->account->username);
 	}
 
-	if (perm_presence_buddies) {
-		buddies = g_strsplit(perm_presence_buddies, ",", -1);
+	if (yd->tmp_serv_plist) {
+		buddies = g_strsplit(yd->tmp_serv_plist->str, ",", -1);
 		for (bud = buddies; bud && *bud; bud++) {
 			f = yahoo_friend_find(gc, *bud);
 			if (f) {
@@ -600,6 +602,8 @@
 			}
 		}
 		g_strfreev(buddies);
+		g_string_free(yd->tmp_serv_plist, TRUE);
+		yd->tmp_serv_plist = NULL;
 
 	}
 }
@@ -2627,24 +2631,16 @@
 static char *yahoo_get_status_string(enum yahoo_status a)
 {
 	switch (a) {
+	case YAHOO_STATUS_BUSY:
+		return _("Busy");
+	case YAHOO_STATUS_STEPPEDOUT:
+		return _("Stepped Out");
 	case YAHOO_STATUS_BRB:
 		return _("Be Right Back");
-	case YAHOO_STATUS_BUSY:
-		return _("Busy");
-	case YAHOO_STATUS_NOTATHOME:
-		return _("Not At Home");
 	case YAHOO_STATUS_NOTATDESK:
 		return _("Not At Desk");
-	case YAHOO_STATUS_NOTINOFFICE:
-		return _("Not In Office");
 	case YAHOO_STATUS_ONPHONE:
 		return _("On The Phone");
-	case YAHOO_STATUS_ONVACATION:
-		return _("On Vacation");
-	case YAHOO_STATUS_OUTTOLUNCH:
-		return _("Out To Lunch");
-	case YAHOO_STATUS_STEPPEDOUT:
-		return _("Stepped Out");
 	case YAHOO_STATUS_INVISIBLE:
 		return _("Invisible");
 	case YAHOO_STATUS_IDLE:
@@ -2769,12 +2765,6 @@
 		status = g_strdup_printf("\n%s", _("Not on server list"));
 	else {
 		switch (f->status) {
-		case YAHOO_STATUS_IDLE:
-			if (f->idle == -1) {
-				status = g_strdup(yahoo_get_status_string(f->status));
-				break;
-			}
-			return NULL;
 		case YAHOO_STATUS_CUSTOM:
 			if (!yahoo_friend_get_status_message(f))
 				return NULL;
@@ -3211,33 +3201,21 @@
 	                                       gaim_value_new(GAIM_TYPE_STRING), NULL);
 	types = g_list_append(types, type);
 
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_BRB, _("Be Right Back"), TRUE);
-	types = g_list_append(types, type);
-
 	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_BUSY, _("Busy"), TRUE);
 	types = g_list_append(types, type);
 
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTATHOME, _("Not At Home"), TRUE);
+	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_STEPPEDOUT, _("Stepped Out"), TRUE);
+	types = g_list_append(types, type);
+
+	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_BRB, _("Be Right Back"), TRUE);
 	types = g_list_append(types, type);
 
 	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTATDESK, _("Not At Desk"), TRUE);
 	types = g_list_append(types, type);
 
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_NOTINOFFICE, _("Not In Office"), TRUE);
-	types = g_list_append(types, type);
-
 	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_ONPHONE, _("On The Phone"), TRUE);
 	types = g_list_append(types, type);
 
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_ONVACATION, _("On Vacation"), TRUE);
-	types = g_list_append(types, type);
-
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_OUTTOLUNCH, _("Out To Lunch"), TRUE);
-	types = g_list_append(types, type);
-
-	type = gaim_status_type_new(GAIM_STATUS_AWAY, YAHOO_STATUS_TYPE_STEPPEDOUT, _("Stepped Out"), TRUE);
-	types = g_list_append(types, type);
-
 	type = gaim_status_type_new(GAIM_STATUS_HIDDEN, YAHOO_STATUS_TYPE_INVISIBLE, _("Invisible"), TRUE);
 	types = g_list_append(types, type);