changeset 16622:8d8168fada21

merge of '833c9b8a7ffaa6f0c0f194a0c73d46d0ec0a64e2' and 'fdf356d17ca91075a288bb9224e619fc80ae7b36'
author Richard Laager <rlaager@wiktel.com>
date Sun, 29 Apr 2007 01:08:25 +0000
parents dbd0a01a9a81 (diff) 317f3ae0ef93 (current diff)
children dd6e1dde4cb5 36981d83b20c
files libpurple/buddyicon.c libpurple/version.h pidgin/plugins/perl/common/GtkUI.pm pidgin/plugins/perl/common/GtkUI.xs
diffstat 87 files changed, 929 insertions(+), 421 deletions(-) [+]
line wrap: on
line diff
--- a/.mtn-ignore	Sun Apr 29 01:08:11 2007 +0000
+++ b/.mtn-ignore	Sun Apr 29 01:08:25 2007 +0000
@@ -50,6 +50,7 @@
 libpurple/purple-client-bindings.h
 libpurple/purple-client-example
 libpurple/tests/check_libpurple
+libpurple/version.h
 libpurple/win32/libpurplerc.rc$
 libtool
 local.mak
--- a/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/Makefile.am	Sun Apr 29 01:08:25 2007 +0000
@@ -17,7 +17,8 @@
 		pidgin.apspec.in \
 		pidgin.spec.in \
 		pidgin.desktop.in \
-		po/Makefile.mingw
+		po/Makefile.mingw \
+		valgrind-suppressions
 
 noinst_HEADERS = config.h
 
--- a/configure.ac	Sun Apr 29 01:08:11 2007 +0000
+++ b/configure.ac	Sun Apr 29 01:08:25 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/finch/finch.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/finch/finch.c	Sun Apr 29 01:08:25 2007 +0000
@@ -328,8 +328,7 @@
 	/* TODO: Move prefs loading into purple_prefs_init() */
 	purple_prefs_load();
 	purple_prefs_update_old();
-	purple_prefs_rename("/gaim/gnt", "/finch");
-	purple_prefs_rename("/purple/gnt", "/finch");
+	finch_prefs_update_old();
 
 	/* load plugins we had when we quit */
 	purple_plugins_load_saved("/finch/plugins/loaded");
--- a/finch/gntblist.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/finch/gntblist.c	Sun Apr 29 01:08:25 2007 +0000
@@ -110,6 +110,7 @@
 static const char * get_display_name(PurpleBlistNode *node);
 static void savedstatus_changed(PurpleSavedStatus *now, PurpleSavedStatus *old);
 static void blist_show(PurpleBuddyList *list);
+static void update_node_display(PurpleBlistNode *buddy, FinchBlist *ggblist);
 static void update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist);
 static void account_signed_on_cb(void);
 
@@ -187,13 +188,16 @@
 		if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) ||
 				contact->currentsize < 1)
 			node_remove(list, (PurpleBlistNode*)contact);
-	} else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	} else if (!PURPLE_BLIST_NODE_IS_GROUP(node)) {
 		PurpleGroup *group = (PurpleGroup*)node->parent;
 		if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) ||
 				group->currentsize < 1)
 			node_remove(list, node->parent);
 		for (node = node->child; node; node = node->next)
 			node->ui_data = NULL;
+	} else {
+		for (node = node->child; node; node = node->next)
+			node_remove(list, node);
 	}
 
 	draw_tooltip(ggblist);
@@ -232,13 +236,20 @@
 		if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_contact_online(contact)) ||
 				contact->currentsize < 1)
 			node_remove(purple_get_blist(), node);
-		else
-			add_node(node, list->ui_data);
+		else {
+			if (node->ui_data == NULL) {
+				/* The core seems to expect the UI to add the buddies. */
+				for (node = node->child; node; node = node->next)
+					add_node(node, list->ui_data);
+			}
+		}
 	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
 		PurpleGroup *group = (PurpleGroup*)node;
 		if ((!purple_prefs_get_bool(PREF_ROOT "/showoffline") && !is_group_online(group)) ||
 				group->currentsize < 1)
 			node_remove(list, node);
+		else
+			add_node(node, list->ui_data);
 	}
 }
 
@@ -1044,8 +1055,6 @@
 	GList *iter;
 	if (node == NULL)
 		return;
-	if (PURPLE_BLIST_NODE_IS_CHAT(node) || PURPLE_BLIST_NODE_IS_GROUP(node))
-		return;
 	if (ggblist->tagged && (iter = g_list_find(ggblist->tagged, node)) != NULL) {
 		ggblist->tagged = g_list_delete_link(ggblist->tagged, iter);
 	} else {
@@ -1053,7 +1062,10 @@
 	}
 	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
 		node = (PurpleBlistNode*)purple_contact_get_priority_buddy((PurpleContact*)node);
-	update_buddy_display((PurpleBuddy*)node, ggblist);
+	if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+		update_buddy_display((PurpleBuddy*)node, ggblist);
+	else
+		update_node_display(node, ggblist);
 }
 
 static void
@@ -1065,37 +1077,61 @@
 	if (target == NULL)
 		return;
 
-	/* This target resolution probably needs more clarification; for
-	 * example, if I tag a buddy in a contact, then place on
-	 * another buddy in the same contact, I probably intend to
-	 * place the tagged buddy immediately after (before?) the
-	 * target buddy -- this will simply move the tagged buddy
-	 * within the same contact without reference to position. */
 	if (PURPLE_BLIST_NODE_IS_GROUP(target))
 		tg = (PurpleGroup*)target;
-	else if (PURPLE_BLIST_NODE_IS_CONTACT(target))
-		tc = (PurpleContact*)target;
-	else /* Buddy or Chat */
+	else if (PURPLE_BLIST_NODE_IS_BUDDY(target)) {
 		tc = (PurpleContact*)target->parent;
+		tg = (PurpleGroup*)target->parent->parent;
+	} else {
+		if (PURPLE_BLIST_NODE_IS_CONTACT(target))
+			tc = (PurpleContact*)target;
+		tg = (PurpleGroup*)target->parent;
+	}
 
 	if (ggblist->tagged) {
 		GList *list = ggblist->tagged;
 		ggblist->tagged = NULL;
-
 		while (list) {
 			PurpleBlistNode *node = list->data;
 			list = g_list_delete_link(list, list);
-			if (tg) {
-				if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+
+			if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+				update_node_display(node, ggblist);
+				/* Add the group after the current group */
+				purple_blist_add_group((PurpleGroup*)node, (PurpleBlistNode*)tg);
+			} else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+				update_buddy_display(purple_contact_get_priority_buddy((PurpleContact*)node), ggblist);
+				if ((PurpleBlistNode*)tg == target) {
+					/* The target is a group, just add the contact to the group. */
 					purple_blist_add_contact((PurpleContact*)node, tg, NULL);
-				else
+				} else if (tc) {
+					/* The target is either a buddy, or a contact. Merge with that contact. */
+					purple_blist_merge_contact((PurpleContact*)node, (PurpleBlistNode*)tc);
+				} else {
+					/* The target is a chat. Add the contact to the group after this chat. */
+					purple_blist_add_contact((PurpleContact*)node, NULL, target);
+				}
+			} else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+				update_buddy_display((PurpleBuddy*)node, ggblist);
+				if ((PurpleBlistNode*)tg == target) {
+					/* The target is a group. Add this buddy in a new contact under this group. */
 					purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL);
-			} else {
-				if (PURPLE_BLIST_NODE_IS_BUDDY(node))
-					purple_blist_add_buddy((PurpleBuddy*)node, tc,
-						purple_buddy_get_group(purple_contact_get_priority_buddy(tc)), NULL);
-				else if (PURPLE_BLIST_NODE_IS_CONTACT(node))
-					purple_blist_merge_contact((PurpleContact*)node, target);
+				} else if (PURPLE_BLIST_NODE_IS_CONTACT(target)) {
+					/* Add to the contact. */
+					purple_blist_add_buddy((PurpleBuddy*)node, tc, NULL, NULL);
+				} else if (PURPLE_BLIST_NODE_IS_BUDDY(target)) {
+					/* Add to the contact after the selected buddy. */
+					purple_blist_add_buddy((PurpleBuddy*)node, NULL, NULL, target);
+				} else if (PURPLE_BLIST_NODE_IS_CHAT(target)) {
+					/* Add to the selected chat's group. */
+					purple_blist_add_buddy((PurpleBuddy*)node, NULL, tg, NULL);
+				}
+			} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
+				update_node_display(node, ggblist);
+				if ((PurpleBlistNode*)tg == target)
+					purple_blist_add_chat((PurpleChat*)node, tg, NULL);
+				else
+					purple_blist_add_chat((PurpleChat*)node, NULL, target);
 			}
 		}
 	}
@@ -1419,6 +1455,15 @@
 }
 
 static void
