changeset 27725:d1ed74d50a9c

propagate from branch 'im.pidgin.pidgin' (head 3910f85cac876af6007e47f35c8e05b3bab62cbd) to branch 'im.pidgin.pidgin.yaz' (head fcbd14f401c536e8be3ae11c4ce4f333b1004d27)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Wed, 19 Sep 2007 10:08:23 +0000
parents 51285cbe582d (diff) 26f55eb6ab59 (current diff)
children 13ab08434a50
files libpurple/protocols/msn/msn.c pidgin/gtkconv.c
diffstat 6 files changed, 37 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/finch/finch.c	Wed Sep 19 08:27:28 2007 +0000
+++ b/finch/finch.c	Wed Sep 19 10:08:23 2007 +0000
@@ -297,6 +297,7 @@
 	if (opt_version) {
 		/* Translators may want to transliterate the name.
 		 It is not to be translated. */
+		gnt_quit();
 		printf("%s %s\n", _("Finch"), VERSION);
 		return 0;
 	}
@@ -419,13 +420,13 @@
 
 	gnt_init();
 
-	gnt_start(&argc, &argv);
-
-	gnt_main();
+	if (gnt_start(&argc, &argv)) {
+		gnt_main();
 
 #ifdef STANDALONE
-	purple_core_quit();
+		purple_core_quit();
 #endif
+	}
 
 	return 0;
 }
--- a/libpurple/blist.c	Wed Sep 19 08:27:28 2007 +0000
+++ b/libpurple/blist.c	Wed Sep 19 10:08:23 2007 +0000
@@ -843,6 +843,13 @@
 		ops->update(purplebuddylist, (PurpleBlistNode *)buddy);
 }
 
+static gboolean
+purple_strings_are_different(const char *one, const char *two)
+{
+	return !((one && two && g_utf8_collate(one, two) == 0) ||
+			((one == NULL || *one == '\0') && (two == NULL || *two == '\0')));
+}
+
 void purple_blist_alias_contact(PurpleContact *contact, const char *alias)
 {
 	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
@@ -852,6 +859,9 @@
 
 	g_return_if_fail(contact != NULL);
 
+	if (!purple_strings_are_different(contact->alias, alias))
+		return;
+
 	old_alias = contact->alias;
 
 	if ((alias != NULL) && (*alias != '\0'))
@@ -886,6 +896,9 @@
 
 	g_return_if_fail(chat != NULL);
 
+	if (!purple_strings_are_different(chat->alias, alias))
+		return;
+
 	old_alias = chat->alias;
 
 	if ((alias != NULL) && (*alias != '\0'))
@@ -911,6 +924,9 @@
 
 	g_return_if_fail(buddy != NULL);
 
+	if (!purple_strings_are_different(buddy->alias, alias))
+		return;
+
 	old_alias = buddy->alias;
 
 	if ((alias != NULL) && (*alias != '\0'))
@@ -941,6 +957,9 @@
 
 	g_return_if_fail(buddy != NULL);
 
+	if (!purple_strings_are_different(buddy->server_alias, alias))
+		return;
+
 	old_alias = buddy->server_alias;
 
 	if ((alias != NULL) && (*alias != '\0') && g_utf8_validate(alias, -1, NULL))
@@ -1423,26 +1442,7 @@
 
 void purple_contact_set_alias(PurpleContact *contact, const char *alias)
 {
-	PurpleBlistUiOps *ops = purple_blist_get_ui_ops();
-	char *old_alias;
-
-	g_return_if_fail(contact != NULL);
-
-	old_alias = contact->alias;
-
-	if ((alias != NULL) && (*alias != '\0'))
-		contact->alias = g_strdup(alias);
-	else
-		contact->alias = NULL;
-
-	purple_blist_schedule_save();
-
-	if (ops && ops->update)
-		ops->update(purplebuddylist, (PurpleBlistNode*)contact);
-
-	purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased",
-					 contact, old_alias);
-	g_free(old_alias);
+	purple_blist_alias_contact(contact,alias);
 }
 
 const char *purple_contact_get_alias(PurpleContact* contact)
--- a/libpurple/blist.h	Wed Sep 19 08:27:28 2007 +0000
+++ b/libpurple/blist.h	Wed Sep 19 10:08:23 2007 +0000
@@ -65,11 +65,11 @@
 
 typedef enum
 {
-	PURPLE_BLIST_NODE_FLAG_NO_SAVE = 1 /**< node should not be saved with the buddy list */
+	PURPLE_BLIST_NODE_FLAG_NO_SAVE      = 1 << 0, /**< node should not be saved with the buddy list */
 
 } PurpleBlistNodeFlags;
 
