changeset 16601:1ba0560cbff9

merge of '9aca2545e2cab356cba6508423c2f12e73d7701e' and 'eaccd214c6801670c1046dea719bb82e84da8f65'
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 28 Apr 2007 21:41:52 +0000
parents b7714da3c904 (current diff) 9f6d974045e0 (diff)
children 56c61eb40850
files libpurple/version.h
diffstat 38 files changed, 208 insertions(+), 90 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Sat Apr 28 21:38:22 2007 +0000
+++ b/configure.ac	Sat Apr 28 21:41:52 2007 +0000
@@ -1,11 +1,46 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([pidgin], [2.0.0beta7devel], [devel@pidgin.im])
+AC_PREREQ([2.50])
+
+# Making releases:
+#   purple_micro_version += 1
+# if any functions have been added:
+#   purple_micro_version = 0
+#   purple_minor_version += 1
+# if backwards compatibility has been broken
+#   purple_minor_version = 0
+#   purple_micro_version = 0
+#   purple_major_version += 1;
+#
+m4_define([purple_major_version], [2])
+m4_define([purple_minor_version], [0])
+m4_define([purple_micro_version], [0])
+m4_define([purple_version_suffix], [devel])
+m4_define([purple_version],
+          [purple_major_version.purple_minor_version.purple_micro_version])
+m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
+
+AC_INIT([pidgin], [purple_display_version], [devel@pidgin.im])
+
 AC_CANONICAL_SYSTEM
 AM_CONFIG_HEADER(config.h)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 #AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
-AC_PREREQ([2.50])
+PURPLE_MAJOR_VERSION=purple_major_version
+PURPLE_MINOR_VERSION=purple_minor_version
+PURPLE_MICRO_VERSION=purple_micro_version
+PURPLE_VERSION=[purple_display_version]
+AC_SUBST(PURPLE_MAJOR_VERSION)
+AC_SUBST(PURPLE_MINOR_VERSION)
+AC_SUBST(PURPLE_MICRO_VERSION)
+AC_SUBST(PURPLE_VERSION)
+
+m4_define([lt_current], [m4_eval(100 * purple_major_version + purple_minor_version)])
+m4_define([lt_age], [purple_minor_version])
+m4_define([lt_revision], [purple_micro_version])
+LT_VERSION_INFO="lt_current:lt_revision:lt_age"
+AC_SUBST(LT_VERSION_INFO)
+
 
 AC_DEFINE(PIDGIN_NAME, "Pidgin", [The user-visible application name])
 
@@ -850,10 +885,12 @@
 			"-Waggregate-return" \
 			"-Wcast-align" \
 			"-Wdeclaration-after-statement" \
+			"-Wendif-labels" \
 			"-Werror-implicit-function-declaration" \
 			"-Wextra -Wno-sign-compare -Wno-unused-parameter" \
 			"-Winit-self" \
 			"-Wmissing-declarations" \
+			"-Wmissing-noreturn" \
 			"-Wmissing-prototypes" \
 			"-Wnested-externs" \
 			"-Wpointer-arith" \
@@ -890,7 +927,7 @@
 			}
 		], [
 			AC_MSG_RESULT(yes)
-			DEBUG_CFLAGS="$DEBUG_CFLAGS -D_FORTIFY_SOURCE=2"
+			DEBUG_CFLAGS="$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2"
 		], [
 			AC_MSG_RESULT(no)
 		])
@@ -2011,6 +2048,7 @@
 		   libpurple/protocols/yahoo/Makefile
 		   libpurple/protocols/zephyr/Makefile
 		   libpurple/tests/Makefile
+		   libpurple/version.h
 		   finch/Makefile
 		   finch/libgnt/Makefile
 		   finch/libgnt/gnt.pc
--- a/libpurple/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -8,6 +8,7 @@
 		purple-url-handler \
 		purple.pc.in \
 		purple-uninstalled.pc.in \
+		version.h.in \
 		Makefile.mingw \
 		win32/global.mak \
 		win32/libc_interface.c \
@@ -75,6 +76,7 @@
 	upnp.c \
 	util.c \
 	value.c \
+	version.c \
 	xmlnode.c \
 	whiteboard.c
 