+update_node_display(PurpleBlistNode *node, FinchBlist *ggblist)
+{
+	GntTextFormatFlags flag = 0;
+	if (ggblist->tagged && g_list_find(ggblist->tagged, node))
+		flag |= GNT_TEXT_FLAG_BOLD;
+	gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), node, flag);
+}
+
+static void
 update_buddy_display(PurpleBuddy *buddy, FinchBlist *ggblist)
 {
 	PurpleContact *contact;
@@ -1439,10 +1484,16 @@
 
 	if (purple_presence_is_idle(purple_buddy_get_presence(buddy))) {
 		gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, bflag | GNT_TEXT_FLAG_DIM);
-		gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag | GNT_TEXT_FLAG_DIM);
+		if (buddy == purple_contact_get_priority_buddy(contact))
+			gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag | GNT_TEXT_FLAG_DIM);
+		else
+			update_buddy_display(purple_contact_get_priority_buddy(contact), ggblist);
 	} else {
 		gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), buddy, bflag);
-		gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag);
+		if (buddy == purple_contact_get_priority_buddy(contact))
+			gnt_tree_set_row_flags(GNT_TREE(ggblist->tree), contact, cflag);
+		else
+			update_buddy_display(purple_contact_get_priority_buddy(contact), ggblist);
 	}
 }
 
@@ -1890,7 +1941,6 @@
 			break;
 		default:
 			return blist_node_compare_position(n1, n2);
-			break;
 	}
 	ret = blist_node_compare_text(n1, n2);
 	return ret;
--- a/finch/gntprefs.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/finch/gntprefs.c	Sun Apr 29 01:08:25 2007 +0000
@@ -42,9 +42,19 @@
 
 	purple_prefs_add_none("/finch/conversations");
 	purple_prefs_add_bool("/finch/conversations/timestamps", TRUE);
-	purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE); /* XXX: Not functional yet */
+	purple_prefs_add_bool("/finch/conversations/notify_typing", FALSE);
+}
+
+void finch_prefs_update_old()
+{
+	const char *str = NULL;
+
 	purple_prefs_rename("/gaim/gnt", "/finch");
 	purple_prefs_rename("/purple/gnt", "/finch");
+
+	if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
+			strcmp(str, "gaim") == 0)
+		purple_prefs_set_string("/purple/away/idle_reporting", "purple");
 }
 
 typedef struct
--- a/finch/gntprefs.h	Sun Apr 29 01:08:11 2007 +0000
+++ b/finch/gntprefs.h	Sun Apr 29 01:08:25 2007 +0000
@@ -40,6 +40,10 @@
  */
 void finch_prefs_show_all(void);
 
+/**
+ * You don't need to know about this.
+ */
+void finch_prefs_update_old(void);
 /*@}*/
 
 #endif
--- a/finch/libgnt/gnttree.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/finch/libgnt/gnttree.c	Sun Apr 29 01:08:25 2007 +0000
@@ -152,9 +152,7 @@
 
 	while(row->next)
 		row = row->next;
-	if (!row->collapsed && row->child)
-		row = get_last_child(row->child);
-	return row;
+	return get_last_child(row);
 }
 
 static GntTreeRow *
--- a/libpurple/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/Makefile.am	Sun Apr 29 01:08:25 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/Makefile.mingw	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/Makefile.mingw	Sun Apr 29 01:08:25 2007 +0000
@@ -117,7 +117,7 @@
 	sed -e 's/@PURPLE_VERSION@/$(PURPLE_VERSION)/g' \
 	    $@.in > $@
 
-$(OBJECTS): $(PURPLE_CONFIG_H)
+$(OBJECTS): $(PURPLE_CONFIG_H) $(PURPLE_VERSION_H)
 
 $(TARGET).dll $(TARGET).dll.a: $(OBJECTS)
 	$(CC) -shared $(OBJECTS) $(LIB_PATHS) $(LIBS) $(DLL_LD_FLAGS) -Wl,--out-implib,$(TARGET).dll.a -o $(TARGET).dll
--- a/libpurple/account.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/account.c	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/buddyicon.c	Sun Apr 29 01:08:25 2007 +0000
@@ -98,7 +98,6 @@
 {
 	PurpleCipherContext *context;
 	gchar digest[41];
-	const char *ext;
 
 	context = purple_cipher_context_new_by_name("sha1", NULL);
 	if (context == NULL)
@@ -116,10 +115,9 @@
 	}
 	purple_cipher_context_destroy(context);
 
-	ext = purple_util_get_image_extension(icon_data, icon_len);
-
 	/* Return the filename */
-	return g_strdup_printf("%s%s%s", digest, ext ? "." : "", ext ? ext : "");
+	return g_strdup_printf("%s.%s", digest,
+	                       purple_util_get_image_extension(icon_data, icon_len));
 }
 
 static void
@@ -696,11 +694,13 @@
 	{
 		const char *filename = purple_imgstore_get_filename(img);
 		purple_account_set_string(account, "buddy_icon", filename);
+		purple_account_set_int(account, "buddy_icon_timestamp", time(NULL));
 		ref_filename(filename);
 	}
 	else
 	{
 		purple_account_set_string(account, "buddy_icon", NULL);
+		purple_account_set_int(account, "buddy_icon_timestamp", 0);
 	}
 	unref_filename(old_icon);
 
@@ -735,6 +735,25 @@
 	return img;
 }
 
+time_t
+purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account)
+{
+	time_t ret;
+
+	g_return_val_if_fail(account != NULL, 0);
+
+	ret = purple_account_get_int(account, "buddy_icon_timestamp", 0);
+
+	/* This deals with migration cases. */
+	if (ret == 0 && purple_account_get_string(account, "buddy_icon", NULL) != NULL)
+	{
+		ret = time(NULL);
+		purple_account_set_int(account, "buddy_icon_timestamp", ret);
+	}
+
+	return ret;
+}
+
 PurpleStoredImage *
 purple_buddy_icons_find_custom_icon(PurpleContact *contact)
 {
@@ -950,13 +969,19 @@
 			}
 			else
 			{
-				int checksum = purple_blist_node_get_int(node, "icon_checksum");
-				if (checksum != 0)
+				PurpleAccount *account = purple_buddy_get_account((PurpleBuddy *)node);
+				const char *prpl_id = purple_account_get_protocol_id(account);
+
+				if (!strcmp(prpl_id, "prpl-yahoo"))
 				{
-					char *checksum_str = g_strdup_printf("%i", checksum);
-					purple_blist_node_remove_setting(node, "icon_checksum");
-					purple_blist_node_set_string(node, "icon_checksum", checksum_str);
-					g_free(checksum_str);
+					int checksum = purple_blist_node_get_int(node, "icon_checksum");
+					if (checksum != 0)
+					{
+						char *checksum_str = g_strdup_printf("%i", checksum);
+						purple_blist_node_remove_setting(node, "icon_checksum");
+						purple_blist_node_set_string(node, "icon_checksum", checksum_str);
+						g_free(checksum_str);
+					}
 				}
 			}
 		}
@@ -1016,7 +1041,7 @@
 		}
 	}
 
-        while (node != NULL)
+	while (node != NULL)
 	{
 		if (PURPLE_BLIST_NODE_IS_BUDDY(node))
 		{
@@ -1058,7 +1083,7 @@
 				{
 					migrate_buddy_icon(node,
 					                   "custom_buddy_icon",
-					                    dirname, filename);
+					                   dirname, filename);
 				}
 				else
 				{
@@ -1075,7 +1100,7 @@
 			}
 		}
 		node = purple_blist_node_next(node, TRUE);
-        }
+	}
 }
 
 void
@@ -1120,7 +1145,8 @@
 		g_direct_hash, g_direct_equal,
 		NULL, (GFreeFunc)g_hash_table_destroy);
 
-	icon_data_cache = g_hash_table_new(g_str_hash, g_str_equal);
+	icon_data_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
+	                                        g_free, NULL);
 	icon_file_cache = g_hash_table_new_full(g_str_hash, g_str_equal,
 	                                        g_free, NULL);
 	pointer_icon_cache = g_hash_table_new(g_direct_hash, g_direct_equal);
