pidgin: b4aaa0e3: Use purple_util_format_song_info in MSN/..

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Jul 12 17:30:28 EDT 2009


-----------------------------------------------------------------
Revision: b4aaa0e3f5a431d7f3c2a37891dabf557e3f1a15
Ancestor: 53abc38e3dfd2e9f8ae8c3e6532379d4b0dc333b
Author: darkrain42 at pidgin.im
Date: 2009-07-12T21:09:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b4aaa0e3f5a431d7f3c2a37891dabf557e3f1a15

Modified files:
        libpurple/protocols/jabber/jabber.c
        libpurple/protocols/msn/msn.c

ChangeLog: 

Use purple_util_format_song_info in MSN/XMPP for the buddy list status text.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	c361b6c7bdf9f80136f269ddb40f42bab5850d82
+++ libpurple/protocols/jabber/jabber.c	e4d67eda88bfc104fa70c5cc8b6580e98a0ddff9
@@ -1975,13 +1975,16 @@ char *jabber_status_text(PurpleBuddy *b)
 		ret = g_strdup(jb->error_msg);
 	} else {
 		PurplePresence *presence = purple_buddy_get_presence(b);
-		PurpleStatus *status =purple_presence_get_active_status(presence);
+		PurpleStatus *status = purple_presence_get_active_status(presence);
 		char *stripped;
 
 		if(!(stripped = purple_markup_strip_html(purple_status_get_attr_string(status, "message")))) {
 			if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
 				PurpleStatus *status = purple_presence_get_status(presence, "tune");
-				stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE));
+				const char *title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE);
+				const char *artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST);
+				const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM);
+				stripped = purple_util_format_song_info(title, artist, album, NULL);
 			}
 		}
 
============================================================
--- libpurple/protocols/msn/msn.c	eb8a3e14a6f0090059f05f39fde2b9200edbaaf4
+++ libpurple/protocols/msn/msn.c	a9f756dc1eac6c07f357ee8aca0127c7d4c0c35f
@@ -672,12 +672,7 @@ msn_status_text(PurpleBuddy *buddy)
 		if (title && *title) {
 			const char *artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST);
 			const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM);
-			media = g_strdup_printf("%s%s%s%s%s%s", title,
-			                        (artist && *artist) ? " - " : "",
-			                        (artist && *artist) ? artist : "",
-			                        (album && *album) ? " (" : "",
-			                        (album && *album) ? album : "",
-			                        (album && *album) ? ")" : "");
+			media = purple_util_format_song_info(title, artist, album, NULL);
 		}
 		else if (game && *game)
 			media = g_strdup_printf("Playing %s", game);


More information about the Commits mailing list