changeset 17610:4b78c4aec823

merge of 'ebff6c3b8f2304c88a5769e8c4c25a763f3a5c1f' and 'fc76f1a1ca445e0b4286580eccd99b8239fd8905'
author Sean Egan <seanegan@gmail.com>
date Wed, 13 Jun 2007 00:45:53 +0000
parents 6c0a747594ce (current diff) 8e316800d00a (diff)
children 662710d7ecf0
files
diffstat 8 files changed, 52 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Jun 13 00:44:27 2007 +0000
+++ b/configure.ac	Wed Jun 13 00:45:53 2007 +0000
@@ -2105,9 +2105,7 @@
 		   pidgin/pixmaps/tray/22/Makefile
 		   pidgin/pixmaps/tray/22/scalable/Makefile
 		   pidgin/pixmaps/tray/32/Makefile
-		   pidgin/pixmaps/tray/32/scalable/Makefile
 		   pidgin/pixmaps/tray/48/Makefile
-		   pidgin/pixmaps/tray/48/scalable/Makefile
 		   pidgin/plugins/Makefile
 		   pidgin/plugins/cap/Makefile
 		   pidgin/plugins/gestures/Makefile
--- a/libpurple/plugins/buddynote.c	Wed Jun 13 00:44:27 2007 +0000
+++ b/libpurple/plugins/buddynote.c	Wed Jun 13 00:45:53 2007 +0000
@@ -58,6 +58,9 @@
 {
 	PurpleMenuAction *bna = NULL;
 
+	if (purple_blist_node_get_flags(node) & PURPLE_BLIST_NODE_FLAG_NO_SAVE)
+		return;
+
 	*m = g_list_append(*m, bna);
 	bna = purple_menu_action_new(_("Edit Notes..."), PURPLE_CALLBACK(buddynote_edit_cb), NULL, NULL);
 	*m = g_list_append(*m, bna);
--- a/pidgin/gtkblist.c	Wed Jun 13 00:44:27 2007 +0000
+++ b/pidgin/gtkblist.c	Wed Jun 13 00:45:53 2007 +0000
@@ -3740,8 +3740,11 @@
 
 gboolean pidgin_blist_node_is_contact_expanded(PurpleBlistNode *node)
 {
-	if PURPLE_BLIST_NODE_IS_BUDDY(node)
+	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		node = node->parent;
+		if (node == NULL)
+			return FALSE;
+	}
 
 	g_return_val_if_fail(PURPLE_BLIST_NODE_IS_CONTACT(node), FALSE);
 
--- a/pidgin/gtkconv.c	Wed Jun 13 00:44:27 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Jun 13 00:45:53 2007 +0000
@@ -49,6 +49,7 @@
 #include "prpl.h"
 #include "request.h"
 #include "util.h"
+#include "version.h"
 
 #include "gtkdnd-hints.h"
 #include "gtkblist.h"
@@ -2091,6 +2092,9 @@
 	return TRUE;
 }
 
