im.pidgin.pidgin.2.2.1: abae017149f09c2c6f55a7d80501a55cfa92f8d7

lschiere at pidgin.im lschiere at pidgin.im
Mon Oct 1 13:56:27 EDT 2007


revision:            abae017149f09c2c6f55a7d80501a55cfa92f8d7
date:                2007-09-28T16:24:37
author:              lschiere at pidgin.im
branch:              im.pidgin.pidgin.2.2.1
changelog:
merge of '29a042e507ebe2a83bda971c94bb641979090e7b'
     and '86f30565479a68cb576560b742613b52f671b1d4'

manifest:
format_version "1"

new_manifest [67d3231727ac4ef854533bab9953794c0ea80803]

old_revision [29a042e507ebe2a83bda971c94bb641979090e7b]

patch "libpurple/dnssrv.c"
 from [2fd26c74fed3be685076a0478ffd07f5cf378d8c]
   to [21f0607230b52f7bb12383741c8648a8df182f1c]

patch "libpurple/ft.c"
 from [59e9d4da28a7d81ee7a76c399c4115445cca466f]
   to [32dae7657417fd89f64ba4b5563ffbff9ae19013]

patch "libpurple/protocols/yahoo/yahoo_filexfer.c"
 from [c3030fac3a35f7fd44b05ff40e7f2090fe491c4c]
   to [148c1cac5309d294bc3bb5482687a5fb0cdb1167]

patch "libpurple/upnp.c"
 from [9f7037509c784f450f1fb4ad33176d040c1579dc]
   to [78c0017916277fdb5bc0000cca06c35fb3a031ff]

patch "libpurple/util.c"
 from [504ff584b386911ab4c77743e8e17df9e684caf6]
   to [333952029f746cf825390ccadfc3489a3bbf5bad]

patch "pidgin/gtkimhtml.c"
 from [77589de31ac3088af69562e1ce335f93d8e3d701]
   to [5da45f5e789c81e8967f951df1dcca1016a57791]

old_revision [86f30565479a68cb576560b742613b52f671b1d4]

patch "libpurple/cmds.h"
 from [953c84ca8c44c8e5824209a605d5d889a96b1e0d]
   to [796e9865e88f475e0a36c93142e9170c3dc3cf26]

patch "pidgin/plugins/gtkbuddynote.c"
 from [ceea38e2b71e6cdb0ff0ddbb2da042327ad0f68b]
   to [1fd6753cdc854757b15b841f0c9724c694c5fe73]
-------------- next part --------------
#
#
# patch "libpurple/dnssrv.c"
#  from [2fd26c74fed3be685076a0478ffd07f5cf378d8c]
#    to [21f0607230b52f7bb12383741c8648a8df182f1c]
# 
# patch "libpurple/ft.c"
#  from [59e9d4da28a7d81ee7a76c399c4115445cca466f]
#    to [32dae7657417fd89f64ba4b5563ffbff9ae19013]
# 
# patch "libpurple/protocols/yahoo/yahoo_filexfer.c"
#  from [c3030fac3a35f7fd44b05ff40e7f2090fe491c4c]
#    to [148c1cac5309d294bc3bb5482687a5fb0cdb1167]
# 
# patch "libpurple/upnp.c"
#  from [9f7037509c784f450f1fb4ad33176d040c1579dc]
#    to [78c0017916277fdb5bc0000cca06c35fb3a031ff]
# 
# patch "libpurple/util.c"
#  from [504ff584b386911ab4c77743e8e17df9e684caf6]
#    to [333952029f746cf825390ccadfc3489a3bbf5bad]
# 
# patch "pidgin/gtkimhtml.c"
#  from [77589de31ac3088af69562e1ce335f93d8e3d701]
#    to [5da45f5e789c81e8967f951df1dcca1016a57791]
#
============================================================
--- libpurple/dnssrv.c	2fd26c74fed3be685076a0478ffd07f5cf378d8c
+++ libpurple/dnssrv.c	21f0607230b52f7bb12383741c8648a8df182f1c
@@ -69,6 +69,7 @@ struct _PurpleSrvQueryData {
 	char *error_message;
 	GSList *results;
 #else
+	int fd_in, fd_out;
 	pid_t pid;
 #endif
 };
@@ -112,8 +113,11 @@ resolve(int in, int out)
 	purple_restore_default_signal_handlers();
 #endif
 