--- a/libpurple/buddyicon.h	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/buddyicon.h	Sun Apr 29 01:08:25 2007 +0000
@@ -261,6 +261,19 @@
                                     guchar *icon_data, size_t icon_len);
 
 /**
+ * Returns the timestamp of when the icon was set.
+ *
+ * This is intended for use in protocols that require a timestamp for
+ * buddy icon update reasons.
+ *
+ * @param account The account
+ *
+ * @return The time the icon was set, or 0 if an error occurred.
+ */
+time_t
+purple_buddy_icons_get_account_icon_timestamp(PurpleAccount *account);
+
+/**
  * Returns the custom buddy icon image for a contact.
  *
  * The caller owns a reference to the image in the store, and must dereference
--- a/libpurple/core.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/core.c	Sun Apr 29 01:08:25 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();
@@ -400,8 +401,9 @@
 			if (!strcmp(entry, "logs"))
 			{
 				char buf[MAXPATHLEN];
+				size_t linklen;
 
-				if (readlink(name, buf, sizeof(buf) - 1) == -1)
+				if ((linklen = readlink(name, buf, sizeof(buf) - 1) == -1))
 				{
 					purple_debug_error("core", "Error reading symlink %s: %s\n",
 					                   name, strerror(errno));
@@ -411,7 +413,7 @@
 					g_free(old_user_dir);
 					return FALSE;
 				}
-				buf[sizeof(buf) - 1] = '\0';
+				buf[linklen] = '\0';
 
 				logs_dir = g_strconcat(user_dir, G_DIR_SEPARATOR_S "logs", NULL);
 
--- a/libpurple/example/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/example/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/imgstore.c	Sun Apr 29 01:08:25 2007 +0000
@@ -160,6 +160,7 @@
 		g_free(img->data);
 		g_free(img->filename);
 		g_free(img);
+		img = NULL;
 	}
 
 	return img;
--- a/libpurple/notify.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/notify.c	Sun Apr 29 01:08:25 2007 +0000
@@ -521,6 +521,7 @@
 	}
 	
 	g_list_free(user_info->user_info_entries);
+	g_free(user_info);
 }
 
 GList *
--- a/libpurple/plugins/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/mono/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/mono/api/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/mono/loader/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/perl/Makefile.am	Sun Apr 29 01:08:25 2007 +0000
@@ -1,13 +1,11 @@
-plugindir = $(libdir)/purple
-hackdir = $(plugindir)/private
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 perl_dirs = common
 
 plugin_LTLIBRARIES = perl.la
-hack_LTLIBRARIES = libpurpleperl.la
 
 perl_la_LDFLAGS = -module -avoid-version
-perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS) libpurpleperl.la
+perl_la_LIBADD = $(GLIB_LIBS) $(PERL_LIBS)
 perl_la_SOURCES = \
 	perl.c \
 	perl-common.c \
@@ -17,12 +15,7 @@
 
 perl_la_DEPENDENCIES = \
 	.libs/libperl_orig.a \
-	.libs/DynaLoader.a \
-	libpurpleperl.la
-
-libpurpleperl_la_LDFLAGS = -module -avoid-version
-libpurpleperl_la_LIBADD = $(GLIB_LIBS)
-libpurpleperl_la_SOURCES = libpurpleperl.c
+	.libs/DynaLoader.a
 
 .libs/libperl_orig.a:
 	@mkdir -p .libs
@@ -42,55 +35,52 @@
 		$(LN_S) $(DYNALOADER_A) .libs/DynaLoader.a; \
 	fi
 
-
 common_sources = \
-        common/Account.xs \
-        common/AccountOpts.xs \
-        common/BuddyIcon.xs \
-        common/BuddyList.xs \
-        common/Cipher.xs \
-        common/Cmds.xs \
-        common/Core.xs \
-        common/Connection.xs \
-        common/Conversation.xs \
-        common/Debug.xs \
-        common/FT.xs \
-        common/ImgStore.xs \
-        common/Log.xs \
-        common/Makefile.PL.in \
-        common/Network.xs \
-        common/Notify.xs \
-        common/Plugin.xs \
-        common/PluginPref.xs \
-        common/Pounce.xs \
-        common/Prefs.xs \
-        common/Privacy.xs \
-        common/Proxy.xs \
-        common/Prpl.xs \
-        common/Purple.pm \
-        common/Purple.xs \
-        common/Request.xs \
-        common/Roomlist.xs \
-        common/SSLConn.xs \
-        common/SavedStatuses.xs \
-        common/Server.xs \
-        common/Signal.xs \
-        common/Sound.xs \
-        common/Status.xs \
-        common/Stringref.xs \
-        common/Util.xs \
-        common/XMLNode.xs \
-        common/fallback/const-c.inc \
-        common/fallback/const-xs.inc \
-        common/module.h \
-        common/typemap
-
+	common/Account.xs \
+	common/AccountOpts.xs \
+	common/BuddyIcon.xs \
+	common/BuddyList.xs \
+	common/Cipher.xs \
+	common/Cmds.xs \
+	common/Core.xs \
+	common/Connection.xs \
+	common/Conversation.xs \
+	common/Debug.xs \
+	common/FT.xs \
+	common/ImgStore.xs \
+	common/Log.xs \
+	common/Makefile.PL.in \
+	common/Network.xs \
+	common/Notify.xs \
+	common/Plugin.xs \
+	common/PluginPref.xs \
+	common/Pounce.xs \
+	common/Prefs.xs \
+	common/Privacy.xs \
+	common/Proxy.xs \
+	common/Prpl.xs \
+	common/Purple.pm \
+	common/Purple.xs \
+	common/Request.xs \
+	common/Roomlist.xs \
+	common/SSLConn.xs \
+	common/SavedStatuses.xs \
+	common/Server.xs \
+	common/Signal.xs \
+	common/Sound.xs \
+	common/Status.xs \
+	common/Stringref.xs \
+	common/Util.xs \
+	common/XMLNode.xs \
+	common/module.h \
+	common/typemap \
+	common/fallback/const-c.inc \
+	common/fallback/const-xs.inc
 
 EXTRA_DIST = \
 	Makefile.mingw \
 	common/Makefile.mingw \
-	$(common_sources) \
-	libpurpleperl.c
+	$(common_sources)
 
 common/Makefile: common/Makefile.PL
 	@if test "x${top_srcdir}" != "x${top_builddir}"; then \
@@ -157,7 +147,6 @@
 		done; \
 	fi
 
-
 AM_CPPFLAGS = \
 	-DVERSION=\"$(VERSION)\" \
 	-I$(top_srcdir) \
--- a/libpurple/plugins/perl/common/Makefile.PL.in	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/perl/common/Makefile.PL.in	Sun Apr 29 01:08:25 2007 +0000
@@ -1,18 +1,18 @@
 use 5.006;
 use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence the contents
+# of the Makefile that is written.
 WriteMakefile(
-    'NAME'		=> 'Purple',
-    'VERSION_FROM'	=> '@srcdir@/Purple.pm', # finds $VERSION
-    'PREREQ_PM'		=> {}, # e.g., Module::Name => 1.1
-    ($] >= 5.005 ?    ## Add these new keywords supported since 5.005
-      (ABSTRACT_FROM => '@srcdir@/Purple.pm', # retrieve abstract from module
-       AUTHOR     => 'Purple <http://pidgin.im/>') : ()),
-    'LIBS'		=> [''], # e.g., '-lm'
-    'DEFINE'		=> '@DEBUG_CFLAGS@', # e.g., '-DHAVE_SOMETHING'
-    'INC'		=> '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@', # e.g., '-I. -I/usr/include/other'
-    'OBJECT'		=> '$(O_FILES)', # link all the C files too
+    'NAME'              => 'Purple',
+    'VERSION_FROM'      => '@srcdir@/Purple.pm', # finds $VERSION
+    'PREREQ_PM'         => {}, # e.g., Module::Name => 1.1
+    ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+      (ABSTRACT_FROM    => '@srcdir@/Purple.pm', # finds $ABSTRACT
+       AUTHOR           => 'Purple <http://pidgin.im/>') : ()),
+    'DEFINE'            => '@DEBUG_CFLAGS@',
+    'INC'               => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple @GLIB_CFLAGS@',
+    'OBJECT'            => '$(O_FILES)', # link all the C files too
+#    'OPTIMIZE'          => '-g', # For debugging
 );
 
 if (eval {require ExtUtils::Constant; 1}) {
--- a/libpurple/plugins/perl/common/Makefile.mingw	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/perl/common/Makefile.mingw	Sun Apr 29 01:08:25 2007 +0000
@@ -66,7 +66,7 @@
 				Status.xs \
 				Stringref.xs \
 				Util.xs \
-				XMLNode.xs \
+				XMLNode.xs
 
 FALLBACKS =	const-c.inc const-xs.inc
 C_FILES = $(XS_FILES:%.xs=%.c)
--- a/libpurple/plugins/perl/common/Purple.pm	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/perl/common/Purple.pm	Sun Apr 29 01:08:25 2007 +0000
@@ -58,7 +58,7 @@
 
 =head1 NAME
 
-libpurple - Perl extension to the libpurple instant messenger library.
+Purple - Perl extension to the libpurple instant messenger library.
 
 =head1 SYNOPSIS
 
--- a/libpurple/plugins/perl/perl.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/perl/perl.c	Sun Apr 29 01:08:25 2007 +0000
@@ -93,6 +93,8 @@
 #include "perl-common.h"
 #include "perl-handlers.h"
 
+#include <gmodule.h>
+
 #define PERL_PLUGIN_ID "core-perl"
 
 PerlInterpreter *my_perl = NULL;
@@ -578,11 +580,11 @@
 	PURPLE_PLUGIN_MAGIC,
 	PURPLE_MAJOR_VERSION,
 	PURPLE_MINOR_VERSION,
-	PURPLE_PLUGIN_LOADER,                               /**< type           */
+	PURPLE_PLUGIN_LOADER,                             /**< type           */
 	NULL,                                             /**< ui_requirement */
 	0,                                                /**< flags          */
 	NULL,                                             /**< dependencies   */
-	PURPLE_PRIORITY_DEFAULT,                            /**< priority       */
+	PURPLE_PRIORITY_DEFAULT,                          /**< priority       */
 
 	PERL_PLUGIN_ID,                                   /**< id             */
 	N_("Perl Plugin Loader"),                         /**< name           */