@@ -219,7 +221,7 @@
 	$(dbus_headers)
 
 libpurple_la_DEPENDENCIES = $(STATIC_LINK_LIBS)
-libpurple_la_LDFLAGS = -export-dynamic
+libpurple_la_LDFLAGS = -export-dynamic -version-info $(LT_VERSION_INFO) -no-undefined
 libpurple_la_LIBADD = \
 	$(DBUS_LIBS) \
 	$(GLIB_LIBS) \
@@ -232,7 +234,7 @@
 AM_CPPFLAGS = \
 	-DBR_PTHREADS=0 \
 	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/purple/\" \
+	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \
 	-DLOCALEDIR=\"$(datadir)/locale\" \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	$(GLIB_CFLAGS) \
--- a/libpurple/account.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/account.c	Sat Apr 28 21:41:52 2007 +0000
@@ -749,6 +749,15 @@
 		{
 			purple_buddy_icons_set_account_icon(ret, (guchar *)contents, len);
 		}
+		else
+		{
+			/* Try to see if the icon got left behind in the old cache. */
+			g_free(filename);
+			filename = g_build_filename(g_get_home_dir(), ".gaim", "icons", data, NULL);
+			if (g_file_get_contents(filename, &contents, &len, NULL)) {
+				purple_buddy_icons_set_account_icon(ret, (guchar*)contents, len);
+			}
+		}
 
 		g_free(filename);
 		g_free(data);
--- a/libpurple/buddyicon.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/buddyicon.c	Sat Apr 28 21:41:52 2007 +0000
@@ -1020,7 +1020,7 @@
 		}
 	}
 
-        while (node != NULL)
+	while (node != NULL)
 	{
 		if (PURPLE_BLIST_NODE_IS_BUDDY(node))
 		{
@@ -1079,7 +1079,7 @@
 			}
 		}
 		node = purple_blist_node_next(node, TRUE);
-        }
+	}
 }
 
 void
--- a/libpurple/core.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/core.c	Sat Apr 28 21:41:52 2007 +0000
@@ -116,6 +116,8 @@
 	purple_dbus_init();
 #endif
 
+	purple_ciphers_init();
+
 	/* Initialize all static protocols. */
 	static_proto_init();
 
@@ -134,7 +136,6 @@
 
 	purple_accounts_init();
 	purple_savedstatuses_init();
-	purple_ciphers_init();
 	purple_notify_init();
 	purple_connections_init();
 	purple_conversations_init();
--- a/libpurple/example/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/example/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -14,7 +14,7 @@
 	-DSTANDALONE \
 	-DBR_PTHREADS=0 \
 	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/libpurple/\" \
+	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \
 	-DLOCALEDIR=\"$(datadir)/locale\" \
 	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-I$(top_srcdir)/libpurple/ \
--- a/libpurple/imgstore.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/imgstore.c	Sat Apr 28 21:41:52 2007 +0000
@@ -160,6 +160,7 @@
 		g_free(img->data);
 		g_free(img->filename);
 		g_free(img);
+		img = NULL;
 	}
 
 	return img;
--- a/libpurple/plugins/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -22,7 +22,7 @@
 	ssl \
 	$(TCL_DIR)
 
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 autoaccept_la_LDFLAGS       = -module -avoid-version
 buddynote_la_LDFLAGS        = -module -avoid-version
--- a/libpurple/plugins/mono/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/mono/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -5,7 +5,7 @@
 
 EXTRA_DIST = $(mono_sources)
 
-monodir = $(libdir)/purple
+monodir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 mono_SCRIPTS = MPlugin.dll GetBuddyBack.dll
 mono_build_sources = $(addprefix $(srcdir)/, $(mono_sources))
 
