changeset 10200:f086269582b1

[gaim-migrate @ 11317] -Get rid of a warning when using Napster -Add a little note to prpl.h -Get rid of some gratuitous debug output committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 17 Nov 2004 05:57:29 +0000
parents 76e296e16def
children 5e1ca11db043
files src/protocols/napster/napster.c src/prpl.h src/status.c
diffstat 3 files changed, 26 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/napster/napster.c	Wed Nov 17 05:41:10 2004 +0000
+++ b/src/protocols/napster/napster.c	Wed Nov 17 05:57:29 2004 +0000
@@ -164,14 +164,13 @@
 
 static char *nap_get_chat_name(GHashTable *data) {
 	char *name = g_hash_table_lookup(data, "group");
-	
+
 	/* Make sure the name has a # preceding it */
 	if (name[0] != '#') {
 		return g_strdup_printf("#%s", name);
 	}
 
 	return g_strdup(name);
-	
 }
 
 /* 400 - MSG_CLIENT_JOIN */
@@ -545,6 +544,26 @@
 		*se = "offline";
 }
 
+static GList *nap_status_types(GaimAccount *account)
+{
+	GList *types = NULL;
+	GaimStatusType *type;
+
+	g_return_val_if_fail(account != NULL, NULL);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_OFFLINE,
+									 "offline",
+									 _("Offline"), FALSE, FALSE, FALSE);
+	types = g_list_append(types, type);
+
+	type = gaim_status_type_new_full(GAIM_STATUS_ONLINE,
+									 "online",
+									 _("Online"), FALSE, FALSE, FALSE);
+	types = g_list_append(types, type);
+
+	return types;
+}
+
 static GList *nap_chat_info(GaimConnection *gc)
 {
 	GList *m = NULL;
@@ -582,7 +601,7 @@
 	nap_list_emblems,		/* list_emblems */
 	NULL,					/* status_text */
 	NULL,					/* tooltip_text */
-	NULL,					/* away_states */
+	nap_status_types,		/* status_types */
 	NULL,					/* blist_node_menu */
 	nap_chat_info,			/* chat_info */
 	nap_chat_info_defaults, /* chat_info_defaults */
--- a/src/prpl.h	Wed Nov 17 05:41:10 2004 +0000
+++ b/src/prpl.h	Wed Nov 17 05:57:29 2004 +0000
@@ -197,6 +197,10 @@
 	 */
 	char *(*tooltip_text)(GaimBuddy *buddy);
 
+	/**
+	 * This must be implemented, and must add at least the offline
+	 * and online states.
+	 */
 	GList *(*status_types)(GaimAccount *account);
 
 	GList *(*blist_node_menu)(GaimBlistNode *node);
--- a/src/status.c	Wed Nov 17 05:41:10 2004 +0000
+++ b/src/status.c	Wed Nov 17 05:57:29 2004 +0000
@@ -580,8 +580,6 @@
 {
 	GaimPresenceContext context = gaim_presence_get_context(presence);
 
-	gaim_debug_info("notify_status_update", "Context is %d\n", context);
-
 	if (context == GAIM_PRESENCE_CONTEXT_ACCOUNT)
 	{
 		GaimAccount *account = gaim_presence_get_account(presence);