changeset 20577:23a448e8ff79

merge of '6cb0c90b1044b61c7a2c1a7d78c55ef4c5af2bfb' and 'd2626362a5e64d2cf82ee28b9f6383627e2db635'
author Will Thompson <will.thompson@collabora.co.uk>
date Thu, 20 Sep 2007 16:32:45 +0000
parents 96b0d1b3111b (diff) dc77c5910ed3 (current diff)
children 7c30d5aa5e01
files
diffstat 13 files changed, 142 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Sep 20 16:30:03 2007 +0000
+++ b/ChangeLog	Thu Sep 20 16:32:45 2007 +0000
@@ -9,6 +9,7 @@
 	  it in an ambiguous state.  (It will be disabled.)
 	* Fixed an erroneous size display for MSN file transfers. (galt)
 	* Real usernames are now shown in the system log.
+	* Gmail notifications are better tracked
 
 	Pidgin:
 	* If you alias a buddy to an alias that is already present within
--- a/doc/finch.1.in	Thu Sep 20 16:30:03 2007 +0000
+++ b/doc/finch.1.in	Thu Sep 20 16:32:45 2007 +0000
@@ -457,6 +457,11 @@
 .B status
 for the status window.
 
+.SH FAQ
+FAQ for \fBfinch\fR is located at
+.br
+\fIhttp://developer.pidgin.im/wiki/Using%20Finch\fR
+
 .SH BUGS
 Known bugs are listed at
 .br
--- a/finch/gntblist.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/finch/gntblist.c	Thu Sep 20 16:32:45 2007 +0000
@@ -2225,9 +2225,27 @@
 }
 
 static void