@@ -590,7 +592,7 @@
 	N_("Provides support for loading perl plugins."), /**< summary        */
 	N_("Provides support for loading perl plugins."), /**< description    */
 	"Christian Hammond <chipx86@gnupdate.org>",       /**< author         */
-	PURPLE_WEBSITE,                                     /**< homepage       */
+	PURPLE_WEBSITE,                                   /**< homepage       */
 
 	plugin_load,                                      /**< load           */
 	plugin_unload,                                    /**< unload         */
@@ -608,4 +610,23 @@
 	loader_info.exts = g_list_append(loader_info.exts, "pl");
 }
 
+#ifdef __SUNPRO_C
+#pragma init (my_init)
+#else
+void __attribute__ ((constructor)) my_init(void);
+#endif
+
+void
+my_init(void)
+{
+	/* Mostly evil hack... puts perl.so's symbols in the global table but
+	 * does not create a circular dependency because g_module_open will
+	 * only open the library once. */
+	/* Do we need to keep track of the returned GModule here so that we
+	 * can g_module_close it when this plugin gets unloaded?
+	 * At the moment I don't think this plugin can ever get unloaded but
+	 * in case that becomes possible this wants to get noted. */
+	g_module_open("perl.so", 0);
+}
+
 PURPLE_INIT_PLUGIN(perl, init_plugin, info)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/plugins/perl/scripts/function_list.pl	Sun Apr 29 01:08:25 2007 +0000
@@ -0,0 +1,69 @@
+$MODULE_NAME = "List all Purple:: (and Pidgin::) functions";
+use Purple;
+# Uncomment this to print the Pidgin:: functions as well.
+#use Pidgin;
+
+# All the information Purple gets about our nifty plugin
+%PLUGIN_INFO = (
+	perl_api_version => 2,
+	name             => "Perl: $MODULE_NAME",
+	version          => "0.1",
+	summary          => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages",
+	description      => "Print to standard output all the functions under the Purple:: (and Pidgin::) packages",
+	author           => "Etan Reisner <deryni\@gmail.com>",
+	url              => "http://sourceforge.net/users/deryni9/",
+	id               => "functionlist",
+
+	load             => "plugin_load",
+	unload           => "plugin_unload"
+);
+
+sub plugin_init {
+	return %PLUGIN_INFO;
+}
+
+sub print_array {
+	my $array = shift;
+
+	my @arr = sort @$array;
+	foreach $mod (@arr) {
+		my @sub;
+
+		foreach $key (sort keys %{$mod}) {
+			if ($key =~ /::$/) {
+				push @sub, "$mod$key";
+			} else {
+				print "$mod$key\n";
+			}
+		}
+		print_array(\@sub);
+	}
+}
+
+sub plugin_load {
+	my $plugin = shift;
+	my @purplearray;
+	my @pidginarray;
+
+	foreach $key (sort keys %Purple::) {
+		if ($key =~ /::$/) {
+			push @purplearray, "Purple::$key";
+		} else {
+			print "Purple::$key\n";
+		}
+	}
+	print_array(\@purplearray);
+
+	foreach $key (sort keys %Pidgin::) {
+		if ($key =~ /::$/) {
+			push @pidginarray, "Pidgin::$key";
+		} else {
+			print "Pidgin::$key\n";
+		}
+	}
+	print_array(\@pidginarray);
+}
+
+sub plugin_unload {
+	my $plugin = shift;
+}
--- a/libpurple/plugins/ssl/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/ssl/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/plugins/tcl/Makefile.am	Sun Apr 29 01:08:25 2007 +0000
@@ -1,4 +1,4 @@
-plugindir = $(libdir)/purple
+plugindir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 tcl_la_LDFLAGS = -module -avoid-version
 
--- a/libpurple/prefs.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/prefs.c	Sun Apr 29 01:08:25 2007 +0000
@@ -1102,13 +1102,14 @@
 static void
 purple_prefs_rename_node(struct purple_pref *oldpref, struct purple_pref *newpref)
 {
-	struct purple_pref *child;
+	struct purple_pref *child, *next;
 	char *oldname, *newname;
 
 	/* if we're a parent, rename the kids first */
-	for(child = oldpref->first_child; child != NULL; child = child->sibling)
+	for(child = oldpref->first_child; child != NULL; child = next)
 	{
 		struct purple_pref *newchild;
+		next = child->sibling;
 		for(newchild = newpref->first_child; newchild != NULL; newchild = newchild->sibling)
 		{
 			if(!strcmp(child->name, newchild->name))
@@ -1327,6 +1328,8 @@
 void
 purple_prefs_update_old()
 {
+	purple_prefs_rename("/core", "/purple");
+
 	/* Remove some no-longer-used prefs */
 	purple_prefs_remove("/purple/away/auto_response/enabled");
 	purple_prefs_remove("/purple/away/auto_response/idle_only");
@@ -1360,7 +1363,6 @@
 		purple_prefs_set_int("/purple/sound/while_status", 3);
 	}
 	purple_prefs_remove("/purple/sound/while_away");
-	purple_prefs_rename("/core", "/purple");
 }
 
 void *
--- a/libpurple/protocols/bonjour/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/bonjour/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/gg/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/irc/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/jabber/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/jabber/Makefile.mingw	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/msn/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/msn/slp.c	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/novell/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/oscar/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/oscar/family_feedbag.c	Sun Apr 29 01:08:25 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/oscar/oscar.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sun Apr 29 01:08:25 2007 +0000
@@ -1941,9 +1941,9 @@
 		purple_debug_info("oscar",
 				   "Sending buddy icon to %s (%d bytes)\n",
 				   userinfo->sn, len);
-		/* TODO: XXX: FIXME: Does this actually need the mtime of the file? */
 		aim_im_sendch2_icon(od, userinfo->sn, data, len,
-			time(NULL), aimutil_iconsum(data, len));
+			purple_buddy_icons_get_account_icon_timestamp(account),
+			aimutil_iconsum(data, len));
 	}
 	purple_imgstore_unref(img);
 
@@ -4232,8 +4232,7 @@
 			gconstpointer data = purple_imgstore_get_data(img);
 			args.iconlen   = purple_imgstore_get_size(img);
 			args.iconsum   = aimutil_iconsum(data, args.iconlen);
