changeset 24292:8282911d5e17

Build everything with the *_DISABLE_DEPRECATED flags set. This allows us to detect when we're still using deprecated functions internally (and by extension, when we've deprecated something we shouldn't have). In the course of developing this changeset, I fixed a few such cases. Given that the plan is to switch from PURPLE_HIDE_STRUCTS to PURPLE_DISABLE_DEPRECATED as each struct is fully dealt with, this will also ensure we have no regressions on the struct hiding work. Deprecated functions are still available to the respective .c file, to avoid missing prototype errors. Also, Perl and DBus undef the *_DISABLE_DEPRECATED defines as appropriate so that deprecated functions will still be exported to Perl plugins and via DBus. (Otherwise, we'd be breaking backwards compatibility.)
author Richard Laager <rlaager@wiktel.com>
date Thu, 30 Oct 2008 22:40:49 +0000
parents f52b94f3b6ca
children 18711b62ec27
files configure.ac libpurple/account.c libpurple/blist.c libpurple/blist.h libpurple/buddyicon.c libpurple/buddyicon.h libpurple/connection.c libpurple/connection.h libpurple/dbus-server.c libpurple/internal.h libpurple/notify.c libpurple/notify.h libpurple/plugin.c libpurple/plugin.h libpurple/plugins/perl/common/BuddyList.xs libpurple/plugins/perl/common/module.h libpurple/protocols/gg/gg.c libpurple/sslconn.c libpurple/sslconn.h pidgin/gtkconv.c pidgin/gtkconv.h pidgin/gtkdialogs.c pidgin/gtkdialogs.h pidgin/gtkimhtml.c pidgin/gtkimhtml.h pidgin/gtkutils.c pidgin/gtkutils.h pidgin/plugins/perl/common/gtkmodule.h
diffstat 28 files changed, 134 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Thu Oct 30 21:16:17 2008 +0000
+++ b/configure.ac	Thu Oct 30 22:40:49 2008 +0000
@@ -1143,6 +1143,7 @@
 
 AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes)
 
+DEBUG_CFLAGS="$DEBUG_CFLAGS -DPURPLE_DISABLE_DEPRECATED -DPIDGIN_DISABLE_DEPRECATED -DFINCH_DISABLE_DEPRECATED -DGNT_DISABLE_DEPRECATED"
 if test "x$GCC" = "xyes"; then
 	dnl We enable -Wall later.
 	dnl If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
--- a/libpurple/account.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/account.c	Thu Oct 30 22:40:49 2008 +0000
@@ -1035,7 +1035,7 @@
 	purple_debug_info("account", "Registering account %s\n",
 					purple_account_get_username(account));
 
-	purple_connection_new(account, TRUE, purple_account_get_password(account));
+	_purple_connection_new(account, TRUE, purple_account_get_password(account));
 }
 
 void
@@ -1046,7 +1046,7 @@
 	purple_debug_info("account", "Unregistering account %s\n",
 					  purple_account_get_username(account));
 
-	purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data);
+	_purple_connection_new_unregister(account, purple_account_get_password(account), cb, user_data);
 }
 
 static void
@@ -1069,7 +1069,7 @@
 
 	purple_account_set_password(account, entry);
 
-	purple_connection_new(account, FALSE, entry);
+	_purple_connection_new(account, FALSE, entry);
 }
 
 static void
@@ -1155,7 +1155,7 @@
 		!(prpl_info->options & OPT_PROTO_PASSWORD_OPTIONAL))
 		purple_account_request_password(account, G_CALLBACK(request_password_ok_cb), G_CALLBACK(request_password_cancel_cb), account);
 	else
-		purple_connection_new(account, FALSE, password);
+		_purple_connection_new(account, FALSE, password);
 }
 
 void
@@ -1171,7 +1171,7 @@
 	account->disconnecting = TRUE;
 
 	gc = purple_account_get_connection(account);
-	purple_connection_destroy(gc);
+	_purple_connection_destroy(gc);
 	if (!purple_account_get_remember_password(account))
 		purple_account_set_password(account, NULL);
 	purple_account_set_connection(account, NULL);
--- a/libpurple/blist.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/blist.c	Thu Oct 30 22:40:49 2008 +0000
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
-#define PURPLE_BLIST_STRUCTS
+#define _PURPLE_BLIST_C_
 
 #include "internal.h"
 #include "blist.h"