-	if (read(in, query, 256) <= 0)
+	if (read(in, query, 256) <= 0) {
+		close(out);
+		close(in);
 		_exit(0);
+	}
 
 	size = res_query( query, C_IN, T_SRV, (u_char*)&answer, sizeof( answer));
 
@@ -179,6 +183,9 @@ end:
 		ret = g_list_remove(ret, ret->data);
 	}
 
+	close(out);
+	close(in);
+
 	_exit(0);
 }
 
@@ -358,6 +365,8 @@ purple_srv_resolve(const char *protocol,
 	query_data->cb = cb;
 	query_data->extradata = extradata;
 	query_data->pid = pid;
+	query_data->fd_out = out[0];
+	query_data->fd_in = in[1];
 	query_data->handle = purple_input_add(out[0], PURPLE_INPUT_READ, resolved, query_data);
 
 	g_free(query);
@@ -414,6 +423,9 @@ purple_srv_cancel(PurpleSrvQueryData *qu
 	}
 	g_free(query_data->query);
 	g_free(query_data->error_message);
+#else
+	close(query_data->fd_out);
+	close(query_data->fd_in);
 #endif
 	g_free(query_data);
 }
============================================================
--- libpurple/ft.c	59e9d4da28a7d81ee7a76c399c4115445cca466f
+++ libpurple/ft.c	32dae7657417fd89f64ba4b5563ffbff9ae19013
@@ -67,6 +67,7 @@ purple_xfer_new(PurpleAccount *account, 
 	xfer->ui_ops  = purple_xfers_get_ui_ops();
 	xfer->message = NULL;
 	xfer->current_buffer_size = FT_INITIAL_BUFFER_SIZE;
+	xfer->fd = -1;
 
 	ui_ops = purple_xfer_get_ui_ops(xfer);
 
============================================================
--- libpurple/protocols/yahoo/yahoo_filexfer.c	c3030fac3a35f7fd44b05ff40e7f2090fe491c4c
+++ libpurple/protocols/yahoo/yahoo_filexfer.c	148c1cac5309d294bc3bb5482687a5fb0cdb1167
@@ -281,13 +281,9 @@ static void yahoo_xfer_init(PurpleXfer *
 			}
 		}
 	} 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);
============================================================
--- libpurple/upnp.c	9f7037509c784f450f1fb4ad33176d040c1579dc
+++ libpurple/upnp.c	78c0017916277fdb5bc0000cca06c35fb3a031ff
@@ -553,7 +553,7 @@ purple_upnp_discover_udp_read(gpointer d
 	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);
============================================================
--- libpurple/util.c	504ff584b386911ab4c77743e8e17df9e684caf6
+++ libpurple/util.c	333952029f746cf825390ccadfc3489a3bbf5bad
@@ -3870,6 +3870,7 @@ purple_util_fetch_url_request(const char
 	gfud->full = full;
 	gfud->request = g_strdup(request);
 	gfud->include_headers = include_headers;
+	gfud->fd = -1;
 
 	purple_url_parse(url, &gfud->website.address, &gfud->website.port,
 				   &gfud->website.page, &gfud->website.user, &gfud->website.passwd);
============================================================
--- pidgin/gtkimhtml.c	77589de31ac3088af69562e1ce335f93d8e3d701
+++ pidgin/gtkimhtml.c	5da45f5e789c81e8967f951df1dcca1016a57791
@@ -3211,24 +3211,25 @@ animate_image_cb(gpointer data)
 	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));
+	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);
+		/* 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 @@ GtkIMHtmlScalable *gtk_imhtml_animation_
 	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 @@ GtkIMHtmlScalable *gtk_imhtml_animation_
 	im_image->filesel = NULL;
 
 	g_object_ref(anim);
-	g_object_ref(im_image->pixbuf);
 
 	return GTK_IMHTML_SCALABLE(im_image);
 }
@@ -4606,10 +4609,15 @@ void gtk_imhtml_insert_smiley_at_iter(Gt
 				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++;
-------------- next part --------------
#
#
# patch "libpurple/cmds.h"
#  from [953c84ca8c44c8e5824209a605d5d889a96b1e0d]
#    to [796e9865e88f475e0a36c93142e9170c3dc3cf26]
# 
# patch "pidgin/plugins/gtkbuddynote.c"
#  from [ceea38e2b71e6cdb0ff0ddbb2da042327ad0f68b]
#    to [1fd6753cdc854757b15b841f0c9724c694c5fe73]
#
============================================================
--- libpurple/cmds.h	953c84ca8c44c8e5824209a605d5d889a96b1e0d
+++ libpurple/cmds.h	796e9865e88f475e0a36c93142e9170c3dc3cf26
@@ -67,10 +67,20 @@ enum _PurpleCmdPriority {
 	PURPLE_CMD_P_VERY_HIGH =  6000,
 };
 
+/** Flags used to set various properties of commands.  Every command should
+ *  have at least one of #PURPLE_CMD_FLAG_IM and #PURPLE_CMD_FLAG_CHAT set in
+ *  order to be even slighly useful.
+ *
+ *  @see purple_cmd_register
+ */
 enum _PurpleCmdFlag {
+	/** Command is usable in IMs. */
 	PURPLE_CMD_FLAG_IM               = 0x01,
+	/** Command is usable in multi-user chats. */
 	PURPLE_CMD_FLAG_CHAT             = 0x02,
+	/** Command is usable only for a particular prpl. */
 	PURPLE_CMD_FLAG_PRPL_ONLY        = 0x04,
+	/** Incorrect arguments to this command should be accepted anyway. */
 	PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS = 0x08,
 };
 