-#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) ((b)->flags & (f))
+#define PURPLE_BLIST_NODE_HAS_FLAG(b, f) (((PurpleBlistNode*)(b))->flags & (f))
 #define PURPLE_BLIST_NODE_SHOULD_SAVE(b) (! PURPLE_BLIST_NODE_HAS_FLAG(b, PURPLE_BLIST_NODE_FLAG_NO_SAVE))
 
 #define PURPLE_BLIST_NODE_NAME(n) ((n)->type == PURPLE_BLIST_CHAT_NODE  ? purple_chat_get_name((PurpleChat*)n) :        \
@@ -488,6 +488,8 @@
  *
  * @param contact  The contact
  * @param alias    The alias to set, or NULL to unset
+ *
+ * @deprecated Use purple_blist_alias_contact() instead.
  */
 void purple_contact_set_alias(PurpleContact *contact, const char *alias);
 
--- a/libpurple/protocols/msn/msn.c	Wed Sep 19 08:27:28 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Wed Sep 19 10:08:23 2007 +0000
@@ -1592,8 +1592,7 @@
 msn_info_strip_search_link(const char *field, size_t len)
 {
 	const char *c;
-	if ((c = strstr(field, " (http://spaces.live.com/default.aspx?page=searchresults")) == NULL &&
-		(c = strstr(field, " (http://spaces.msn.com/default.aspx?page=searchresults")) == NULL)
+	if ((c = strstr(field, " (http://")) == NULL))
 		return g_strndup(field, len);
 	return g_strndup(field, c - field);
 }
--- a/pidgin/gtkblist.c	Wed Sep 19 08:27:28 2007 +0000
+++ b/pidgin/gtkblist.c	Wed Sep 19 10:08:23 2007 +0000
@@ -1334,14 +1334,14 @@
 		if (!prpl_info->can_receive_file ||
 			prpl_info->can_receive_file(buddy->account->gc, buddy->name))
 		{
-			pidgin_new_item_from_stock(menu, _("_Send File"),
+			pidgin_new_item_from_stock(menu, _("_Send File..."),
 									 PIDGIN_STOCK_TOOLBAR_SEND_FILE,
 									 G_CALLBACK(gtk_blist_menu_send_file_cb),
 									 buddy, 0, 0, NULL);
 		}
 	}
 
-	pidgin_new_item_from_stock(menu, _("Add Buddy _Pounce"), NULL,
+	pidgin_new_item_from_stock(menu, _("Add Buddy _Pounce..."), NULL,
 			G_CALLBACK(gtk_blist_menu_bp_cb), buddy, 0, 0, NULL);
 
 	if (node->parent && node->parent->child->next && 
@@ -1431,10 +1431,10 @@
 	GtkWidget *item;
 
 	menu = gtk_menu_new();
-	item = pidgin_new_item_from_stock(menu, _("Add a _Buddy"), GTK_STOCK_ADD,
+	item = pidgin_new_item_from_stock(menu, _("Add _Buddy..."), GTK_STOCK_ADD,
 				 G_CALLBACK(pidgin_blist_add_buddy_cb), node, 0, 0, NULL);
 	gtk_widget_set_sensitive(item, purple_connections_get_all() != NULL);
-	item = pidgin_new_item_from_stock(menu, _("Add a C_hat"), GTK_STOCK_ADD,
+	item = pidgin_new_item_from_stock(menu, _("Add C_hat..."), GTK_STOCK_ADD,
 				 G_CALLBACK(pidgin_blist_add_chat_cb), node, 0, 0, NULL);
 	gtk_widget_set_sensitive(item, pidgin_blist_joinchat_is_showable());
 	pidgin_new_item_from_stock(menu, _("_Delete Group"), GTK_STOCK_REMOVE,
@@ -5816,7 +5816,7 @@
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 
 	/* Set up stuff for the account box */
-	label = gtk_label_new_with_mnemonic(_("_Account:"));
+	label = gtk_label_new_with_mnemonic(_("A_ccount:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
 
--- a/pidgin/gtkconv.c	Wed Sep 19 08:27:28 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Sep 19 10:08:23 2007 +0000
@@ -3651,9 +3651,8 @@
 		gtk_widget_destroy(win->menu.send_to);
 
 	/* Build the Send To menu */
-
 #if ENABLE_SHORTCUT
-	win->menu.send_to = gtk_menu_item_new_with_mnemonic(_("_Send To"));
+	win->menu.send_to = gtk_menu_item_new_with_mnemonic(_("S_end To"));
 #else
 	win->menu.send_to = gtk_menu_item_new_with_mnemonic(_("Send To")); //to free Alt-s. intentional. --yaz
 #endif
@@ -8147,7 +8146,7 @@
 		sub = gtk_menu_item_get_submenu(GTK_MENU_ITEM(gtkconv->win->menu.send_to));
 
 		if (sub && GTK_WIDGET_IS_SENSITIVE(gtkconv->win->menu.send_to)) {
-			GtkWidget *item = gtk_menu_item_new_with_mnemonic(_("_Send To"));
+			GtkWidget *item = gtk_menu_item_new_with_mnemonic(_("S_end To"));
 			if (populated)
 				pidgin_separator(menu);
 			gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);