+static void
+regenerate_options_items(PidginWindow *win);
+
 void
 pidgin_conv_switch_active_conversation(PurpleConversation *conv)
 {
@@ -2191,6 +2195,8 @@
 
 	gray_stuff_out(gtkconv);
 	update_typing_icon(gtkconv);
+	g_object_set_data(G_OBJECT(entry), "transient_buddy", NULL);
+	regenerate_options_items(gtkconv->win);
 
 	gtk_window_set_title(GTK_WINDOW(gtkconv->win->window),
 	                     gtk_label_get_text(GTK_LABEL(gtkconv->tab_label)));
@@ -2953,11 +2959,45 @@
 
 	menu = gtk_item_factory_get_widget(win->menu.item_factory, N_("/Conversation/More"));
 
-	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
+	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
 		chat = purple_blist_find_chat(conv->account, conv->name);
-	else
+
+		if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
+			chat = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_chat");
+		}
+
+		if ((chat == NULL) && (gtkconv->imhtml != NULL)) {
+			GHashTable *components;
+			components = g_hash_table_new_full(g_str_hash, g_str_equal,
+					g_free, g_free);
+			g_hash_table_replace(components, g_strdup("channel"),
+					g_strdup(conv->name));
+			chat = purple_chat_new(conv->account, NULL, components);
+			purple_blist_node_set_flags((PurpleBlistNode *)chat,
+					PURPLE_BLIST_NODE_FLAG_NO_SAVE);
+			g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_chat",
+					chat, (GDestroyNotify)purple_blist_remove_chat);
+		}
+	} else {
 		buddy = purple_find_buddy(conv->account, conv->name);
 
+		/* gotta remain bug-compatible :( libpurple < 2.0.2 didn't handle
+		 * removing "isolated" buddy nodes well */
+		if (purple_version_check(2, 0, 2) == NULL) {
+			if ((buddy == NULL) && (gtkconv->imhtml != NULL)) {
+				buddy = g_object_get_data(G_OBJECT(gtkconv->imhtml), "transient_buddy");
+			}
+
+			if ((buddy == NULL) && (gtkconv->imhtml != NULL)) {
+				buddy = purple_buddy_new(conv->account, conv->name, NULL);
+				purple_blist_node_set_flags((PurpleBlistNode *)buddy,
+						PURPLE_BLIST_NODE_FLAG_NO_SAVE);
+				g_object_set_data_full(G_OBJECT(gtkconv->imhtml), "transient_buddy",
+						buddy, (GDestroyNotify)purple_blist_remove_buddy);
+			}
+		}
+	}
+
 	if (chat)
 		node = (PurpleBlistNode *)chat;
 	else if (buddy)
--- a/pidgin/gtkutils.c	Wed Jun 13 00:44:27 2007 +0000
+++ b/pidgin/gtkutils.c	Wed Jun 13 00:45:53 2007 +0000
@@ -2038,6 +2038,7 @@
 static void
 screenname_autocomplete_destroyed_cb(GtkWidget *widget, gpointer data)
 {
+	g_free(data);
 	purple_signals_disconnect_by_handle(widget);
 }
 
@@ -2119,7 +2120,7 @@
 	purple_signal_connect(purple_accounts_get_handle(), "account-removed", entry,
 						PURPLE_CALLBACK(repopulate_autocomplete), cb_data);
 
-	g_signal_connect(G_OBJECT(entry), "destroy", G_CALLBACK(screenname_autocomplete_destroyed_cb), NULL);
+	g_signal_connect(G_OBJECT(entry), "destroy", G_CALLBACK(screenname_autocomplete_destroyed_cb), data);
 }
 
 void pidgin_set_cursor(GtkWidget *widget, GdkCursorType cursor_type)
--- a/pidgin/pixmaps/tray/32/Makefile.am	Wed Jun 13 00:44:27 2007 +0000
+++ b/pidgin/pixmaps/tray/32/Makefile.am	Wed Jun 13 00:45:53 2007 +0000
@@ -1,5 +1,3 @@
-SUBDIRS = scalable
-
 TRAY_ICONS =	tray-away.png \
 		tray-busy.png \
 		tray-connecting.png \
--- a/pidgin/pixmaps/tray/48/Makefile.am	Wed Jun 13 00:44:27 2007 +0000
+++ b/pidgin/pixmaps/tray/48/Makefile.am	Wed Jun 13 00:45:53 2007 +0000
@@ -1,5 +1,3 @@
-SUBDIRS = scalable
-
 TRAY_ICONS =	tray-away.png \
 		tray-busy.png \
 		tray-connecting.png \
--- a/po/stats.pl	Wed Jun 13 00:44:27 2007 +0000
+++ b/po/stats.pl	Wed Jun 13 00:45:53 2007 +0000
@@ -33,6 +33,7 @@
 $lang{pt_BR} = "Portuguese (Brazilian)";
 $lang{'sr@Latn'} = "Serbian (Latin)";
 $lang{zh_CN} = "Chinese (Simplified)";
+$lang{zh_HK} = "Chinese (Hong Kong)";
 $lang{zh_TW} = "Chinese (Traditional)";
 
 opendir(DIR, ".") || die "can't open directory: $!";