--- a/libpurple/plugins/mono/api/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/mono/api/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,4 +1,4 @@
-monodir=$(libdir)/purple
+monodir=$(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 mono_sources = \
 	BlistNode.cs \
--- a/libpurple/plugins/mono/loader/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/mono/loader/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,4 +1,4 @@
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 plugin_LTLIBRARIES = mono.la
 
--- a/libpurple/plugins/perl/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,4 +1,4 @@
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 perl_dirs = common
 
--- a/libpurple/plugins/ssl/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/ssl/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 ssl_la_LDFLAGS        = -module -avoid-version
 ssl_gnutls_la_LDFLAGS = -module -avoid-version
--- a/libpurple/plugins/tcl/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/plugins/tcl/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,4 +1,4 @@
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 tcl_la_LDFLAGS = -module -avoid-version
 
--- a/libpurple/protocols/bonjour/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/bonjour/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 BONJOURSOURCES = \
 	bonjour.c \
--- a/libpurple/protocols/gg/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/gg/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -13,7 +13,7 @@
 	lib/pubdir50.c \
 	lib/pubdir.c
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 if USE_INTERNAL_LIBGADU
 INTGGSOURCES = \
--- a/libpurple/protocols/irc/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/irc/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,6 +1,6 @@
 EXTRA_DIST = PROTOCOL Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 IRCSOURCES = irc.c parse.c cmds.c msgs.c irc.h dcc_send.c
 
--- a/libpurple/protocols/jabber/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/jabber/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -3,7 +3,7 @@
 		win32/posix.uname.c \
 		win32/utsname.h
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 JABBERSOURCES = auth.c \
 			  auth.h \
--- a/libpurple/protocols/jabber/Makefile.mingw	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/jabber/Makefile.mingw	Sat Apr 28 21:41:52 2007 +0000
@@ -89,7 +89,7 @@
 
 $(OBJECTS): $(PURPLE_CONFIG_H)
 
-$(TARGET).dll: $(PURPLE_DLL).a $(OBJECTS)
+$(TARGET).dll $(TARGET).dll.a: $(PURPLE_DLL).a $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
 
 $(XMPP_TARGET).dll: $(TARGET).dll.a $(XMPP_OBJECTS)
--- a/libpurple/protocols/msn/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/msn/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 MSNSOURCES = \
 	cmdproc.c \
--- a/libpurple/protocols/msn/slp.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/msn/slp.c	Sat Apr 28 21:41:52 2007 +0000
@@ -955,7 +955,7 @@
 
 	if (obj == NULL)
 	{
-		purple_buddy_icons_set_for_user(account, user->passport, NULL, 0, NULL);
+/*		purple_buddy_icons_set_for_user(account, user->passport, NULL, 0, NULL); */
 		return;
 	}
 
--- a/libpurple/protocols/novell/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/novell/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 NOVELLSOURCES = \
 		nmfield.h \
--- a/libpurple/protocols/oscar/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/oscar/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -3,7 +3,7 @@
 		AUTHORS \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 OSCARSOURCES = \
 	bstream.c           \
--- a/libpurple/protocols/oscar/family_feedbag.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Sat Apr 28 21:41:52 2007 +0000
@@ -112,7 +112,7 @@
  */
 static struct aim_ssi_item *aim_ssi_itemlist_add(struct aim_ssi_item **list, const char *name, guint16 gid, guint16 bid, guint16 type, aim_tlvlist_t *data)
 {
-	int i;
+	gboolean exists;
 	struct aim_ssi_item *cur, *new;
 
 	new = (struct aim_ssi_item *)malloc(sizeof(struct aim_ssi_item));
@@ -131,34 +131,37 @@
 		if ((new->gid == 0xFFFF) && name) {
 			do {
 				new->gid += 0x0001;
-				for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next)
+				exists = FALSE;
+				for (cur = *list; cur != NULL; cur = cur->next)
 					if ((cur->type == AIM_SSI_TYPE_GROUP) && (cur->gid == new->gid)) {
-						i=1;
+						exists = TRUE;
 						break;
 					}
-			} while (i);
+			} while (exists);
 		}
 	} else if (new->gid == 0x0000) {
 		if (new->bid == 0xFFFF) {
 			do {
 				new->bid += 0x0001;
-				for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next)
+				exists = FALSE;
+				for (cur = *list; cur != NULL; cur = cur->next)
 					if (((cur->bid == new->bid) && (cur->gid == new->gid)) || (cur->gid == new->bid)) {
-						i=1;
+						exists = TRUE;
 						break;
 					}
-			} while (i);
+			} while (exists);
 		}
 	} else {
 		if (new->bid == 0xFFFF) {
 			do {
 				new->bid += 0x0001;
-				for (cur=*list, i=0; ((cur) && (!i)); cur=cur->next)
+				exists = FALSE;
+				for (cur = *list; cur != NULL; cur = cur->next)
 					if ((cur->bid == new->bid) && (cur->gid == new->gid)) {
-						i=1;
+						exists = TRUE;
 						break;
 					}
-			} while (i);
+			} while (exists);
 		}
 	}
 