@@ -447,7 +447,7 @@
 			purple_blist_get_last_child((PurpleBlistNode*)group));
 
 	if ((alias = xmlnode_get_attrib(cnode, "alias"))) {
-		purple_contact_set_alias(contact, alias);
+		purple_blist_alias_contact(contact, alias);
 	}
 
 	for (x = cnode->child; x; x = x->next) {
@@ -836,13 +836,11 @@
 		ops->update(purplebuddylist, node);
 }
 
-#ifndef PURPLE_DISABLE_DEPRECATED
 void
 purple_blist_update_buddy_icon(PurpleBuddy *buddy)
 {
 	purple_blist_update_node_icon((PurpleBlistNode *)buddy);
 }
-#endif
 
 /*
  * TODO: Maybe remove the call to this from server.c and call it
--- a/libpurple/blist.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/blist.h	Thu Oct 30 22:40:49 2008 +0000
@@ -89,7 +89,7 @@
 /* Data Structures                                                        */
 /**************************************************************************/
 
-#if !(defined PURPLE_HIDE_STRUCTS) || (defined PURPLE_BLIST_STRUCTS)
+#if !(defined PURPLE_HIDE_STRUCTS) || (defined _PURPLE_BLIST_C_)
 
 /**
  * A Buddy list node.  This can represent a group, a buddy, or anything else.
@@ -335,7 +335,7 @@
  */
 void purple_blist_update_node_icon(PurpleBlistNode *node);
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
 /**
  * Updates a buddy's icon.
  *
@@ -561,7 +561,7 @@
  */
 PurpleBuddy *purple_contact_get_priority_buddy(PurpleContact *contact);
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BLIST_C_)
 /**
  * Sets the alias for a contact.
  *
--- a/libpurple/buddyicon.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/buddyicon.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_BUDDYICON_C_
+
 #include "internal.h"
 #include "buddyicon.h"
 #include "conversation.h"
@@ -954,7 +956,6 @@
 	return purple_buddy_icons_node_set_custom_icon(node, data, len);
 }
 
-#ifndef PURPLE_DISABLE_DEPRECATED
 gboolean
 purple_buddy_icons_has_custom_icon(PurpleContact *contact)
 {
@@ -973,7 +974,6 @@
 {
 	return purple_buddy_icons_node_set_custom_icon((PurpleBlistNode*)contact, icon_data, icon_len);
 }
-#endif
 
 void
 _purple_buddy_icon_set_old_icons_dir(const char *dirname)
--- a/libpurple/buddyicon.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/buddyicon.h	Thu Oct 30 22:40:49 2008 +0000
@@ -337,7 +337,7 @@
 purple_buddy_icons_node_set_custom_icon_from_file(PurpleBlistNode *node,
                                                   const gchar *filename);
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_BUDDYICON_C_)
 /**
  * PurpleContact version of purple_buddy_icons_node_has_custom_icon.
  *
--- a/libpurple/connection.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/connection.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_CONNECTION_C_
+
 #include "internal.h"
 #include "account.h"
 #include "blist.h"
@@ -99,6 +101,12 @@
 void
 purple_connection_new(PurpleAccount *account, gboolean regist, const char *password)
 {
+	_purple_connection_new(account, regist, password);
+}
+
+void
+_purple_connection_new(PurpleAccount *account, gboolean regist, const char *password)
+{
 	PurpleConnection *gc;
 	PurplePlugin *prpl;
 	PurplePluginProtocolInfo *prpl_info;
@@ -170,9 +178,14 @@
 		prpl_info->login(account);
 	}
 }
+void
+purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data)
+{
+	_purple_connection_new_unregister(account, password, cb, user_data);
+}
 
 void
-purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data)
+_purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data)
 {
 	/* Lots of copy/pasted code to avoid API changes. You might want to integrate that into the previous function when posssible. */
 	PurpleConnection *gc;