+menu_add_buddy_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_buddy(NULL, NULL, NULL, NULL);
+}
+
+static void
+menu_add_chat_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_chat(NULL, NULL, NULL, NULL);
+}
+
+static void
+menu_add_group_cb(GntMenuItem *item, gpointer null)
+{
+	purple_blist_request_add_group();
+}
+
+static void
 create_menu()
 {
-	GntWidget *menu, *sub;
+	GntWidget *menu, *sub, *subsub;
 	GntMenuItem *item;
 	GntWindow *window;
 
@@ -2248,29 +2266,57 @@
 	gnt_menu_add_item(GNT_MENU(sub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), send_im_select, NULL);
 
-	item = gnt_menuitem_check_new(_("Show empty groups"));
+	item = gnt_menuitem_new(_("Show"));
+	gnt_menu_add_item(GNT_MENU(sub), item);
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_check_new(_("Empty groups"));
 	gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
 				purple_prefs_get_bool(PREF_ROOT "/emptygroups"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/emptygroups");
 	
-	item = gnt_menuitem_check_new(_("Show offline buddies"));
+	item = gnt_menuitem_check_new(_("Offline buddies"));
 	gnt_menuitem_check_set_checked(GNT_MENU_ITEM_CHECK(item),
 				purple_prefs_get_bool(PREF_ROOT "/showoffline"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), toggle_pref_cb, PREF_ROOT "/showoffline");
 
-	item = gnt_menuitem_new(_("Sort by status"));
+	item = gnt_menuitem_new(_("Sort"));
 	gnt_menu_add_item(GNT_MENU(sub), item);
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_new(_("By Status"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "status");
 
-	item = gnt_menuitem_new(_("Sort alphabetically"));
-	gnt_menu_add_item(GNT_MENU(sub), item);
+	item = gnt_menuitem_new(_("Alphabetically"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
 	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "text");
 
-	item = gnt_menuitem_new(_("Sort by log size"));
+	item = gnt_menuitem_new(_("By Log Size"));
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log");
+
+	item = gnt_menuitem_new(_("Add"));
 	gnt_menu_add_item(GNT_MENU(sub), item);
-	gnt_menuitem_set_callback(GNT_MENU_ITEM(item), sort_blist_change_cb, "log");
+
+	subsub = gnt_menu_new(GNT_MENU_POPUP);
+	gnt_menuitem_set_submenu(item, GNT_MENU(subsub));
+
+	item = gnt_menuitem_new("Buddy");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_buddy_cb, NULL);
+
+	item = gnt_menuitem_new("Chat");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_chat_cb, NULL);
+
+	item = gnt_menuitem_new("Group");
+	gnt_menu_add_item(GNT_MENU(subsub), item);
+	gnt_menuitem_set_callback(item, menu_add_group_cb, NULL);
 
 	reconstruct_accounts_menu();
 	gnt_menu_add_item(GNT_MENU(menu), ggblist->accounts);
--- a/libpurple/protocols/jabber/google.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/libpurple/protocols/jabber/google.c	Thu Sep 20 16:32:45 2007 +0000
@@ -39,6 +39,8 @@
 	char *subject;
 	const char *in_str;
 	char *to_name;
+	char *default_tos[1];
+
 	int i, count = 1, returned_count;
 
 	const char **tos, **froms, **urls;
@@ -55,15 +57,25 @@
 	if (in_str && *in_str)
 		count = atoi(in_str);
 
-	if (count == 0)
+	/* If Gmail doesn't tell us who the mail is to, let's use our JID */
+	to = xmlnode_get_attrib(packet, "to");
+	default_tos[0] = jabber_get_bare_jid(to);
+
+	if (count == 0) {
+		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
+		g_free(default_tos[0]);
 		return;
+	}
 
 	message = xmlnode_get_child(child, "mail-thread-info");
+	if (!message) {
+		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
+		g_free(default_tos[0]);
+		return;
+	}
 
 	/* Loop once to see how many messages were returned so we can allocate arrays
 	 * accordingly */
-	if (!message)
-		return;
 	for (returned_count = 0; message; returned_count++, message=xmlnode_get_next_twin(message));
 
 	froms    = g_new0(const char* , returned_count);
@@ -115,9 +127,13 @@
 	if (i>0)
 		purple_notify_emails(js->gc, count, count == i, (const char**) subjects, froms, tos,
 				urls, NULL, NULL);
+	else 
+		purple_notify_emails(js->gc, count, FALSE, NULL, NULL, (const char**) default_tos, NULL, NULL, NULL);
+
 
 	g_free(to_name);
 	g_free(tos);
+	g_free(default_tos[0]);
 	g_free(froms);
 	for (; i > 0; i--)
 		g_free(subjects[i - 1]);
--- a/libpurple/protocols/msn/msn.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/libpurple/protocols/msn/msn.c	Thu Sep 20 16:32:45 2007 +0000
@@ -598,9 +598,11 @@
 
 			g_free(tmp2);
 		} else {
-			tmp = g_markup_escape_text(psm, -1);
-			purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
-			g_free(tmp);
+			if (psm != NULL && *psm) {
+				tmp = g_markup_escape_text(psm, -1);
+				purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
+				g_free(tmp);
+			}
 		}
 
 		if (currentmedia) {
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c	Thu Sep 20 16:32:45 2007 +0000
@@ -281,13 +281,9 @@
 			}
 		}
 	} else {
-		/* TODO: Using xfer->fd like this is probably a bad thing... */
+		xfer->fd = -1;
 		if (purple_proxy_connect(NULL, account, xfer_data->host, xfer_data->port,
-		                              yahoo_receivefile_connected, xfer) == NULL)
-			xfer->fd = -1;
-		else
-			xfer->fd = 0;
-		if (xfer->fd == -1) {
+		                              yahoo_receivefile_connected, xfer) == NULL) {
 			purple_notify_error(gc, NULL, _("File Transfer Failed"),
 			             _("Unable to establish file descriptor."));
 			purple_xfer_cancel_remote(xfer);
--- a/libpurple/server.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/libpurple/server.c	Thu Sep 20 16:32:45 2007 +0000
@@ -543,7 +543,7 @@
 				 PurpleMessageFlags flags, time_t mtime)
 {
 	PurpleAccount *account;
-	PurpleConversation *cnv;
+	PurpleConversation *conv;
 	char *message, *name;
 	char *angel, *buffy;
 	int plugin_return;
@@ -562,22 +562,19 @@
 	 * We should update the conversation window buttons and menu,
 	 * if it exists.
 	 */
-	cnv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, gc->account);
+	conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, gc->account);
 
 	/*
-	 * Plugin stuff. we pass a char ** but we don't want to pass what's
-	 * been given us by the prpls. So we create temp holders and pass
-	 * those instead. It's basically just to avoid segfaults.
+	 * Make copies of the message and the sender in case plugins want
+	 * to free these strings and replace them with a modifed version.
 	 */
-	/* TODO: MAX(message, BUF_LONG) is pretty ugly. */
-	buffy = g_malloc(MAX(strlen(msg) + 1, BUF_LONG));
-	strcpy(buffy, msg);
+	buffy = g_strdup(msg);
 	angel = g_strdup(who);
 
 	plugin_return = GPOINTER_TO_INT(
 		purple_signal_emit_return_1(purple_conversations_get_handle(),
 								  "receiving-im-msg", gc->account,
-								  &angel, &buffy, cnv, &flags));
+								  &angel, &buffy, conv, &flags));
 
 	if (!buffy || !angel || plugin_return) {
 		g_free(buffy);
@@ -589,21 +586,21 @@
 	message = buffy;
 
 	purple_signal_emit(purple_conversations_get_handle(), "received-im-msg", gc->account,
-					 name, message, cnv, flags);
+					 name, message, conv, flags);
 
 	/* search for conversation again in case it was created by received-im-msg handler */