--- a/libpurple/protocols/qq/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/qq/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 QQSOURCES = \
 	buddy_info.c \
--- a/libpurple/protocols/sametime/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/sametime/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -2,7 +2,7 @@
 EXTRA_DIST = Makefile.mingw
 
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 
 noinst_HEADERS = sametime.h
--- a/libpurple/protocols/silc/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/silc/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,6 +1,6 @@
 EXTRA_DIST = README TODO Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 SILCSOURCES = silc.c silcpurple.h buddy.c chat.c ft.c ops.c pk.c util.c wb.c wb.h
 
--- a/libpurple/protocols/simple/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/simple/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 SIMPLESOURCES = \
 	simple.c \
--- a/libpurple/protocols/toc/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/toc/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -2,7 +2,7 @@
 		PROTOCOL \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 TOCSOURCES = toc.c
 
--- a/libpurple/protocols/yahoo/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/yahoo/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,7 +1,7 @@
 EXTRA_DIST = \
 		Makefile.mingw
 
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 YAHOOSOURCES = \
 	util.c \
--- a/libpurple/protocols/zephyr/Makefile.am	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/protocols/zephyr/Makefile.am	Sat Apr 28 21:41:52 2007 +0000
@@ -1,4 +1,4 @@
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 ZEPHYRSOURCES = \
 	ZAsyncLocate.c \
--- a/libpurple/purple.pc.in	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/purple.pc.in	Sat Apr 28 21:41:52 2007 +0000
@@ -11,4 +11,3 @@
 Requires: glib-2.0
 Cflags: -I${includedir}/libpurple
 Libs: -L${libdir} -lpurple
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/version.c	Sat Apr 28 21:41:52 2007 +0000
@@ -0,0 +1,43 @@
+/*
+ * @file version.c Version Functions
+ * @ingroup core
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "internal.h"
+
+#include "version.h"
+
+const guint purple_major_version = PURPLE_MAJOR_VERSION;
+const guint purple_minor_version = PURPLE_MINOR_VERSION;
+const guint purple_micro_version = PURPLE_MICRO_VERSION;
+
+const char *purple_version_check(guint required_major, guint required_minor, guint required_micro)
+{
+	if (required_major > PURPLE_MAJOR_VERSION)
+		return "libpurple version too old (major mismatch)";
+	if (required_major < PURPLE_MAJOR_VERSION)
+		return "libpurple version too new (major mismatch)";
+	if (required_minor > PURPLE_MINOR_VERSION)
+		return "libpurple version too old (minor mismatch)";
+	if ((required_minor == PURPLE_MINOR_VERSION) && (required_micro > PURPLE_MICRO_VERSION))
+		return "libpurple version too old (micro mismatch)";
+	return NULL;
+}
--- a/libpurple/version.h	Sat Apr 28 21:38:22 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/**
- * @file version.h Purple Versioning
- *
- * purple
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here.  Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#ifndef _PURPLE_VERSION_H_
-#define _PURPLE_VERSION_H_
-
-#define PURPLE_MAJOR_VERSION 2
-#define PURPLE_MINOR_VERSION 0
-#define PURPLE_MICRO_VERSION 0
-
-#define PURPLE_VERSION_CHECK(x,y,z) ((x) == PURPLE_MAJOR_VERSION && ((y) < PURPLE_MINOR_VERSION || ((y) == PURPLE_MINOR_VERSION && (z) <= PURPLE_MICRO_VERSION)))
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _PURPLE_VERSION_H_ */
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/version.h.in	Sat Apr 28 21:41:52 2007 +0000
@@ -0,0 +1,61 @@
+/**
+ * @file version.h Purple Versioning
+ *
+ * purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#ifndef _PURPLE_VERSION_H_
+#define _PURPLE_VERSION_H_
+
+#define PURPLE_MAJOR_VERSION (@PURPLE_MAJOR_VERSION@)
+#define PURPLE_MINOR_VERSION (@PURPLE_MINOR_VERSION@)
+#define PURPLE_MICRO_VERSION (@PURPLE_MICRO_VERSION@)
+
+#define PURPLE_VERSION_CHECK(x,y,z) ((x) == PURPLE_MAJOR_VERSION && \
+									 ((y) < PURPLE_MINOR_VERSION || \
+									  ((y) == PURPLE_MINOR_VERSION && (z) <= PURPLE_MICRO_VERSION)))
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+const guint purple_major_version;
+const guint purple_minor_version;
+const guint purple_micro_version;
+
+/**
+ * Checks that the libpurple version is compatible with the requested
+ * version
+ *
+ * @param required_major: the required major version.
+ * @param required_minor: the required minor version.
+ * @param required_micro: the required micro version.
+ *
+ * @return NULL if the versions are compatible, or a string describing
+ *         the version mismatch if not compatible.
+ */
+const char *purple_version_check(guint required_major, guint required_minor, guint required_micro);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PURPLE_VERSION_H_ */
+
--- a/libpurple/win32/global.mak	Sat Apr 28 21:38:22 2007 +0000
+++ b/libpurple/win32/global.mak	Sat Apr 28 21:41:52 2007 +0000
@@ -57,10 +57,13 @@
 GCCWARNINGS := -Waggregate-return -Wcast-align -Wdeclaration-after-statement -Werror-implicit-function-declaration -Wextra -Wno-sign-compare -Wno-unused-parameter -Winit-self -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wundef
 
 # parse the version number from the configure.ac file if it is newer
