pidgin: ec0b14c1: The status type says that mood and moodt...
markdoliner at pidgin.im
markdoliner at pidgin.im
Mon Jun 2 05:55:42 EDT 2008
-----------------------------------------------------------------
Revision: ec0b14c175374622580c2edd88b9d8675add3a0c
Ancestor: 8a9b0211abcf1d46b196aa1ade434ff3447e9e85
Author: markdoliner at pidgin.im
Date: 2008-06-02T09:52:30
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ec0b14c175374622580c2edd88b9d8675add3a0c
Modified files:
libpurple/protocols/jabber/jabber.c
ChangeLog:
The status type says that mood and moodtext are strings, so we don't
really need to double-check that here
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c 2cdf7bfc2030cf7f88da320550f46a9cbf1c45bd
+++ libpurple/protocols/jabber/jabber.c a54cbeecea208633326b9e2363971b7ea2475d99
@@ -1504,8 +1504,7 @@ void jabber_tooltip_text(PurpleBuddy *b,
if (full) {
PurpleStatus *status;
- PurpleValue *value;
-
+
if(jb->subscription & JABBER_SUB_FROM) {
if(jb->subscription & JABBER_SUB_TO)
sub = _("Both");
@@ -1521,17 +1520,17 @@ void jabber_tooltip_text(PurpleBuddy *b,
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
More information about the Commits
mailing list