@@ -230,6 +243,12 @@
 void
 purple_connection_destroy(PurpleConnection *gc)
 {
+	_purple_connection_destroy(gc);
+}
+
+void
+_purple_connection_destroy(PurpleConnection *gc)
+{
 	PurpleAccount *account;
 	GSList *buddies;
 	PurplePluginProtocolInfo *prpl_info = NULL;
--- a/libpurple/connection.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/connection.h	Thu Oct 30 22:40:49 2008 +0000
@@ -268,7 +268,7 @@
 /**************************************************************************/
 /*@{*/
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
 /**
  * This function should only be called by purple_account_connect()
  * in account.c.  If you're trying to sign on an account, use that
@@ -292,7 +292,7 @@
 									const char *password);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
 /**
  * This function should only be called by purple_account_unregister()
  * in account.c.
@@ -310,7 +310,7 @@
 void purple_connection_new_unregister(PurpleAccount *account, const char *password, PurpleAccountUnregistrationCb cb, void *user_data);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_CONNECTION_C_)
 /**
  * Disconnects and destroys a PurpleConnection.
  *
--- a/libpurple/dbus-server.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/dbus-server.c	Thu Oct 30 22:40:49 2008 +0000
@@ -29,6 +29,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+/* Allow the code below to see deprecated functions, so we can continue to
+ * export them via DBus. */
+#undef PURPLE_DISABLE_DEPRECATED
+
 #include "account.h"
 #include "blist.h"
 #include "conversation.h"
--- a/libpurple/internal.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/internal.h	Thu Oct 30 22:40:49 2008 +0000
@@ -231,6 +231,12 @@
 #define PURPLE_WEBSITE "http://pidgin.im/"
 #define PURPLE_DEVEL_WEBSITE "http://developer.pidgin.im/"
 
+
+/* INTERNAL FUNCTIONS */
+
+#include "account.h"
+#include "connection.h"
+
 /* This is for the accounts code to notify the buddy icon code that
  * it's done loading.  We may want to replace this with a signal. */
 void
@@ -247,4 +253,48 @@
 void
 _purple_buddy_icon_set_old_icons_dir(const char *dirname);
 
+/**
+ * Creates a connection to the specified account and either connects
+ * or attempts to register a new account.  If you are logging in,
+ * the connection uses the current active status for this account.
+ * So if you want to sign on as "away," for example, you need to
+ * have called purple_account_set_status(account, "away").
+ * (And this will call purple_account_connect() automatically).
+ *
+ * @note This function should only be called by purple_account_connect()
+ *       in account.c.  If you're trying to sign on an account, use that
+ *       function instead.
+ *
+ * @param account  The account the connection should be connecting to.
+ * @param regist   Whether we are registering a new account or just
+ *                 trying to do a normal signon.
+ * @param password The password to use.
+ */
+void _purple_connection_new(PurpleAccount *account, gboolean regist,
+                            const char *password);
+/**
+ * Tries to unregister the account on the server. If the account is not
+ * connected, also creates a new connection.
+ *
+ * @note This function should only be called by purple_account_unregister()
+ *       in account.c.
+ *
+ * @param account  The account to unregister
+ * @param password The password to use.
+ * @param cb Optional callback to be called when unregistration is complete
+ * @param user_data user data to pass to the callback
+ */
+void _purple_connection_new_unregister(PurpleAccount *account, const char *password,
+                                       PurpleAccountUnregistrationCb cb, void *user_data);
+/**
+ * Disconnects and destroys a PurpleConnection.
+ *
+ * @note This function should only be called by purple_account_disconnect()
+ *        in account.c.  If you're trying to sign off an account, use that
+ *        function instead.
+ *
+ * @param gc The purple connection to destroy.
+ */
+void _purple_connection_destroy(PurpleConnection *gc);
+
 #endif /* _PURPLE_INTERNAL_H_ */
--- a/libpurple/notify.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/notify.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_NOTIFY_C_
+
 #include "internal.h"
 #include "dbus-maybe.h"
 #include "notify.h"
--- a/libpurple/notify.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/notify.h	Thu Oct 30 22:40:49 2008 +0000
@@ -289,7 +289,7 @@
  */
 void purple_notify_searchresults_row_add(PurpleNotifySearchResults *results,
 									   GList *row);
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_)
 /**
  * Returns a number of the rows in the search results object.
  *
@@ -310,7 +310,7 @@
 guint purple_notify_searchresults_get_rows_count(PurpleNotifySearchResults *results);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_)
 /**
  * Returns a number of the columns in the search results object.
  *
@@ -331,7 +331,7 @@
 guint purple_notify_searchresults_get_columns_count(PurpleNotifySearchResults *results);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_)
 /**
  * Returns a row of the results from the search results object.
  *
@@ -354,7 +354,7 @@
 										 unsigned int row_id);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_)
 /**
  * Returns a title of the search results object's column.
  *
--- a/libpurple/plugin.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/plugin.c	Thu Oct 30 22:40:49 2008 +0000
@@ -19,6 +19,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_PLUGIN_C_
+
 #include "internal.h"
 
 #include "accountopt.h"
--- a/libpurple/plugin.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/plugin.h	Thu Oct 30 22:40:49 2008 +0000
@@ -533,7 +533,7 @@
  */
 gboolean purple_plugins_enabled(void);
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Registers a function that will be called when probing is finished.
  *