-#AC_INIT([pidgin], [2.0.0dev], [devel@pidgin.im])
+#m4_define([purple_major_version], [2])
+#m4_define([purple_minor_version], [0])
+#m4_define([purple_micro_version], [0])
+#m4_define([purple_version_suffix], [devel])
 PIDGIN_VERSION := $(shell \
   if [ ! $(PIDGIN_TREE_TOP)/VERSION -nt $(PIDGIN_TREE_TOP)/configure.ac ]; then \
-    awk 'BEGIN {FS="\\] *, *\\["} /^AC_INIT\(.+\)/ {printf("%s",$$2); exit}' \
+    awk 'BEGIN {FS="[\\(\\)\\[\\]]"} /^m4_define..purple_(major|minor)_version/ {printf("%s.",$$5);} /^m4_define..purple_micro_version/ {printf("%s",$$5);} /^m4_define..purple_version_suffix/ {printf("%s",$$5); exit}' \
       $(PIDGIN_TREE_TOP)/configure.ac > $(PIDGIN_TREE_TOP)/VERSION; \
   fi; \
   cat $(PIDGIN_TREE_TOP)/VERSION \
--- a/pidgin.spec.in	Sat Apr 28 21:38:22 2007 +0000
+++ b/pidgin.spec.in	Sat Apr 28 21:41:52 2007 +0000
@@ -350,7 +350,7 @@
 %defattr(-, root, root)
 
 %{_libdir}/libpurple.so.*
-%dir %{_libdir}/purple
+%dir %{_libdir}/purple-2
 %attr(755, root, root) %{perl_vendorarch}/Purple.pm
 %dir %{perl_vendorarch}/auto/Purple
 %attr(755, root, root) %{perl_vendorarch}/auto/Purple/Purple.so
--- a/pidgin/gtkaccount.c	Sat Apr 28 21:38:22 2007 +0000
+++ b/pidgin/gtkaccount.c	Sat Apr 28 21:41:52 2007 +0000
@@ -194,11 +194,11 @@
 }
 
 static void
-set_dialog_icon(AccountPrefsDialog *dialog, gpointer *data, size_t len, gchar *new_icon_path)
+set_dialog_icon(AccountPrefsDialog *dialog, gpointer data, size_t len, gchar *new_icon_path)
 {
 	GdkPixbuf *pixbuf = NULL;
 
-	purple_imgstore_unref(dialog->icon_img);
+	dialog->icon_img = purple_imgstore_unref(dialog->icon_img);
 	if (data != NULL)
 	{
 		if (len > 0)