diff pidgin/gtkblist.c @ 24455:e344426d7c28

Add the Games and Office media to MSN as attributes tacked on to the tune status, as suggested by rlaager. Should probably generalize "tune" into "media" for 3.0. Also, updates the status text to include the album, if it's available. Fixes #4872.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 24 Nov 2008 05:51:18 +0000
parents 558523cebd10
children fdd9fd5c2086
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Mon Nov 24 00:52:41 2008 +0000
+++ b/pidgin/gtkblist.c	Mon Nov 24 05:51:18 2008 +0000
@@ -3626,6 +3626,7 @@
 	const char *name = NULL;
 	char *filename, *path;
 	PurplePresence *p;
+	PurpleStatus *tune;
 
 	if(PURPLE_BLIST_NODE_IS_CONTACT(node)) {
 		if(!gtknode->contact_expanded) {
@@ -3664,7 +3665,21 @@
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
-	if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_TUNE)) {
+	tune = purple_presence_get_status(p, "tune");
+	if (tune && purple_status_is_active(tune)) {
+		/* Only in MSN.
+		 * TODO: Replace "Tune" with generalized "Media" in 3.0. */
+		if (purple_status_get_attr_string(tune, "game") != NULL) {
+			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "game.png", NULL);
+			return _pidgin_blist_get_cached_emblem(path);
+		}
+		/* Only in MSN.
+		 * TODO: Replace "Tune" with generalized "Media" in 3.0. */
+		if (purple_status_get_attr_string(tune, "office") != NULL) {
+			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "office.png", NULL);
+			return _pidgin_blist_get_cached_emblem(path);
+		}
+		/* Regular old "tune" is the only one in all protocols. */
 		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "music.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}