-			/* TODO: XXX: FIXME: Deal with the timestamp issue. */
-			args.iconstamp = time(NULL);
+			args.iconstamp = purple_buddy_icons_get_account_icon_timestamp(account);
 
 			if ((args.iconlen != bi->ico_me_len) || (args.iconsum != bi->ico_me_csum) || (args.iconstamp != bi->ico_me_time)) {
 				bi->ico_informed = FALSE;
--- a/libpurple/protocols/qq/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/qq/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/sametime/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/silc/Makefile.am	Sun Apr 29 01:08:25 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/silc/buddy.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/silc/buddy.c	Sun Apr 29 01:08:25 2007 +0000
@@ -1706,7 +1706,7 @@
 	if (!mime)
 		return;
 
-	t = purple_util_get_image_extension(purple_imgstore_get_data(img), purple_imgstore_get_size(img));
+	t = purple_imgstore_get_extension(img);
 	if (!t || !strcmp(t, "icon")) {
 		silc_mime_free(mime);
 		return;
--- a/libpurple/protocols/simple/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/simple/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/toc/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/yahoo/Makefile.am	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/protocols/zephyr/Makefile.am	Sun Apr 29 01:08:25 2007 +0000
@@ -1,4 +1,4 @@
-pkgdir = $(libdir)/purple
+pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 ZEPHYRSOURCES = \
 	ZAsyncLocate.c \
--- a/libpurple/purple.pc.in	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/purple.pc.in	Sun Apr 29 01:08:25 2007 +0000
@@ -11,4 +11,3 @@
 Requires: glib-2.0
 Cflags: -I${includedir}/libpurple
 Libs: -L${libdir} -lpurple
-
--- a/libpurple/util.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/util.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2696,6 +2696,7 @@
 purple_normalize(const PurpleAccount *account, const char *str)
 {
 	const char *ret = NULL;
+	static char buf[BUF_LEN];
 
 	if (account != NULL)
 	{
@@ -2712,7 +2713,6 @@
 
 	if (ret == NULL)
 	{
-		static char buf[BUF_LEN];
 		char *tmp;
 
 		tmp = g_utf8_normalize(str, -1, G_NORMALIZE_DEFAULT);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libpurple/version.c	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 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	Sun Apr 29 01:08:25 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	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/win32/global.mak	Sun Apr 29 01:08:25 2007 +0000
@@ -48,6 +48,7 @@
 PIDGIN_CONFIG_H := $(PIDGIN_TREE_TOP)/config.h
 PURPLE_CONFIG_H := $(PIDGIN_TREE_TOP)/config.h
 PIDGIN_IDLETRACK_DLL := $(PIDGIN_IDLETRACK_TOP)/idletrack.dll
+PURPLE_VERSION_H := $(PURPLE_TOP)/version.h
 PURPLE_DLL := $(PURPLE_TOP)/libpurple.dll
 PURPLE_PERL_DLL := $(PURPLE_PERL_TOP)/perl.dll
 PIDGIN_DLL := $(PIDGIN_TOP)/pidgin.dll
@@ -57,10 +58,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/libpurple/win32/targets.mak	Sun Apr 29 01:08:11 2007 +0000
+++ b/libpurple/win32/targets.mak	Sun Apr 29 01:08:25 2007 +0000
@@ -8,7 +8,14 @@
 $(PIDGIN_CONFIG_H): $(PIDGIN_TREE_TOP)/config.h.mingw
 	cp $(PIDGIN_TREE_TOP)/config.h.mingw $(PIDGIN_CONFIG_H)
 
-$(PURPLE_DLL) $(PURPLE_DLL).a:
+$(PURPLE_VERSION_H): $(PURPLE_VERSION_H).in
+	cp $(PURPLE_VERSION_H).in $(PURPLE_VERSION_H)
+	awk 'BEGIN {FS="[\\(\\)\\[\\]]"} \
+	  /^m4_define..purple_major_version/ {system("sed -i -e s/@PURPLE_MAJOR_VERSION@/"$$5"/ $(PURPLE_VERSION_H)");} \
+	  /^m4_define..purple_minor_version/ {system("sed -i -e s/@PURPLE_MINOR_VERSION@/"$$5"/ $(PURPLE_VERSION_H)");} \
+	  /^m4_define..purple_micro_version/ {system("sed -i -e s/@PURPLE_MICRO_VERSION@/"$$5"/ $(PURPLE_VERSION_H)"); exit}' $(PIDGIN_TREE_TOP)/configure.ac
+
+$(PURPLE_DLL) $(PURPLE_DLL).a: $(PURPLE_VERSION_H)
 	$(MAKE) -C $(PURPLE_TOP) -f $(MINGW_MAKEFILE) libpurple.dll
 
 $(PURPLE_PERL_DLL) $(PURPLE_PERL_DLL).a:
--- a/pidgin.spec.in	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin.spec.in	Sun Apr 29 01:08:25 2007 +0000
@@ -227,8 +227,10 @@
 # Delete files that we don't want to put in any of the RPMs
 rm -f $RPM_BUILD_ROOT%{_libdir}/finch/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/pidgin/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpurple/*.la
-rm -f $RPM_BUILD_ROOT%{_libdir}/libpurple/private/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/*.la
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/liboscar.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/libjabber.so
+rm -f $RPM_BUILD_ROOT%{_libdir}/purple/private/*.la
 rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
 find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'
@@ -348,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	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkaccount.c	Sun Apr 29 01:08:25 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)
--- a/pidgin/gtkblist.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkblist.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2163,7 +2163,6 @@
 	const guchar *data = NULL;
 	gsize len;
 	PurpleBuddy *buddy = NULL;
-	PurpleChat *chat = NULL;
 	PurpleAccount *account = NULL;
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleStoredImage *custom_img;
@@ -2172,16 +2171,14 @@
 		buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
 	} else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		buddy = (PurpleBuddy*)node;
-	} else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
-		chat = (PurpleChat*)node;
 	} else {
 		return NULL;
 	}
 
-	if(buddy != NULL)
-		account = purple_buddy_get_account(buddy);
-	else if(chat != NULL)
-		account = chat->account;
+	if(buddy == NULL)
+		return NULL;
+
+	account = purple_buddy_get_account(buddy);
 
 	if(account && account->gc)
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
@@ -2199,18 +2196,14 @@
 	}
 
 	if (data == NULL) {
-		if(buddy != NULL) {
-			if (!(icon = purple_buddy_get_icon(buddy)))
-				if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) /* Not sure I like this...*/
-					return NULL;
-			data = purple_buddy_icon_get_data(icon, &len);
-			if (data == NULL)
+		if (!(icon = purple_buddy_get_icon(buddy)))
+			if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) /* Not sure I like this...*/
 				return NULL;
-		}
-	}
-
-	if(data == NULL)
-		return NULL;
+		data = purple_buddy_icon_get_data(icon, &len);
+
+		if(data == NULL)
+			return NULL;
+	}
 
 	loader = gdk_pixbuf_loader_new();
 	gdk_pixbuf_loader_write(loader, data, len, NULL);
--- a/pidgin/gtkconv.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkconv.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2370,8 +2370,13 @@
 
 	gtkconv = PIDGIN_CONVERSATION(conv);
 	account = purple_conversation_get_account(conv);
-	if(account && account->gc)
+
+	if(account && account->gc) {
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+	} else {
+		gtkconv->u.im->icon_timer = 0;
+		return FALSE;
+	}
 
 	gtkconv->auto_resize = TRUE;
 	g_idle_add(reset_auto_resize_cb, gtkconv);
@@ -3134,7 +3139,10 @@
 		gtk_widget_hide(gtkwin->menu.typing_icon);
 	}
 
-	if (!im || (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING)) {
+	if (im == NULL)
+		return;
+
+	if (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING) {
 		if (gtkconv->u.im->typing_timer != 0)
 			g_source_remove(gtkconv->u.im->typing_timer);
 		return;
--- a/pidgin/gtkdocklet-x11.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkdocklet-x11.c	Sun Apr 29 01:08:25 2007 +0000
@@ -25,6 +25,7 @@
 #include "internal.h"
 #include "pidgin.h"
 #include "debug.h"
+#include "prefs.h"
 #include "pidginstock.h"
 
 #include "gtkdialogs.h"
@@ -32,7 +33,8 @@
 #include "eggtrayicon.h"
 #include "gtkdocklet.h"
 
-#define EMBED_TIMEOUT 5000
+#define SHORT_EMBED_TIMEOUT 5000
+#define LONG_EMBED_TIMEOUT 15000
 
 /* globals */
 static EggTrayIcon *docklet = NULL;
@@ -44,12 +46,12 @@
 static int docklet_height = 0;
 
 /* protos */
-static void docklet_x11_create(void);
+static void docklet_x11_create(gboolean);
 
 static gboolean
-docklet_x11_create_cb()
+docklet_x11_recreate_cb()
 {
-	docklet_x11_create();
+	docklet_x11_create(TRUE);
 
 	return FALSE; /* for when we're called by the glib idle handler */
 }
@@ -62,6 +64,7 @@
 	g_source_remove(embed_timeout);
 	embed_timeout = 0;
 	pidgin_docklet_embedded();
+	purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE);
 }
 
 static void
@@ -74,7 +77,7 @@
 	g_object_unref(G_OBJECT(docklet));
 	docklet = NULL;
 
-	g_idle_add(docklet_x11_create_cb, NULL);
+	g_idle_add(docklet_x11_recreate_cb, NULL);
 }
 
 static void
@@ -236,7 +239,7 @@
 }
 
 static void