-	if (cnv == NULL)
-		cnv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account);
+	if (conv == NULL)
+		conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account);
 
 	/*
 	 * XXX: Should we be setting this here, or relying on prpls to set it?
 	 */
 	flags |= PURPLE_MESSAGE_RECV;
 
-	if (cnv == NULL)
-		cnv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
+	if (conv == NULL)
+		conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name);
 
-	purple_conv_im_write(PURPLE_CONV_IM(cnv), NULL, message, flags, mtime);
+	purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, message, flags, mtime);
 	g_free(message);
 
 	/*
@@ -670,7 +667,7 @@
 				{
 					serv_send_im(gc, name, away_msg, PURPLE_MESSAGE_AUTO_RESP);
 
-					purple_conv_im_write(PURPLE_CONV_IM(cnv), NULL, away_msg,
+					purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, away_msg,
 									   PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_AUTO_RESP,
 									   mtime);
 				}
@@ -892,15 +889,10 @@
 		return;
 
 	/*
-	 * Plugin stuff. We pass a char ** but we don't want to pass what's
-	 * been given us by the prpls. so we create temp holders and pass those
-	 * instead. It's basically just to avoid segfaults. Of course, if the
-	 * data is binary, plugins don't see it. Bitch all you want; i really
-	 * don't want you to be dealing with it.
+	 * Make copies of the message and the sender in case plugins want
+	 * to free these strings and replace them with a modifed version.
 	 */
-	/* TODO: MAX(message, BUF_LONG) is pretty ugly. */
-	buffy = g_malloc(MAX(strlen(message) + 1, BUF_LONG));
-	strcpy(buffy, message);
+	buffy = g_strdup(message);
 	angel = g_strdup(who);
 
 	plugin_return = GPOINTER_TO_INT(
@@ -913,6 +905,7 @@
 		g_free(angel);
 		return;
 	}
+
 	who = angel;
 	message = buffy;
 
--- a/libpurple/upnp.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/libpurple/upnp.c	Thu Sep 20 16:32:45 2007 +0000
@@ -553,7 +553,7 @@
 	dd->inpa = 0;
 
 	close(dd->fd);
-	dd->fd = 0;
+	dd->fd = -1;
 
 	/* parse the response, and see if it was a success */
 	purple_upnp_parse_discover_response(buf, len, dd);
--- a/pidgin/gtkaccount.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/pidgin/gtkaccount.c	Thu Sep 20 16:32:45 2007 +0000
@@ -250,9 +250,6 @@
 
 	new_plugin = purple_find_prpl(id);
 
-	if (new_plugin == dialog->plugin)
-		return;
-
 	dialog->plugin = new_plugin;
 
 	if (dialog->plugin != NULL)
--- a/pidgin/gtkdialogs.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/pidgin/gtkdialogs.c	Thu Sep 20 16:32:45 2007 +0000
@@ -286,6 +286,7 @@
 	about = NULL;
 }
 
+#if 0
 /* This function puts the version number onto the pixmap we use in the 'about' 
  * screen in Pidgin. */
 static void
@@ -323,6 +324,7 @@
 											 width, height);
 	g_object_unref(G_OBJECT(pixmap));
 }
