changeset 23230:fda698fb2d1f

merge of '2abcbb9461812553614a4d11b0d48f1a2eface59' and '92093f7de4f345eebf236fdcdd5a11945c86c01f'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 28 May 2008 05:12:08 +0000
parents fa7cbf88a0ec (current diff) a4bfb7514607 (diff)
children 90c7142de9d0
files
diffstat 3 files changed, 28 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Wed May 28 05:10:43 2008 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Wed May 28 05:12:08 2008 +0000
@@ -960,7 +960,7 @@
 		}
 #endif
 	} else {
-		gboolean multiple_resources = jbi->resources && (g_hash_table_size(jbi->resources) > 1);
+		gboolean multiple_resources = jbi->jb->resources && (g_list_length(jbi->jb->resources) > 1);
 
 		for(resources = jbi->jb->resources; resources; resources = resources->next) {
 			char *purdy = NULL;
--- a/libpurple/protocols/oscar/oscar.c	Wed May 28 05:10:43 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Wed May 28 05:12:08 2008 +0000
@@ -761,18 +761,6 @@
 }
 
 static void
-oscar_string_convert_and_append(PurpleAccount *account, GString *str, const char *newline,
-					const char *name, const char *value)
-{
-	gchar *utf8;
-
-	if (value && value[0] && (utf8 = oscar_utf8_try_convert(account, value))) {
-		g_string_append_printf(str, "%s<b>%s:</b> %s", newline, name, utf8);
-		g_free(utf8);
-	}
-}
-
-static void
 oscar_user_info_convert_and_add(PurpleAccount *account, PurpleNotifyUserInfo *user_info,
 								const char *name, const char *value)
 {
@@ -3785,8 +3773,7 @@
 	if ((info->age > 0) && (info->age < 255)) {
 		char age[5];
 		snprintf(age, sizeof(age), "%hhd", info->age);
-		purple_notify_user_info_add_pair(user_info,
-													_("Age"), age);
+		purple_notify_user_info_add_pair(user_info, _("Age"), age);
 	}
 	if (info->personalwebpage && info->personalwebpage[0] && (utf8 = oscar_utf8_try_convert(gc->account, info->personalwebpage))) {
 		buf = g_strdup_printf("<a href=\"%s\">%s</a>", utf8, utf8);
@@ -3810,50 +3797,42 @@
 				utf8 && *utf8 ? utf8 : "");
 		g_free(utf8);
 
-		oscar_user_info_convert_and_add(account,
-				user_info, _("Status"), tmp);
+		purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
+		g_free(tmp);
 	}
 
 	oscar_user_info_convert_and_add(account, user_info, _("Additional Information"), info->info);
 	purple_notify_user_info_add_section_break(user_info);
 
 	if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) {
-		tmp = g_string_sized_new(100);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Address"), info->homeaddr);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("City"), info->homecity);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("State"), info->homestate);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Zip Code"), info->homezip);
-		
-		purple_notify_user_info_add_pair(user_info, _("Home Address"), tmp->str);
-		purple_notify_user_info_add_section_break(user_info);
-
-		g_string_free(tmp, TRUE);
+		purple_notify_user_info_add_section_header(user_info, _("Home Address"));
+
+		oscar_user_info_convert_and_add(account, user_info, _("Address"), info->homeaddr);
+		oscar_user_info_convert_and_add(account, user_info, _("City"), info->homecity);
+		oscar_user_info_convert_and_add(account, user_info, _("State"), info->homestate);
+		oscar_user_info_convert_and_add(account, user_info, _("Zip Code"), info->homezip);
 	}
 	if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) {
-		tmp = g_string_sized_new(100);
-
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Address"), info->workaddr);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("City"), info->workcity);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("State"), info->workstate);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Zip Code"), info->workzip);
-
-		purple_notify_user_info_add_pair(user_info, _("Work Address"), tmp->str);
-		purple_notify_user_info_add_section_break(user_info);
-
-		g_string_free(tmp, TRUE);
+		purple_notify_user_info_add_section_header(user_info, _("Work Address"));
+		
+		oscar_user_info_convert_and_add(account, user_info, _("Address"), info->workaddr);
+		oscar_user_info_convert_and_add(account, user_info, _("City"), info->workcity);
+		oscar_user_info_convert_and_add(account, user_info, _("State"), info->workstate);
+		oscar_user_info_convert_and_add(account, user_info, _("Zip Code"), info->workzip);
 	}
 	if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) {
-		tmp = g_string_sized_new(100);
+		purple_notify_user_info_add_section_header(user_info, _("Work Information"));
 		
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Company"), info->workcompany);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Division"), info->workdivision);
-		oscar_string_convert_and_append(account, tmp, "\n<br>", _("Position"), info->workposition);
+		oscar_user_info_convert_and_add(account, user_info, _("Company"), info->workcompany);
+		oscar_user_info_convert_and_add(account, user_info, _("Division"), info->workdivision);
+		oscar_user_info_convert_and_add(account, user_info, _("Position"), info->workposition);
+		
 		if (info->workwebpage && info->workwebpage[0] && (utf8 = oscar_utf8_try_convert(gc->account, info->workwebpage))) {
-			g_string_append_printf(tmp, "\n<br><b>%s:</b> <a href=\"%s\">%s</a>", _("Web Page"), utf8, utf8);
+			char *webpage = g_strdup_printf("<a href=\"%s\">%s</a>", utf8, utf8);
+			purple_notify_user_info_add_pair(user_info, _("Web Page"), webpage);
+			g_free(webpage);
 			g_free(utf8);
 		}
-		purple_notify_user_info_add_pair(user_info, _("Work Information"), tmp->str);
-		g_string_free(tmp, TRUE);
 	}
 
 	if (buddy != NULL)
--- a/pidgin/gtkimhtmltoolbar.c	Wed May 28 05:10:43 2008 +0000
+++ b/pidgin/gtkimhtmltoolbar.c	Wed May 28 05:12:08 2008 +0000
@@ -1122,7 +1122,10 @@
 	}
 
 	destroy_toolbar_font(NULL, NULL, toolbar);
-	destroy_smiley_dialog(toolbar);
+	if (toolbar->smiley_dialog != NULL) {
+		g_signal_handlers_disconnect_by_func(G_OBJECT(toolbar->smiley_dialog), close_smiley_dialog, toolbar);
+		destroy_smiley_dialog(toolbar);
+	}
 	destroy_toolbar_bgcolor(NULL, NULL, toolbar);
 	destroy_toolbar_fgcolor(NULL, NULL, toolbar);
 	close_link_dialog(toolbar);