-docklet_x11_create()
+docklet_x11_create(gboolean recreate)
 {
 	GtkWidget *box;
 
@@ -272,17 +275,35 @@
 	 * previous visibility state.  If the docklet does not get embedded within
 	 * the timeout, it will be removed as a visibility manager until it does
 	 * get embedded.  Ideally, we would only call docklet_embedded() when the
-	 * icon was actually embedded.
+	 * icon was actually embedded. This only happens when the docklet is first
+	 * created, not when being recreated.
+	 *
+	 * The x11 docklet tracks whether it successfully embedded in a pref and
+	 * allows for a longer timeout period if it successfully embedded the last
+	 * time it was run. This should hopefully solve problems with the buddy
+	 * list not properly starting hidden when gaim is started on login.
 	 */
-	pidgin_docklet_embedded();
-	embed_timeout = g_timeout_add(EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+	if(!recreate) {
+		pidgin_docklet_embedded();
+		if(purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded")) {
+			embed_timeout = g_timeout_add(LONG_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+		} else {
+			embed_timeout = g_timeout_add(SHORT_EMBED_TIMEOUT, docklet_x11_embed_timeout_cb, NULL);
+		}
+	}
 
 	purple_debug(PURPLE_DEBUG_INFO, "docklet", "created\n");
 }
 
+static void
+docklet_x11_create_ui_op()
+{
+	docklet_x11_create(FALSE);
+}
+
 static struct docklet_ui_ops ui_ops =
 {
-	docklet_x11_create,
+	docklet_x11_create_ui_op,
 	docklet_x11_destroy,
 	docklet_x11_update_icon,
 	docklet_x11_blank_icon,
@@ -298,4 +319,6 @@
 docklet_ui_init()
 {
 	pidgin_docklet_set_ui_ops(&ui_ops);
+	purple_prefs_add_none(PIDGIN_PREFS_ROOT "/docklet/x11");
+	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/x11/embedded", FALSE);
 }
--- a/pidgin/gtkprefs.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkprefs.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2029,8 +2029,6 @@
 void
 pidgin_prefs_init(void)
 {
-	/* only change this when we have a sane prefs migration path */
-	purple_prefs_add_none("/gaim");
 	purple_prefs_add_none(PIDGIN_PREFS_ROOT "");
 	purple_prefs_add_none("/plugins/gtk");
 
@@ -2061,7 +2059,12 @@
 								smiley_theme_pref_cb, NULL);
 }
 
-void pidgin_prefs_update_old() {
+void pidgin_prefs_update_old()
+{
+	const char *str;
+
+	purple_prefs_rename("/gaim/gtk", PIDGIN_PREFS_ROOT);
+
 	/* Rename some old prefs */
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_ims", "/purple/logging/log_ims");
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/logging/log_chats", "/purple/logging/log_chats");
@@ -2076,6 +2079,9 @@
 
 	/* this string pref moved into the core, try to be friendly */
 	purple_prefs_rename(PIDGIN_PREFS_ROOT "/idle/reporting_method", "/purple/away/idle_reporting");
+	if ((str = purple_prefs_get_string("/purple/away/idle_reporting")) &&
+			strcmp(str, "gaim") == 0)
+		purple_prefs_set_string("/purple/away/idle_reporting", "purple");
 
 	/* Remove some no-longer-used prefs */
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/blist/auto_expand_contacts");
@@ -2125,5 +2131,4 @@
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/away/queue_messages");
 	purple_prefs_remove(PIDGIN_PREFS_ROOT "/away");
 	purple_prefs_remove("/plugins/gtk/docklet/queue_messages");
-	purple_prefs_rename("/gaim/gtk", "/pidgin");
 }
--- a/pidgin/gtkstatusbox.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkstatusbox.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2014,6 +2014,17 @@
 }
 
 static void
+pixbuf_size_prepared_cb(GdkPixbufLoader *loader, int width, int height, gpointer data)
+{
+#if GTK_CHECK_VERSION(2,2,0)
+	int w, h;
+	GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_MEDIUM);
+	gtk_icon_size_lookup(icon_size, &w, &h);
+	gdk_pixbuf_loader_set_size(loader, w, h);
+#endif
+}
+
+static void
 pidgin_status_box_redisplay_buddy_icon(PidginStatusBox *status_box)
 {
 
@@ -2031,6 +2042,7 @@
 	if (status_box->buddy_icon_img != NULL)
 	{
 		GdkPixbufLoader *loader = gdk_pixbuf_loader_new();
+		g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL);
 		gdk_pixbuf_loader_write(loader, purple_imgstore_get_data(status_box->buddy_icon_img),
 		                        purple_imgstore_get_size(status_box->buddy_icon_img), NULL);
 		gdk_pixbuf_loader_close(loader, NULL);
@@ -2047,7 +2059,7 @@
 	}
 
 	if (status_box->buddy_icon != NULL) {
-	        status_box->icon_opaque = pidgin_gdk_pixbuf_is_opaque(status_box->buddy_icon);
+		status_box->icon_opaque = pidgin_gdk_pixbuf_is_opaque(status_box->buddy_icon);
 		gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon);
 		status_box->buddy_icon_hover = gdk_pixbuf_copy(status_box->buddy_icon);
 		do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 32);
--- a/pidgin/gtkutils.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/gtkutils.c	Sun Apr 29 01:08:25 2007 +0000
@@ -2860,16 +2860,16 @@
 				void *user_data,  ...)
 {
 	GtkWidget *vbox;
-        GtkWidget *hbox;
-        GtkWidget *hbox2;
-        GtkWidget *label;
-        GtkWidget *button;
-        GtkWidget *img = NULL;
+	GtkWidget *hbox;
+	GtkWidget *hbox2;
+	GtkWidget *label;
+	GtkWidget *button;
+	GtkWidget *img = NULL;
 	GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
 	char label_text[2048];
 	const char *button_text;
 	GCallback callback;
-	char *primary_esc, *secondary_esc;
+	char *primary_esc, *secondary_esc = NULL;
 	va_list args;
 	static gboolean first_call = TRUE;
 
@@ -2877,7 +2877,7 @@
 	gtk_misc_set_alignment(GTK_MISC(img), 0, 0);
 
 	vbox = gtk_vbox_new(FALSE,0);
-        gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BOX_SPACE);
+	gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BOX_SPACE);
 
 	g_object_set_data(G_OBJECT(vbox), "gc" ,gc);
 	minidialogs = g_slist_prepend(minidialogs, vbox);
@@ -2890,10 +2890,10 @@
 				    PURPLE_CALLBACK(connection_signed_off_cb), NULL);
 	}
 
-      	hbox = gtk_hbox_new(FALSE, 0);
-        gtk_container_add(GTK_CONTAINER(vbox), hbox);
-
-        if (img != NULL)
+	hbox = gtk_hbox_new(FALSE, 0);
+	gtk_container_add(GTK_CONTAINER(vbox), hbox);
+
+	if (img != NULL)
 		gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
 
 	primary_esc = g_markup_escape_text(primary, -1);
@@ -2902,14 +2902,15 @@
 		secondary_esc = g_markup_escape_text(secondary, -1);
 	g_snprintf(label_text, sizeof(label_text),
 		   "<span weight=\"bold\" size=\"smaller\">%s</span>%s<span size=\"smaller\">%s</span>",
-		   primary_esc, secondary ? "\n" : "", secondary?secondary_esc:"");
+		   primary_esc, secondary ? "\n" : "", secondary_esc ? secondary_esc : "");
 	g_free(primary_esc);
+	g_free(secondary_esc);
 	label = gtk_label_new(NULL);
 	gtk_widget_set_size_request(label, purple_prefs_get_int(PIDGIN_PREFS_ROOT "/blist/width")-25,-1);
 	gtk_label_set_markup(GTK_LABEL(label), label_text);
-        gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
-        gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
-        gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
+	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
 
 	hbox2 = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
 	gtk_box_pack_start(GTK_BOX(vbox), hbox2, FALSE, FALSE, 0);
--- a/pidgin/pidginstock.c	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/pidginstock.c	Sun Apr 29 01:08:25 2007 +0000
@@ -237,7 +237,7 @@
 
 /* Altered from do_colorshift in gnome-panel */
 static void
-do_alphashift (GdkPixbuf *dest, GdkPixbuf *src, int shift)
+do_alphashift (GdkPixbuf *dest, GdkPixbuf *src)
 {
         gint i, j;
         gint width, height, has_alpha, srcrowstride, destrowstride;
@@ -245,7 +245,6 @@
         guchar *original_pixels;
         guchar *pixsrc;
         guchar *pixdest;
-        int val;
         guchar a;
 
         has_alpha = gdk_pixbuf_get_has_alpha (src);
@@ -267,8 +266,7 @@
                         *(pixdest++) = *(pixsrc++);
                         *(pixdest++) = *(pixsrc++);
                         a = *(pixsrc++);
-                        val = a - shift;
-                        *(pixdest++) = CLAMP(val, 0, 255);
+                        *(pixdest++) = a / 2;
                 }
         }
 }
@@ -286,7 +284,7 @@
 
 	filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, file, NULL);
 	pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-	do_alphashift(pixbuf, pixbuf, 128);
+	do_alphashift(pixbuf, pixbuf);
 
 	source = gtk_icon_source_new();
         gtk_icon_source_set_pixbuf(source, pixbuf);
