changeset 23271:e7b6767f263b

The status type says that mood and moodtext are strings, so we don't really need to double-check that here
author Mark Doliner <mark@kingant.net>
date Mon, 02 Jun 2008 09:52:30 +0000
parents 551a42212b56
children e9dc6fdbf257
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Mon Jun 02 09:39:32 2008 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Jun 02 09:52:30 2008 +0000
@@ -1504,8 +1504,7 @@
 
 		if (full) {
 			PurpleStatus *status;
-			PurpleValue *value;
-			
+
 			if(jb->subscription & JABBER_SUB_FROM) {
 				if(jb->subscription & JABBER_SUB_TO)
 					sub = _("Both");
@@ -1521,17 +1520,17 @@
 				else
 					sub = _("None");
 			}
-			
+
 			purple_notify_user_info_add_pair(user_info, _("Subscription"), sub);
-			
+
 			status = purple_presence_get_active_status(presence);
-			value = purple_status_get_attr_value(status, "mood");
-			if (value && purple_value_get_type(value) == PURPLE_TYPE_STRING && (mood = purple_value_get_string(value))) {
-				
-				value = purple_status_get_attr_value(status, "moodtext");
-				if(value && purple_value_get_type(value) == PURPLE_TYPE_STRING) {
-					char *moodplustext = g_strdup_printf("%s (%s)",mood,purple_value_get_string(value));
-					
+			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