@@ -92,36 +102,49 @@ extern "C" {
  * The command will only happen if commands are enabled,
  * which is a UI pref. UIs don't have to support commands at all.
  *
- * @param cmd The command. This should be a UTF8 (or ASCII) string, with no spaces
+ * @param cmd The command. This should be a UTF-8 (or ASCII) string, with no spaces
  *            or other white space.
- * @param args This tells Purple how to parse the arguments to the command for you.
- *             If what the user types doesn't match, Purple will keep looking for another
- *             command, unless the flag @c PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in f.
- *             This string contains no whitespace, and uses a single character for each argument.
- *             The recognized characters are:
- *               'w' Matches a single word.
- *               'W' Matches a single word, with formatting.
- *               's' Matches the rest of the arguments after this point, as a single string.
- *               'S' Same as 's' but with formatting.
+ * @param args A string of characters describing to libpurple how to parse this
+ *             command's arguments.  If what the user types doesn't match this
+ *             pattern, libpurple will keep looking for another command, unless
+ *             the flag #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed in @a f.
+ *             This string should contain no whitespace, and use a single
+ *             character for each argument.  The recognized characters are:
+ *             <ul>
+ *               <li><tt>'w'</tt>: Matches a single word.</li>
+ *               <li><tt>'W'</tt>: Matches a single word, with formatting.</li>
+ *               <li><tt>'s'</tt>: Matches the rest of the arguments after this
+ *                                 point, as a single string.</li>
+ *               <li><tt>'S'</tt>: Same as <tt>'s'</tt> but with formatting.</li>
+ *             </ul>
  *             If args is the empty string, then the command accepts no arguments.
- *             The args passed to callback func will be a @c NULL terminated array of null
- *             terminated strings, and will always match the number of arguments asked for,
- *             unless PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed.
- * @param p This is the priority. Higher priority commands will be run first, and usually the
- *          first command will stop any others from being called.
- * @param f These are the flags. You need to at least pass one of PURPLE_CMD_FLAG_IM or
- *          PURPLE_CMD_FLAG_CHAT (can may pass both) in order for the command to ever actually
- *          be called.
- * @param prpl_id This is the prpl's id string. This is only meaningful if the proper flag is set.
+ *             The args passed to the callback @a func will be a @c NULL
+ *             terminated array of @c NULL terminated strings, and will always
+ *             match the number of arguments asked for, unless
+ *             #PURPLE_CMD_FLAG_ALLOW_WRONG_ARGS is passed.
+ * @param p This is the priority. Higher priority commands will be run first,
+ *          and usually the first command will stop any others from being
+ *          called.
+ * @param f Flags specifying various options about this command, combined with
+ *          <tt>|</tt> (bitwise OR). You need to at least pass one of
+ *          #PURPLE_CMD_FLAG_IM or #PURPLE_CMD_FLAG_CHAT (you may pass both) in
+ *          order for the command to ever actually be called.
+ * @param prpl_id If the #PURPLE_CMD_FLAG_PRPL_ONLY flag is set, this is the id
+ *                of the prpl to which the command applies (such as
+ *                <tt>"prpl-msn"</tt>). If the flag is not set, this parameter
+ *                is ignored; pass @c NULL (or a humourous string of your
+ *                choice!).
  * @param func This is the function to call when someone enters this command.
- * @param helpstr This is a whitespace sensitive, UTF-8, HTML string describing how to use the command.
- *                The preferred format of this string shall be the commands name, followed by a space
- *                and any arguments it accepts (if it takes any arguments, otherwise no space), followed
- *                by a colon, two spaces, and a description of the command in sentence form. No slash
- *                before the command name.
- * @param data User defined data to pass to the PurpleCmdFunc
- * @return A PurpleCmdId. This is only used for calling purple_cmd_unregister.
- *         Returns 0 on failure.
+ * @param helpstr a whitespace sensitive, UTF-8, HTML string describing how to
+ *                use the command.  The preferred format of this string is the
+ *                command's name, followed by a space and any arguments it
+ *                accepts (if it takes any arguments, otherwise no space),
+ *                followed by a colon, two spaces, and a description of the
+ *                command in sentence form.  Do not include a slash before the
+ *                command name.
+ * @param data User defined data to pass to the #PurpleCmdFunc @a f.
+ * @return A #PurpleCmdId, which is only used for calling
+ *         #purple_cmd_unregister, or @a 0 on failure.
  */
 PurpleCmdId purple_cmd_register(const gchar *cmd, const gchar *args, PurpleCmdPriority p, PurpleCmdFlag f,
                              const gchar *prpl_id, PurpleCmdFunc func, const gchar *helpstr, void *data);
@@ -133,7 +156,7 @@ PurpleCmdId purple_cmd_register(const gc
  * or something else that might go away. Normally this is called when the plugin
  * unloads itself.
  *
- * @param id The PurpleCmdId to unregister.
+ * @param id The #PurpleCmdId to unregister, as returned by #purple_cmd_register.
  */
 void purple_cmd_unregister(PurpleCmdId id);
 
@@ -153,7 +176,7 @@ void purple_cmd_unregister(PurpleCmdId i
  *               include both the default formatting and any extra manual formatting.
  * @param errormsg If the command failed errormsg is filled in with the appropriate error
  *                 message. It must be freed by the caller with g_free().
- * @return A PurpleCmdStatus indicated if the command succeeded or failed.
+ * @return A #PurpleCmdStatus indicated if the command succeeded or failed.
  */
 PurpleCmdStatus purple_cmd_do_command(PurpleConversation *conv, const gchar *cmdline,
                                   const gchar *markup, gchar **errormsg);
@@ -161,13 +184,15 @@ PurpleCmdStatus purple_cmd_do_command(Pu
 /**
  * List registered commands.
  *
- * Returns a GList (which must be freed by the caller) of all commands
- * that are valid in the context of conv, or all commands, if conv is
- * @c NULL. Don't keep this list around past the main loop, or anything else
- * that might unregister a command, as the char*'s used get freed then.
+ * Returns a <tt>GList</tt> (which must be freed by the caller) of all commands
+ * that are valid in the context of @a conv, or all commands, if @a conv is @c
+ * NULL.  Don't keep this list around past the main loop, or anything else that
+ * might unregister a command, as the <tt>const char *</tt>'s used get freed
+ * then.
  *
  * @param conv The conversation, or @c NULL.
- * @return A GList of const char*, which must be freed with g_list_free().
+ * @return A @c GList of <tt>const char *</tt>, which must be freed with
+ *         <tt>g_list_free()</tt>.
  */
 GList *purple_cmd_list(PurpleConversation *conv);
 
@@ -180,7 +205,7 @@ GList *purple_cmd_list(PurpleConversatio
  * @param conv The conversation, or @c NULL for no context.
  * @param cmd The command. No wildcards accepted, but returns help for all
  *            commands if @c NULL.
- * @return A GList of const char*s, which is the help string
+ * @return A <tt>GList</tt> of <tt>const char *</tt>s, which is the help string
  *         for that command.
  */
 GList *purple_cmd_help(PurpleConversation *conv, const gchar *cmd);
============================================================
--- pidgin/plugins/gtkbuddynote.c	ceea38e2b71e6cdb0ff0ddbb2da042327ad0f68b
+++ pidgin/plugins/gtkbuddynote.c	1fd6753cdc854757b15b841f0c9724c694c5fe73
@@ -31,8 +31,11 @@ append_to_tooltip(PurpleBlistNode *node,
 		const gchar *note = purple_blist_node_get_string(node, "notes");
 
 		if ((note != NULL) && (*note != '\0')) {
+			char *tmp;
+			purple_markup_html_to_xhtml(note, NULL, &tmp);
 			g_string_append_printf(text, _("\n<b>Buddy Note</b>: %s"),
-			                       note);
+			                       tmp);
+			g_free(tmp);
 		}
 	}
 }


More information about the Commits mailing list