@@ -314,7 +312,7 @@
        if (rtl) {
 		filename = g_build_filename(DATADIR, "pixmaps", "pidgin", dir, size, "rtl", file, NULL);
  		pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-		do_alphashift(pixbuf, pixbuf, 128);
+		do_alphashift(pixbuf, pixbuf);
 		source = gtk_icon_source_new();
                 gtk_icon_source_set_pixbuf(source, pixbuf);
                 gtk_icon_source_set_direction(source, GTK_TEXT_DIR_RTL);
Binary file pidgin/pixmaps/animations/16/connect0.png has changed
Binary file pidgin/pixmaps/animations/16/connect1.png has changed
Binary file pidgin/pixmaps/animations/16/connect2.png has changed
Binary file pidgin/pixmaps/animations/16/connect3.png has changed
Binary file pidgin/pixmaps/animations/16/connect4.png has changed
Binary file pidgin/pixmaps/animations/16/connect5.png has changed
Binary file pidgin/pixmaps/animations/16/connect6.png has changed
Binary file pidgin/pixmaps/animations/16/connect7.png has changed
Binary file pidgin/pixmaps/animations/16/connect8.png has changed
Binary file pidgin/pixmaps/animations/16/connect9.png has changed
Binary file pidgin/pixmaps/logo.png has changed
--- a/pidgin/plugins/Makefile.mingw	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/Makefile.mingw	Sun Apr 29 01:08:25 2007 +0000
@@ -58,13 +58,13 @@
 .PHONY: all clean plugins install
 
 all: plugins
-#	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(MINGW_MAKEFILE)
+	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(MINGW_MAKEFILE)
 	$(MAKE) -C $(TICKER_PLUGIN) -f $(MINGW_MAKEFILE)
 	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(MINGW_MAKEFILE)
 	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(MINGW_MAKEFILE)
 
 install: all $(PIDGIN_INSTALL_PLUGINS_DIR)
-#	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(MINGW_MAKEFILE) install
+	$(MAKE) -C $(GTKPERL_PLUGIN) -f $(MINGW_MAKEFILE) install
 	$(MAKE) -C $(TICKER_PLUGIN) -f $(MINGW_MAKEFILE) install
 	$(MAKE) -C $(TRANSPARENCY_PLUGIN) -f $(MINGW_MAKEFILE) install
 	$(MAKE) -C $(WINPREFS_PLUGIN) -f $(MINGW_MAKEFILE) install
--- a/pidgin/plugins/perl/Makefile.am	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/perl/Makefile.am	Sun Apr 29 01:08:25 2007 +0000
@@ -24,10 +24,10 @@
 	common/GtkSound.xs \
 	common/GtkStatusBox.xs \
 	common/GtkThemes.xs \
-	common/GtkUI.pm \
-	common/GtkUI.xs \
 	common/GtkUtils.xs \
 	common/Makefile.PL.in \
+	common/Pidgin.pm \
+	common/Pidgin.xs \
 	common/gtkmodule.h \
 	common/typemap
 
--- a/pidgin/plugins/perl/common/GtkSession.xs	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/perl/common/GtkSession.xs	Sun Apr 29 01:08:25 2007 +0000
@@ -1,6 +1,6 @@
 #include "gtkmodule.h"
 
-MODULE = Purple::GtkUI::Session  PACKAGE = Purple::GtkUI::Session  PREFIX = gaim_gtk_session_
+MODULE = Pidgin::Session  PACKAGE = Pidgin::Session  PREFIX = pidgin_session_
 PROTOTYPES: ENABLE
 
 void
--- a/pidgin/plugins/perl/common/GtkUI.pm	Sun Apr 29 01:08:11 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-package Purple::GtkUI;
-
-use 5.008;
-use strict;
-use warnings;
-use Carp;
-
-our $VERSION = '0.01';
-
-use Purple;
-
-require XSLoader;
-XSLoader::load('Purple::GtkUI', $VERSION);
-
-1;
-__END__
-
-=head1 NAME
-
-Purple::GtkUI - Perl extension for the Pidgin instant messenger.
-
-=head1 SYNOPSIS
-
-    use Purple::GtkUI;
-
-=head1 ABSTRACT
-
-    This module provides the interface for using perl scripts as plugins in
-    Pidgin, with access to the Pidgin Gtk interface functions.
-
-=head1 DESCRIPTION
-
-This module provides the interface for using perl scripts as plugins in Pidgin,
-with access to the Pidgin Gtk interface functions. With this, developers can
-write perl scripts that can be loaded in Pidgin as plugins. The script can
-interact with IMs, chats, accounts, the buddy list, pidgin signals, and more.
-
-The API for the perl interface is very similar to that of the Pidgin C API,
-which can be viewed at http://developer.pidgin.im/doxygen/ or in the header files
-in the Pidgin source tree.
-
-=head1 FUNCTIONS
-
-=over
-
-=back
-
-=head1 SEE ALSO
-Pidgin C API documentation - http://developer.pidgin.im/doxygen/
-
-The Pidgin perl module.
-
-Pidgin website - http://pidgin.im/
-
-=head1 AUTHOR
-
-Etan Reisner, E<lt>deryni@gmail.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2006 by Etan Reisner
--- a/pidgin/plugins/perl/common/GtkUI.xs	Sun Apr 29 01:08:11 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#include "gtkmodule.h"
-
-/* Prototypes for the BOOT section below. */
-PURPLE_PERL_BOOT_PROTO(GtkUI__Account);
-PURPLE_PERL_BOOT_PROTO(GtkUI__BuddyList);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Connection);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Conversation);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Conversation__Window);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Debug);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Dialogs);
-PURPLE_PERL_BOOT_PROTO(GtkUI__IMHtml);
-PURPLE_PERL_BOOT_PROTO(GtkUI__IMHtmlToolbar);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Log);
-PURPLE_PERL_BOOT_PROTO(GtkUI__MenuTray);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Plugin);
-PURPLE_PERL_BOOT_PROTO(GtkUI__PluginPref);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Pounce);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Prefs);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Privacy);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Roomlist);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Status);
-#ifndef _WIN32
-PURPLE_PERL_BOOT_PROTO(GtkUI__Session);
-#endif
-PURPLE_PERL_BOOT_PROTO(GtkUI__Sound);
-PURPLE_PERL_BOOT_PROTO(GtkUI__StatusBox);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Themes);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Utils);
-PURPLE_PERL_BOOT_PROTO(GtkUI__Xfer);
-
-MODULE = Purple::GtkUI  PACKAGE = Purple::GtkUI  PREFIX = pidgin_
-PROTOTYPES: ENABLE
-
-BOOT:
-	PURPLE_PERL_BOOT(GtkUI__Account);
-	PURPLE_PERL_BOOT(GtkUI__BuddyList);
-	PURPLE_PERL_BOOT(GtkUI__Connection);
-	PURPLE_PERL_BOOT(GtkUI__Conversation);
-	PURPLE_PERL_BOOT(GtkUI__Conversation__Window);
-	PURPLE_PERL_BOOT(GtkUI__Debug);
-	PURPLE_PERL_BOOT(GtkUI__Dialogs);
-	PURPLE_PERL_BOOT(GtkUI__IMHtml);
-	PURPLE_PERL_BOOT(GtkUI__IMHtmlToolbar);
-	PURPLE_PERL_BOOT(GtkUI__Log);
-	PURPLE_PERL_BOOT(GtkUI__MenuTray);
-	PURPLE_PERL_BOOT(GtkUI__Plugin);
-	PURPLE_PERL_BOOT(GtkUI__PluginPref);
-	PURPLE_PERL_BOOT(GtkUI__Pounce);
-	PURPLE_PERL_BOOT(GtkUI__Prefs);
-	PURPLE_PERL_BOOT(GtkUI__Privacy);
-	PURPLE_PERL_BOOT(GtkUI__Roomlist);
-	PURPLE_PERL_BOOT(GtkUI__Status);
-#ifndef _WIN32
-	PURPLE_PERL_BOOT(GtkUI__Session);
-#endif
-	PURPLE_PERL_BOOT(GtkUI__Sound);
-	PURPLE_PERL_BOOT(GtkUI__StatusBox);
-	PURPLE_PERL_BOOT(GtkUI__Themes);
-	PURPLE_PERL_BOOT(GtkUI__Utils);
-	PURPLE_PERL_BOOT(GtkUI__Xfer);
--- a/pidgin/plugins/perl/common/MANIFEST	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/perl/common/MANIFEST	Sun Apr 29 01:08:25 2007 +0000
@@ -21,8 +21,8 @@
 GtkSound.xs
 GtkStatusBox.xs
 GtkThemes.xs
-GtkUI.pm
-GtkUI.xs
 GtkUtils.xs
 MANIFEST
+Pidgin.pm
+Pidgin.xs
 typemap
--- a/pidgin/plugins/perl/common/Makefile.PL.in	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/perl/common/Makefile.PL.in	Sun Apr 29 01:08:25 2007 +0000
@@ -1,20 +1,16 @@
 use 5.006;
 use ExtUtils::MakeMaker;
-
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence the contents
+# of the Makefile that is written.
 WriteMakefile(
-    'NAME'          => 'Purple::GtkUI',
-    'VERSION_FROM'  => '@srcdir@/GtkUI.pm', # finds $VERSION
+    'NAME'             => 'Pidgin',
+    'VERSION_FROM'     => '@srcdir@/Pidgin.pm', # finds $VERSION
     ($] >= 5.005 ? ## Add these new keywords supported since 5.005
-	('ABSTRACT_FROM' => '@srcdir@/GtkUI.pm', # finds $ABSTRACT
-	'AUTHOR'        => 'Pidgin <http://pidgin.im/>') :  ()),
+      ('ABSTRACT_FROM' => '@srcdir@/Pidgin.pm', # finds $ABSTRACT
+       'AUTHOR'        => 'Pidgin <http://pidgin.im/>') :  ()),
     'DEFINE'        => '@DEBUG_CFLAGS@',
     'INC'           => '-I. -I@srcdir@ -I@top_srcdir@ -I@top_srcdir@/libpurple -I@top_srcdir@/pidgin @GTK_CFLAGS@',
-#    'PREREQ_PM'     => { 'Pidgin' => '@VERSION@'},
-    # Do this because the MakeMaker Makefile is dumb, and on clean it moves
-    # Makefile to the default setting for MAKEFILE_OLD which is Makefile.old
-    # but this breaks running make clean more than once in a row.
-    'MAKEFILE_OLD'  => "Makefile",
-    'OBJECT'        => '$(O_FILES)',
+    'OBJECT'        => '$(O_FILES)', # link all the C files too
     'TYPEMAPS'      => ["@top_srcdir@/libpurple/plugins/perl/common/typemap"],
 #    'OPTIMIZE'      => '-g', # For debugging.
 );
--- a/pidgin/plugins/perl/common/Makefile.mingw	Sun Apr 29 01:08:11 2007 +0000
+++ b/pidgin/plugins/perl/common/Makefile.mingw	Sun Apr 29 01:08:25 2007 +0000
@@ -39,7 +39,7 @@
 ##  SOURCES, OBJECTS
 ##
 XS_FILES = \
-	GtkUI.xs \
+	Pidgin.xs \
 	GtkAccount.xs \
 	GtkBlist.xs \
 	GtkConn.xs \