@@ -544,7 +544,7 @@
 void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Unregisters a function that would be called when probing is finished.
  *
@@ -554,7 +554,7 @@
 void purple_plugins_unregister_probe_notify_cb(void (*func)(void *));
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Registers a function that will be called when a plugin is loaded.
  *
@@ -566,7 +566,7 @@
 										  void *data);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Unregisters a function that would be called when a plugin is loaded.
  *
@@ -576,7 +576,7 @@
 void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *));
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Registers a function that will be called when a plugin is unloaded.
  *
@@ -588,7 +588,7 @@
 											void *data);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
 /**
  * Unregisters a function that would be called when a plugin is unloaded.
  *
--- a/libpurple/plugins/perl/common/BuddyList.xs	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/plugins/perl/common/BuddyList.xs	Thu Oct 30 22:40:49 2008 +0000
@@ -1,3 +1,4 @@
+#undef PURPLE_DISABLE_DEPRECATED
 #include "module.h"
 #include "../perl-handlers.h"
 
--- a/libpurple/plugins/perl/common/module.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/plugins/perl/common/module.h	Thu Oct 30 22:40:49 2008 +0000
@@ -1,4 +1,6 @@
-
+/* Allow the Perl code to see deprecated functions, so we can continue to
+ * export them to Perl plugins. */
+#undef PURPLE_DISABLE_DEPRECATED
 
 typedef struct group *Purple__Group;
 
--- a/libpurple/protocols/gg/gg.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/protocols/gg/gg.c	Thu Oct 30 22:40:49 2008 +0000
@@ -421,7 +421,7 @@
 	 */
 
 	/* Need to disconnect or actually log in. For now, we disconnect. */
-	purple_connection_destroy(gc);
+	purple_account_disconnect(account);
 
 exit_err:
 	if(account->registration_cb)
@@ -446,7 +446,7 @@
 	GGPInfo *info = gc->proto_data;
 	GGPToken *token = info->token;
 
-	purple_connection_destroy(gc);
+	purple_account_disconnect(gc->account);
 
 	g_free(token->id);
 	g_free(token->data);
--- a/libpurple/sslconn.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/sslconn.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_SSLCONN_C_
+
 #include "internal.h"
 
 #include "certificate.h"
--- a/libpurple/sslconn.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/libpurple/sslconn.h	Thu Oct 30 22:40:49 2008 +0000
@@ -185,7 +185,7 @@
 									PurpleSslErrorFunction error_func,
 									void *data);
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_SSLCONN_C_)
 /**
  * Makes a SSL connection using an already open file descriptor.
  *
--- a/pidgin/gtkconv.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkconv.c	Thu Oct 30 22:40:49 2008 +0000
@@ -24,6 +24,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
+#define _PIDGIN_GTKCONV_C_
+
 #include "internal.h"
 #include "pidgin.h"
 
--- a/pidgin/gtkconv.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkconv.h	Thu Oct 30 22:40:49 2008 +0000
@@ -143,7 +143,7 @@
 	GtkWidget *tab_label;
 	GtkWidget *menu_icon;
 	GtkWidget *menu_label;
-#ifndef PIDGIN_DISABLE_DEPRECATED
+#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKCONV_C_)
 	/** @deprecated */
 	GtkSizeGroup *sg;
 #else
--- a/pidgin/gtkdialogs.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkdialogs.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PIDGIN_GTKDIALOGS_C_
+
 #include "internal.h"
 #include "pidgin.h"
 
