cpw.malu.xmpp.idle: 971ab963: Show statuses per resource before other ...

malu at pidgin.im malu at pidgin.im
Fri Feb 6 17:10:34 EST 2009


-----------------------------------------------------------------
Revision: 971ab963635fdaf00d7a3a11affd22666eef29fa
Ancestor: be2cd9a5fc757e3ed024c6c2df60547fc162587e
Author: malu at pidgin.im
Date: 2009-02-06T22:07:50
Branch: im.pidgin.cpw.malu.xmpp.idle
URL: http://d.pidgin.im/viewmtn/revision/info/971ab963635fdaf00d7a3a11affd22666eef29fa

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

ChangeLog: 

Show statuses per resource before other info the jabber prpl adds to the tooltip

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	ff5161f37e32be9903271bd6392a03b47ac61698
+++ libpurple/protocols/jabber/jabber.c	88cb18b3672b3ccd1fa88d8707c7d45df57143e4
@@ -1704,53 +1704,6 @@ void jabber_tooltip_text(PurpleBuddy *b,
 		gboolean multiple_resources = 
 			jb->resources && g_list_next(jb->resources);
 
-		if (full) {
-			PurpleStatus *status;
-
-			if(jb->subscription & JABBER_SUB_FROM) {
-				if(jb->subscription & JABBER_SUB_TO)
-					sub = _("Both");
-				else if(jb->subscription & JABBER_SUB_PENDING)
-					sub = _("From (To pending)");
-				else
-					sub = _("From");
-			} else {
-				if(jb->subscription & JABBER_SUB_TO)
-					sub = _("To");
-				else if(jb->subscription & JABBER_SUB_PENDING)
-					sub = _("None (To pending)");
-				else
-					sub = _("None");
-			}
-
-			purple_notify_user_info_add_pair(user_info, _("Subscription"), sub);
-
-			status = purple_presence_get_active_status(presence);
-			mood = purple_status_get_attr_string(status, "mood");
-			if(mood != NULL) {
-				const char *moodtext;
-				moodtext = purple_status_get_attr_string(status, "moodtext");
-				if(moodtext != NULL) {
-					char *moodplustext = g_strdup_printf("%s (%s)", mood, moodtext);
-
-					purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext);
-					g_free(moodplustext);
-				} else
-					purple_notify_user_info_add_pair(user_info, _("Mood"), mood);
-			}
-			if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
-				PurpleStatus *tune = purple_presence_get_status(presence, "tune");
-				const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
-				const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
-				const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
-				char *playing = purple_util_format_song_info(title, artist, album, NULL);
-				if (playing) {
-					purple_notify_user_info_add_pair(user_info, _("Now Listening"), playing);
-					g_free(playing);
-				}
-			}
-		}	
-		
 		for(l=jb->resources; l; l = l->next) {
 			char *text = NULL;
 			char *res = NULL;
@@ -1805,7 +1758,56 @@ void jabber_tooltip_text(PurpleBuddy *b,
 			
 			g_free(res);
 		}
+		
+		if (full) {
+			PurpleStatus *status;
 
+
+			status = purple_presence_get_active_status(presence);
+			mood = purple_status_get_attr_string(status, "mood");
+			if(mood != NULL) {
+				const char *moodtext;
+				moodtext = purple_status_get_attr_string(status, "moodtext");
+				if(moodtext != NULL) {
+					char *moodplustext = g_strdup_printf("%s (%s)", mood, moodtext);
+
+					purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext);
+					g_free(moodplustext);
+				} else
+					purple_notify_user_info_add_pair(user_info, _("Mood"), mood);
+			}
+			if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
+				PurpleStatus *tune = purple_presence_get_status(presence, "tune");
+				const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
+				const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
+				const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
+				char *playing = purple_util_format_song_info(title, artist, album, NULL);
+				if (playing) {
+					purple_notify_user_info_add_pair(user_info, _("Now Listening"), playing);
+					g_free(playing);
+				}
+			}
+
+			if(jb->subscription & JABBER_SUB_FROM) {
+				if(jb->subscription & JABBER_SUB_TO)
+					sub = _("Both");
+				else if(jb->subscription & JABBER_SUB_PENDING)
+					sub = _("From (To pending)");
+				else
+					sub = _("From");
+			} else {
+				if(jb->subscription & JABBER_SUB_TO)
+					sub = _("To");
+				else if(jb->subscription & JABBER_SUB_PENDING)
+					sub = _("None (To pending)");
+				else
+					sub = _("None");
+			}
+
+			purple_notify_user_info_add_pair(user_info, _("Subscription"), sub);
+
+		}	
+		
 		if(!PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) {
 			purple_notify_user_info_add_pair(user_info, _("Error"), jb->error_msg);
 		}


More information about the Commits mailing list