@@ -91,8 +91,8 @@
 
 install: all $(PURPLE_INSTALL_PERLMOD_DIR)/Purple.pm
 	rm -f $(PIDGIN_INSTALL_PERLMOD_DIR)/$(TARGET).dll $(PIDGIN_INSTALL_PERLMOD_DIR)/Pidgin/$(TARGET).pm
-	mkdir -p $(PIDGIN_INSTALL_PERLMOD_DIR)/Pidgin
-	cp $(TARGET).pm $(PIDGIN_INSTALL_PERLMOD_DIR)/Pidgin/
+	mkdir -p $(PIDGIN_INSTALL_PERLMOD_DIR)
+	cp $(TARGET).pm $(PIDGIN_INSTALL_PERLMOD_DIR)
 	cp $(TARGET).dll $(PIDGIN_INSTALL_PERLMOD_DIR)
 
 $(C_FILES): $(PIDGIN_CONFIG_H)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/plugins/perl/common/Pidgin.pm	Sun Apr 29 01:08:25 2007 +0000
@@ -0,0 +1,61 @@
+package Pidgin;
+
+use 5.008;
+use strict;
+use warnings;
+use Carp;
+
+our $VERSION = '0.01';
+
+use Purple;
+
+require XSLoader;
+XSLoader::load('Pidgin', $VERSION);
+
+1;
+__END__
+
+=head1 NAME
+
+Pidgin - Perl extension for the Pidgin instant messenger.
+
+=head1 SYNOPSIS
+
+    use Pidgin;
+
+=head1 ABSTRACT
+
+    This module provides the interface for using perl scripts as plugins in
+    Pidgin, with access to the Pidgin Gtk interface functions.
+
+=head1 DESCRIPTION
+
+This module provides the interface for using perl scripts as plugins in Pidgin,
+with access to the Pidgin Gtk interface functions. With this, developers can
+write perl scripts that can be loaded in Pidgin as plugins. The script can
+interact with IMs, chats, accounts, the buddy list, pidgin signals, and more.
+
+The API for the perl interface is very similar to that of the Pidgin C API,
+which can be viewed at http://developer.pidgin.im/doxygen/ or in the header files
+in the Pidgin source tree.
+
+=head1 FUNCTIONS
+
+=over
+
+=back
+
+=head1 SEE ALSO
+Pidgin C API documentation - http://developer.pidgin.im/doxygen/
+
+The Pidgin perl module.
+
+Pidgin website - http://pidgin.im/
+
+=head1 AUTHOR
+
+Etan Reisner, E<lt>deryni@gmail.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2006 by Etan Reisner
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pidgin/plugins/perl/common/Pidgin.xs	Sun Apr 29 01:08:25 2007 +0000
@@ -0,0 +1,66 @@
+#define PIDGIN_PERL_BOOT_PROTO(x) \
+	void boot_Pidgin__##x(pTHX_ CV *cv)
+
+#define PIDGIN_PERL_BOOT(x) \
+	purple_perl_callXS(boot_Pidgin__##x, cv, mark)
+
+#include "gtkmodule.h"
+
+/* Prototypes for the BOOT section below. */
+PIDGIN_PERL_BOOT_PROTO(Account);
+PIDGIN_PERL_BOOT_PROTO(BuddyList);
+PIDGIN_PERL_BOOT_PROTO(Connection);
+PIDGIN_PERL_BOOT_PROTO(Conversation);
+PIDGIN_PERL_BOOT_PROTO(Conversation__Window);
+PIDGIN_PERL_BOOT_PROTO(Debug);
+PIDGIN_PERL_BOOT_PROTO(Dialogs);
+PIDGIN_PERL_BOOT_PROTO(IMHtml);
+PIDGIN_PERL_BOOT_PROTO(IMHtmlToolbar);
+PIDGIN_PERL_BOOT_PROTO(Log);
+PIDGIN_PERL_BOOT_PROTO(MenuTray);
+PIDGIN_PERL_BOOT_PROTO(Plugin);
+PIDGIN_PERL_BOOT_PROTO(PluginPref);
+PIDGIN_PERL_BOOT_PROTO(Pounce);
+PIDGIN_PERL_BOOT_PROTO(Prefs);
+PIDGIN_PERL_BOOT_PROTO(Privacy);
+PIDGIN_PERL_BOOT_PROTO(Roomlist);
+PIDGIN_PERL_BOOT_PROTO(Status);
+#ifndef _WIN32
+PIDGIN_PERL_BOOT_PROTO(Session);
+#endif
+PIDGIN_PERL_BOOT_PROTO(Sound);
+PIDGIN_PERL_BOOT_PROTO(StatusBox);
+PIDGIN_PERL_BOOT_PROTO(Themes);
+PIDGIN_PERL_BOOT_PROTO(Utils);
+PIDGIN_PERL_BOOT_PROTO(Xfer);
+
+MODULE = Pidgin  PACKAGE = Pidgin  PREFIX = pidgin_
+PROTOTYPES: ENABLE
+
+BOOT:
+	PIDGIN_PERL_BOOT(Account);
+	PIDGIN_PERL_BOOT(BuddyList);
+	PIDGIN_PERL_BOOT(Connection);
+	PIDGIN_PERL_BOOT(Conversation);
+	PIDGIN_PERL_BOOT(Conversation__Window);
+	PIDGIN_PERL_BOOT(Debug);
+	PIDGIN_PERL_BOOT(Dialogs);
+	PIDGIN_PERL_BOOT(IMHtml);
+	PIDGIN_PERL_BOOT(IMHtmlToolbar);
+	PIDGIN_PERL_BOOT(Log);
+	PIDGIN_PERL_BOOT(MenuTray);
+	PIDGIN_PERL_BOOT(Plugin);
+	PIDGIN_PERL_BOOT(PluginPref);
+	PIDGIN_PERL_BOOT(Pounce);
+	PIDGIN_PERL_BOOT(Prefs);
+	PIDGIN_PERL_BOOT(Privacy);
+	PIDGIN_PERL_BOOT(Roomlist);
+	PIDGIN_PERL_BOOT(Status);
+#ifndef _WIN32
+	PIDGIN_PERL_BOOT(Session);
+#endif
+	PIDGIN_PERL_BOOT(Sound);
+	PIDGIN_PERL_BOOT(StatusBox);
+	PIDGIN_PERL_BOOT(Themes);
+	PIDGIN_PERL_BOOT(Utils);
+	PIDGIN_PERL_BOOT(Xfer);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/valgrind-suppressions	Sun Apr 29 01:08:25 2007 +0000
@@ -0,0 +1,154 @@
+{
+   X oddness 1
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:_XReply
+}
+{
+   NSS
+   Memcheck:Cond
+   obj:/usr/lib/libsoftokn3.so
+   obj:/usr/lib/libsoftokn3.so
+   obj:/usr/lib/libsoftokn3.so
+   obj:/usr/lib/libsoftokn3.so
+}
+{
+   X oddness 2
+   Memcheck:Param
+   writev(vector[...])
+   fun:writev
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:_X11TransWritev
+   fun:_XSend
+}
+{
+   X oddness 3
+   Memcheck:Cond
+   fun:XcursorImageHash
+   fun:XcursorNoticePutBitmap
+   fun:_XNoticePutBitmap
+   fun:XPutImage
+}
+{
+   X oddness 4
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:XFlush
+}
+{
+   X oddness 5
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:XDrawLine
+}
+{
+   X oddness 6
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:_XEventsQueued
+}
+{
+   File selector
+   Memcheck:Value4
+   fun:_itoa_word
+   fun:_IO_vfprintf_internal
+   fun:_IO_vsprintf_internal
+   fun:_IO_sprintf
+}
+{
+   File selector 2
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:XRenderComposite
+}
+{
+   TCL leak
+   Memcheck:Leak
+   fun:malloc
+   fun:TclpAlloc
+   fun:Tcl_Alloc
+   fun:Tcl_StaticPackage
+}
+{
+   FontConfig Maybe
+   Memcheck:Leak
+   fun:malloc
+   fun:FcStrCopy
+   fun:FcStrSetAdd
+   fun:FcLangSetCopy
+}
+{
+   File selector 3
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:_XFlushGCCache
+}
+{
+   File selector 4
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:XCreateGC
+}
+{
+   Something else
+   Memcheck:Param
+   write(buf)
+   fun:__write_nocancel
+   fun:_X11TransWrite
+   obj:/usr/X11R6/lib/libX11.so.6.2
+   fun:_XSetClipRectangles
+}
+{
+   New conversation windows
+   Memcheck:Cond
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+}
+{
+   New conversation windows 2
+   Memcheck:Cond
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgtk-x11-2.0.so.0.400.14
+   obj:/usr/lib/libgobject-2.0.so.0.400.8
+}
+{
+   NSS Init
+   Memcheck:Leak
+   fun:malloc
+   fun:PR_Malloc
+   fun:PR_CreateStack
+   fun:_PR_InitFdCache
+   fun:_PR_InitIO
+   fun:_PR_ImplicitInitialization
+   fun:PR_Init
+   fun:rsa_nss_init
+   fun:GE_plugin_load
+   fun:gaim_plugin_load
+   fun:gaim_plugins_load_saved
+   fun:main
+}
+