@@ -967,7 +969,7 @@
 static void
 pidgin_dialogs_alias_contact_cb(PurpleContact *contact, const char *new_alias)
 {
-	purple_contact_set_alias(contact, new_alias);
+	purple_blist_alias_contact(contact, new_alias);
 }
 
 void
--- a/pidgin/gtkdialogs.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkdialogs.h	Thu Oct 30 22:40:49 2008 +0000
@@ -38,11 +38,13 @@
 void pidgin_dialogs_info(void);
 void pidgin_dialogs_log(void);
 
+#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKDIALOGS_C_)
 /**
  * @deprecated This function is no longer used and will be removed in
  *             Pidgin 3.0.0 unless there is sufficient demand to keep it.
  */
 void pidgin_dialogs_alias_contact(PurpleContact *);
+#endif
 
 void pidgin_dialogs_alias_buddy(PurpleBuddy *);
 void pidgin_dialogs_alias_chat(PurpleChat *);
@@ -55,9 +57,12 @@
 /* Everything after this should probably be moved elsewhere */
 
 #ifndef PIDGIN_DISABLE_DEPRECATED
+/* This PIDGIN_DISABLE_DEPRECATED doesn't need to be deactivated by
+ * _PIDGIN_GTKDIALOGS_C_, because it shouldn't be using this macro. */
 #define PIDGIN_DIALOG(x)	x = gtk_window_new(GTK_WINDOW_TOPLEVEL); \
 			gtk_window_set_type_hint(GTK_WINDOW(x), GDK_WINDOW_TYPE_HINT_DIALOG)
 #endif
+
 #define PIDGIN_WINDOW_ICONIFIED(x) (gdk_window_get_state(GTK_WIDGET(x)->window) & GDK_WINDOW_STATE_ICONIFIED)
 
 #endif /* _PIDGINDIALOGS_H_ */
--- a/pidgin/gtkimhtml.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkimhtml.c	Thu Oct 30 22:40:49 2008 +0000
@@ -24,6 +24,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
+#define _PIDGIN_GTKIMHTML_C_
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
--- a/pidgin/gtkimhtml.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkimhtml.h	Thu Oct 30 22:40:49 2008 +0000
@@ -130,7 +130,7 @@
 		GtkTextTag *link;
 	} edit;
 
-#ifndef PIDGIN_DISABLE_DEPRECATED
+#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKIMHTML_C_)
 	/** @deprecated */
 	char *clipboard_text_string;
 	/** @deprecated */
--- a/pidgin/gtkutils.c	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkutils.c	Thu Oct 30 22:40:49 2008 +0000
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PIDGIN_GTKUTILS_C_
+
 #include "internal.h"
 #include "pidgin.h"
 
@@ -2878,7 +2880,6 @@
 }
 #endif /* ! Gtk 2.6.0 */
 
-#ifndef PURPLE_DISABLE_DEPRECATED
 void pidgin_set_custom_buddy_icon(PurpleAccount *account, const char *who, const char *filename)
 {
 	PurpleBuddy *buddy;
@@ -2893,7 +2894,6 @@
 	contact = purple_buddy_get_contact(buddy);
 	purple_buddy_icons_node_set_custom_icon_from_file((PurpleBlistNode*)contact, filename);
 }
-#endif
 
 char *pidgin_make_pretty_arrows(const char *str)
 {
--- a/pidgin/gtkutils.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/gtkutils.h	Thu Oct 30 22:40:49 2008 +0000
@@ -638,7 +638,7 @@
 											 GError **error);
 #endif
 
-#ifndef PURPLE_DISABLE_DEPRECATED
+#if !(defined PIDGIN_DISABLE_DEPRECATED) || (defined _PIDGIN_GTKUTILS_C_)
 /**
  * Set or unset a custom buddyicon for a user.
  *
--- a/pidgin/plugins/perl/common/gtkmodule.h	Thu Oct 30 21:16:17 2008 +0000
+++ b/pidgin/plugins/perl/common/gtkmodule.h	Thu Oct 30 22:40:49 2008 +0000
@@ -1,3 +1,7 @@
+/* Allow the Perl code to see deprecated functions, so we can continue to
+ * export them to Perl plugins. */
+#undef PIDGIN_DISABLE_DEPRECATED
+
 typedef struct group *Pidgin__Group;
 
 #define group perl_group