changeset 9979:920f6a5bcb4a

[gaim-migrate @ 10890] I rewrote one function. Several more to go. Still doesn't compile. And I used AWAY some places that need to be EXTENDED_AWAY or possibly UNAVAILABLE. I'll figure it out later. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 08 Sep 2004 04:37:30 +0000
parents dfc56946ef53
children 1cad29047886
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 64 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Wed Sep 08 04:34:51 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Sep 08 04:37:30 2004 +0000
@@ -3023,28 +3023,71 @@
 		g_free(msg2);
 }
 
-static GList *yahoo_away_states(GaimConnection *gc)
+static GList *yahoo_status_types(GaimAccount *account)
 {
-	GList *m = NULL;
-	struct yahoo_data *yd = gc->proto_data;
-
-	m = g_list_append(m, _("Available"));
-	if (!yd->wm) {
-		m = g_list_append(m, _("Be Right Back"));
-		m = g_list_append(m, _("Busy"));
-		m = g_list_append(m, _("Not At Home"));
-		m = g_list_append(m, _("Not At Desk"));
-		m = g_list_append(m, _("Not In Office"));
-		m = g_list_append(m, _("On The Phone"));
-		m = g_list_append(m, _("On Vacation"));
-		m = g_list_append(m, _("Out To Lunch"));
-		m = g_list_append(m, _("Stepped Out"));
+	GaimConnection *gc = gaim_account_get_connection(account);
+	struct yahoo_data *yd = NULL;
+	GaimStatusType *type;
+	GList *types = NULL;
+
+	if (gc)
+		yd = gc->proto_data;
+
+	type = gaim_status_type_new(GAIM_STATUS_OFFLINE, "offline", _("Offline"), FALSE);
+	types = g_list_append(types, type);
+
+	type = gaim_status_type_new(GAIM_STATUS_ONLINE, "online", _("Online"), FALSE);
+	types = g_list_append(types, type);
+
+	type = gaim_status_type_new(GAIM_STATUS_AVAILABLE, "available", _("Available"), TRUE);
+	types = g_list_append(types, type);
+
+	if (!yd || !yd->wm) {
+		type = gaim_status_type_new_with_attrs(GAIM_STATUS_AVAILABLE, "available-wm",
+		                                       "Available With Message", TRUE, TRUE, FALSE,
+		                                       "message", _("Message"),
+		                                       gaim_value_new(GAIM_TYPE_STRING));
+		types = g_list_append(types, type);
+
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "brb", _("Be Right Back"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "busy", _("Busy"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "notathome", _("Not At Home"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "notatdesk", _("Not At Desk"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "notinoffice", _("Not In Office"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "onthephone", _("On The Phone"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "onvacation", _("On Vacation"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "outtolunch", _("Out To Lunch"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new(GAIM_STATUS_AWAY, "steppedout", _("Stepped Out"), TRUE);
+		types = g_list_append(types, type);
+
+		type = gaim_status_type_new_with_attrs(GAIM_STATUS_AWAY, "away",
+		                                       "Away", TRUE, TRUE, FALSE,
+		                                       "message", _("Message"),
+		                                       gaim_value_new(GAIM_TYPE_STRING));
+		types = g_list_append(types, type);
 	}
-	m = g_list_append(m, _("Invisible"));
-	if (!yd->wm)
-		m = g_list_append(m, GAIM_AWAY_CUSTOM);
-
-	return m;
+	type = gaim_status_type_new(GAIM_STATUS_HIDDEN, "invisible", _("Invisible"), TRUE);
+	types = g_list_append(types, type);
+
+
+	return types;
 }
 
 static void yahoo_keepalive(GaimConnection *gc)
@@ -3289,7 +3332,7 @@
 	yahoo_list_emblems,
 	yahoo_status_text,
 	yahoo_tooltip_text,
-	yahoo_away_states,
+	yahoo_status_types,
 	yahoo_blist_node_menu,
 	yahoo_c_info,
 	yahoo_c_info_defaults,