+#endif
 
 void pidgin_dialogs_about()
 {
@@ -386,6 +388,9 @@
 	str = g_string_sized_new(4096);
 
 	g_string_append_printf(str,
+		"<CENTER><FONT SIZE=\"4\"><B>%s %s</B></FONT></CENTER><BR><BR>", PIDGIN_NAME, VERSION);
+
+	g_string_append_printf(str,
 		_("%s is a graphical modular messaging client based on "
 		  "libpurple which is capable of connecting to "
 		  "AIM, MSN, Yahoo!, XMPP, ICQ, IRC, SILC, SIP/SIMPLE, "
--- a/pidgin/gtkimhtml.c	Thu Sep 20 16:30:03 2007 +0000
+++ b/pidgin/gtkimhtml.c	Thu Sep 20 16:32:45 2007 +0000
@@ -3211,24 +3211,25 @@
 	im_image = data;
 
 	/* Update the pointer to this GdkPixbuf frame of the animation */
-	g_object_unref(G_OBJECT(im_image->pixbuf));
-	gdk_pixbuf_animation_iter_advance(GTK_IMHTML_ANIMATION(im_image)->iter, NULL);
-	im_image->pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
-	g_object_ref(G_OBJECT(im_image->pixbuf));
-
-	/* Update the displayed GtkImage */
-	width = gdk_pixbuf_get_width(gtk_image_get_pixbuf(im_image->image));
-	height = gdk_pixbuf_get_height(gtk_image_get_pixbuf(im_image->image));
-	if (width > 0 && height > 0)
-	{
-		/* Need to scale the new frame to the same size as the old frame */
-		GdkPixbuf *tmp;
-		tmp = gdk_pixbuf_scale_simple(im_image->pixbuf, width, height, GDK_INTERP_BILINEAR);
-		gtk_image_set_from_pixbuf(im_image->image, tmp);
-		g_object_unref(G_OBJECT(tmp));
-	} else {
-		/* Display at full-size */
-		gtk_image_set_from_pixbuf(im_image->image, im_image->pixbuf);
+	if (gdk_pixbuf_animation_iter_advance(GTK_IMHTML_ANIMATION(im_image)->iter, NULL)) {
+		GdkPixbuf *pb = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+		g_object_unref(G_OBJECT(im_image->pixbuf));
+		im_image->pixbuf = gdk_pixbuf_copy(pb);
+
+		/* Update the displayed GtkImage */
+		width = gdk_pixbuf_get_width(gtk_image_get_pixbuf(im_image->image));
+		height = gdk_pixbuf_get_height(gtk_image_get_pixbuf(im_image->image));
+		if (width > 0 && height > 0)
+		{
+			/* Need to scale the new frame to the same size as the old frame */
+			GdkPixbuf *tmp;
+			tmp = gdk_pixbuf_scale_simple(im_image->pixbuf, width, height, GDK_INTERP_BILINEAR);
+			gtk_image_set_from_pixbuf(im_image->image, tmp);
+			g_object_unref(G_OBJECT(tmp));
+		} else {
+			/* Display at full-size */
+			gtk_image_set_from_pixbuf(im_image->image, im_image->pixbuf);
+		}
 	}
 
 	delay = MIN(gdk_pixbuf_animation_iter_get_delay_time(GTK_IMHTML_ANIMATION(im_image)->iter), 100);
@@ -3249,11 +3250,14 @@
 	if (gdk_pixbuf_animation_is_static_image(anim)) {
 		GTK_IMHTML_ANIMATION(im_image)->iter = NULL;
 		im_image->pixbuf = gdk_pixbuf_animation_get_static_image(anim);
+		g_object_ref(im_image->pixbuf);
 		GTK_IMHTML_ANIMATION(im_image)->timer = 0;
 	} else {
 		int delay;
+		GdkPixbuf *pb;
 		GTK_IMHTML_ANIMATION(im_image)->iter = gdk_pixbuf_animation_get_iter(anim, NULL);
-		im_image->pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+		pb = gdk_pixbuf_animation_iter_get_pixbuf(GTK_IMHTML_ANIMATION(im_image)->iter);
+		im_image->pixbuf = gdk_pixbuf_copy(pb);
 		delay = MIN(gdk_pixbuf_animation_iter_get_delay_time(GTK_IMHTML_ANIMATION(im_image)->iter), 100);
 		GTK_IMHTML_ANIMATION(im_image)->timer = g_timeout_add(delay, animate_image_cb, im_image);
 	}
@@ -3266,7 +3270,6 @@
 	im_image->filesel = NULL;
 
 	g_object_ref(anim);
-	g_object_ref(im_image->pixbuf);
 
 	return GTK_IMHTML_SCALABLE(im_image);
 }
@@ -4606,10 +4609,15 @@
 				if (imhtml->num_animations == 20) {
 					GtkImage *image = GTK_IMAGE(g_queue_pop_head(imhtml->animations));
 					GdkPixbufAnimation *anim = gtk_image_get_animation(image);
+					g_signal_handlers_disconnect_matched(G_OBJECT(image), G_SIGNAL_MATCH_FUNC,
+							 0, 0, NULL, G_CALLBACK(animated_smiley_destroy_cb), NULL);
 					if (anim) {
 						GdkPixbuf *pb = gdk_pixbuf_animation_get_static_image(anim);
-						gtk_image_set_from_pixbuf(image, pb);
-						g_object_unref(G_OBJECT(pb));
+						if (pb != NULL) {
+							GdkPixbuf *copy = gdk_pixbuf_copy(pb);
+							gtk_image_set_from_pixbuf(image, copy);
+							g_object_unref(G_OBJECT(copy));
+						}
 					}
 				} else {
  					imhtml->num_animations++;
--- a/pidgin/pixmaps/emotes/default/24/default.theme.in	Thu Sep 20 16:30:03 2007 +0000
+++ b/pidgin/pixmaps/emotes/default/24/default.theme.in	Thu Sep 20 16:32:45 2007 +0000
@@ -249,7 +249,7 @@
 sick.png            :-!
 kissed.png          *KISSED*
 stop.png            *STOP*
-kiss.png            :-*
+kiss.png            :-{} :-*
 kissing.png         *KISSING* 
 embarrassed.png     :-[
 devil.png           ]:->
Binary file pidgin/pixmaps/protocols/22/myspace.png has changed