# HG changeset patch
# Node ID 51eb6106de48
# Parent  a80230105e43
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -404,6 +404,10 @@
 		* PurpleGetPublicAliasFailureCallback
 		* purple_get_host_name. Use g_get_host_name, instead.
 		* purple_get_tzoff_str(). Use g_date_time_format, instead.
+		* PurpleIdleUiOps
+		* purple_idle_get_ui_ops
+		* purple_idle_set_ui_ops
+		* purple_idle_ui_ops_get_type
 		* purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
 		  purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
 		  or #GInetAddress instead.
@@ -806,6 +810,7 @@
 		* pidgin_dialog_get_vbox_with_properties
 		* pidgin_dialogs_alias_contact
 		* pidgin_dialogs_log
+		* pidgin_idle_get_ui_ops
 		* pidgin_make_mini_dialog_with_custom_icon; use
 		  pidgin_mini_dialog_new_with_custom_icon instead.
 		* pidgin_make_pretty_arrows
@@ -893,6 +898,7 @@
 		* gnt_ui_uninit renamed to finch_ui_uninit
 
 		Removed:
+		* finch_idle_get_ui_ops
 		* finch_pounce_editor_show
 		* finch_pounces_get_handle
 		* finch_pounces_init
diff --git a/finch/gntidle.h b/finch/gntidle.h
--- a/finch/gntidle.h
+++ b/finch/gntidle.h
@@ -1,9 +1,6 @@
 /*
- * finch
- *
- * Pidgin 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.
+ * Finch - Universal Text Chat Client
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
  *
  * 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
@@ -16,8 +13,7 @@
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #if !defined(FINCH_GLOBAL_HEADER_INSIDE) && !defined(FINCH_COMPILATION)
@@ -29,18 +25,27 @@
 
 #include <purple.h>
 
-/**************************************************************************/
-/* GNT Idle API                                                           */
-/**************************************************************************/
+/**
+ * FinchIdle:
+ *
+ * An implementation of [iface@Purple.IdleUi] for Finch.
+ *
+ * Since: 3.0.0
+ */
+
+#define FINCH_TYPE_IDLE (finch_idle_get_type())
+G_DECLARE_FINAL_TYPE(FinchIdle, finch_idle, FINCH, IDLE, GObject)
 
 /**
- * finch_idle_get_ui_ops:
+ * finch_idle_new:
  *
- * Returns the GNT idle UI ops.
+ * Creates a new [class@Idle].
  *
- * Returns: The UI operations structure.
+ * Returns: (transfer full): The new instance.
+ *
+ * Since: 3.0.0
  */
-PurpleIdleUiOps *finch_idle_get_ui_ops(void);
+PurpleIdleUi *finch_idle_new(void);
 
 #endif /* FINCH_IDLE_H */
 
diff --git a/finch/gntidle.c b/finch/gntidle.c
--- a/finch/gntidle.c
+++ b/finch/gntidle.c
@@ -1,9 +1,6 @@
 /*
- * finch
- *
- * Finch 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.
+ * Finch - Universal Text Chat Client
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
  *
  * 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
@@ -16,8 +13,7 @@
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <purple.h>
@@ -26,25 +22,49 @@
 
 #include "gntidle.h"
 
+struct _FinchIdle {
+    GObject parent;
+};
+
+/******************************************************************************
+ * PurpleIdleUi implementation
+ *****************************************************************************/
 static time_t
-finch_get_idle_time(void)
-{
+finch_idle_get_idle_time(PurpleIdleUi *ui) {
 	return gnt_wm_get_idle_time();
 }
 
-static PurpleIdleUiOps ui_ops =
-{
-	finch_get_idle_time,
+static void
+finch_idle_purple_idle_ui_init(PurpleIdleUiInterface *iface) {
+    iface->get_idle_time = finch_idle_get_idle_time;
+}
 
-	/* padding */
-	NULL,
-	NULL,
-	NULL,
-	NULL
-};
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+G_DEFINE_TYPE_EXTENDED(
+    FinchIdle,
+    finch_idle,
+    G_TYPE_OBJECT,
+    0,
+    G_IMPLEMENT_INTERFACE(
+        PURPLE_TYPE_IDLE_UI,
+        finch_idle_purple_idle_ui_init
+    )
+);
 
-PurpleIdleUiOps *
-finch_idle_get_ui_ops()
-{
-	return &ui_ops;
+static void
+finch_idle_init(FinchIdle *idle) {
+}
+
+static void
+finch_idle_class_init(FinchIdleClass *klass) {
 }
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+PurpleIdleUi *
+finch_idle_new(void) {
+    return g_object_new(FINCH_TYPE_IDLE, NULL);
+}
diff --git a/finch/libfinch.c b/finch/libfinch.c
--- a/finch/libfinch.c
+++ b/finch/libfinch.c
@@ -167,7 +167,7 @@
 	}
 
 	purple_core_set_ui_ops(gnt_core_get_ui_ops());
-	purple_idle_set_ui_ops(finch_idle_get_ui_ops());
+	purple_idle_set_ui(finch_idle_new());
 
 	if (!purple_core_init(FINCH_UI))
 	{
diff --git a/libpurple/idle.h b/libpurple/idle.h
--- a/libpurple/idle.h
+++ b/libpurple/idle.h
@@ -35,25 +35,7 @@
 #include <time.h>
 #include <glib-object.h>
 
-#define PURPLE_TYPE_IDLE_UI_OPS (purple_idle_ui_ops_get_type())
-
-typedef struct _PurpleIdleUiOps PurpleIdleUiOps;
-
-/**
- * PurpleIdleUiOps:
- *
- * Idle UI operations.
- */
-struct _PurpleIdleUiOps
-{
-	time_t (*get_time_idle)(void);
-
-	/*< private >*/
-	void (*_purple_reserved1)(void);
-	void (*_purple_reserved2)(void);
-	void (*_purple_reserved3)(void);
-	void (*_purple_reserved4)(void);
-};
+#include <purpleidleui.h>
 
 G_BEGIN_DECLS
 
@@ -84,28 +66,27 @@
 /**************************************************************************/
 
 /**
- * purple_idle_ui_ops_get_type:
+ * purple_idle_set_ui:
+ * @ui: An instance of [iface@IdleUi].
  *
- * Returns: The #GType for the #PurpleIdleUiOps boxed structure.
+ * Sets the user interface idle reporter. This function assumes ownership of
+ * @ui.
+ *
+ * Since: 3.0.0
  */
-GType purple_idle_ui_ops_get_type(void);
+void purple_idle_set_ui(PurpleIdleUi *ui);
 
 /**
- * purple_idle_set_ui_ops:
- * @ops: The UI operations structure.
+ * purple_idle_get_ui:
+ *
+ * Gets the current idle reporter.
  *
- * Sets the UI operations structure to be used for idle reporting.
+ * Returns: (transfer none): The [iface@IdleUi] that is currently in use or
+ *          %NULL if no idle reporter is available.
+ *
+ * Since: 3.0.0
  */
-void purple_idle_set_ui_ops(PurpleIdleUiOps *ops);
-
-/**
- * purple_idle_get_ui_ops:
- *
- * Returns the UI operations structure used for idle reporting.
- *
- * Returns: The UI operations structure in use.
- */
-PurpleIdleUiOps *purple_idle_get_ui_ops(void);
+PurpleIdleUi *purple_idle_get_ui(void);
 
 /**
  * purple_idle_init:
diff --git a/libpurple/idle.c b/libpurple/idle.c
--- a/libpurple/idle.c
+++ b/libpurple/idle.c
@@ -38,7 +38,7 @@
 
 } PurpleAutoAwayState;
 
-static PurpleIdleUiOps *idle_ui_ops = NULL;
+static PurpleIdleUi *idle_ui = NULL;
 
 /*
  * This is needed for the I'dle Mak'er plugin to work correctly.  We
@@ -120,48 +120,54 @@
 	gint away_seconds = 0;
 	gint idle_recheck_interval = 0;
 	gint idle_poll_seconds = purple_prefs_get_int("/purple/away/mins_before_away") * 60;
+	gboolean set = FALSE;
+
 	purple_signal_emit(purple_blist_get_handle(), "update-idle");
 
 	idle_reporting = purple_prefs_get_string("/purple/away/idle_reporting");
 	auto_away = purple_prefs_get_bool("/purple/away/away_when_idle");
 
 	if (purple_strequal(idle_reporting, "system") &&
-		(idle_ui_ops != NULL) && (idle_ui_ops->get_time_idle != NULL))
+		PURPLE_IS_IDLE_UI(idle_ui))
 	{
-		/* Use system idle time (mouse or keyboard movement, etc.) */
-		time_idle = idle_ui_ops->get_time_idle();
-		idle_recheck_interval = 1;
+		time_t new_idle = purple_idle_ui_get_idle_time(idle_ui);
+
+		if(new_idle > 0) {
+			/* Use system idle time (mouse or keyboard movement, etc.) */
+			time_idle = new_idle;
+			idle_recheck_interval = 1;
+			set = TRUE;
+		}
 	}
-	else if (purple_strequal(idle_reporting, "purple"))
-	{
+
+	if(!set && purple_strequal(idle_reporting, "purple")) {
 		/* Use 'Purple idle' */
 		time_idle = time(NULL) - last_active_time;
 		idle_recheck_interval = 0;
-	}
-	else
-	{
+	} else {
 		/* Don't report idle time */
 		report_idle = FALSE;
 
 		/* If we're not reporting idle, we can still do auto-away.
 		 * First try "system" and if that isn't possible, use "purple" */
-		if (auto_away)
-		{
-			if ((idle_ui_ops != NULL) && (idle_ui_ops->get_time_idle != NULL))
-			{
-				time_idle = idle_ui_ops->get_time_idle();
-				idle_recheck_interval = 1;
+		if(auto_away) {
+			if(PURPLE_IS_IDLE_UI(idle_ui)) {
+				time_t new_idle = purple_idle_ui_get_idle_time(idle_ui);
+
+				if(new_idle > 0) {
+					time_idle = new_idle;
+					idle_recheck_interval = 1;
+
+					set = TRUE;
+				}
 			}
-			else
-			{
+
+			if(!set) {
 				time_idle = time(NULL) - last_active_time;
 				idle_recheck_interval = 0;
 			}
-		}
-		else
-		{
-			if (!no_away)
-			{
+		} else {
+			if(!no_away) {
 				no_away = TRUE;
 				purple_savedstatus_set_idleaway(FALSE);
 			}
@@ -209,7 +215,6 @@
 	}
 }
 
-
 /*
  * Check idle and set the timer to fire at the next idle-worth event
  */
@@ -279,43 +284,15 @@
 	last_active_time = time;
 }
 
-static PurpleIdleUiOps *
-purple_idle_ui_ops_copy(PurpleIdleUiOps *ops)
-{
-	PurpleIdleUiOps *ops_new;
-
-	g_return_val_if_fail(ops != NULL, NULL);
-
-	ops_new = g_new(PurpleIdleUiOps, 1);
-	*ops_new = *ops;
-
-	return ops_new;
+void
+purple_idle_set_ui(PurpleIdleUi *ui) {
+	g_clear_object(&idle_ui);
+	idle_ui = ui;
 }
 
-GType
-purple_idle_ui_ops_get_type(void)
-{
-	static GType type = 0;
-
-	if (type == 0) {
-		type = g_boxed_type_register_static("PurpleIdleUiOps",
-				(GBoxedCopyFunc)purple_idle_ui_ops_copy,
-				(GBoxedFreeFunc)g_free);
-	}
-
-	return type;
-}
-
-void
-purple_idle_set_ui_ops(PurpleIdleUiOps *ops)
-{
-	idle_ui_ops = ops;
-}
-
-PurpleIdleUiOps *
-purple_idle_get_ui_ops(void)
-{
-	return idle_ui_ops;
+PurpleIdleUi *
+purple_idle_get_ui(void) {
+	return idle_ui;
 }
 
 static void *
@@ -371,4 +348,6 @@
 	if (idle_timer > 0)
 		g_source_remove(idle_timer);
 	idle_timer = 0;
+
+	g_clear_object(&idle_ui);
 }
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -55,6 +55,7 @@
 	'purpledebugui.c',
 	'purplehistoryadapter.c',
 	'purplehistorymanager.c',
+	'purpleidleui.c',
 	'purpleimconversation.c',
 	'purplekeyvaluepair.c',
 	'purplemarkup.c',
@@ -149,6 +150,7 @@
 	'purpledebugui.h',
 	'purplehistoryadapter.h',
 	'purplehistorymanager.h',
+	'purpleidleui.h',
 	'purpleimconversation.h',
 	'purpleattachment.h',
 	'purplekeyvaluepair.h',
diff --git a/libpurple/purpleidleui.h b/libpurple/purpleidleui.h
new file mode 100644
--- /dev/null
+++ b/libpurple/purpleidleui.h
@@ -0,0 +1,70 @@
+/*
+ * Purple - Internet Messaging Library
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * 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, see <https://www.gnu.org/licenses/>.
+ */
+
+#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
+# error "only <pidgin.h> may be included directly"
+#endif
+
+#ifndef PURPLE_IDLE_UI_H
+#define PURPLE_IDLE_UI_H
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include <time.h>
+
+G_BEGIN_DECLS
+
+#define PURPLE_TYPE_IDLE_UI (purple_idle_ui_get_type())
+G_DECLARE_INTERFACE(PurpleIdleUi, purple_idle_ui, PURPLE, IDLE_UI, GObject)
+
+/**
+ * PurpleIdleUiInterface:
+ * @get_idle_time: vfunc to get the time that the user interface has been idle.
+ *
+ * An interface that a user interface can implement to let the core determine
+ * idle times.
+ *
+ * Since: 3.0.0
+ */
+struct _PurpleIdleUiInterface {
+    /*< private >*/
+    GTypeInterface parent;
+
+    /*< public >*/
+    time_t (*get_idle_time)(PurpleIdleUi *ui);
+
+    /*< private >*/
+    gpointer reserved[4];
+};
+
+/**
+ * purple_idle_ui_get_idle_time:
+ * @ui: The idle ui instance.
+ *
+ * Gets the idle time from the user interface.
+ *
+ * Returns: The time that the user interface went idle.
+ *
+ * Since: 3.0.0
+ */
+time_t purple_idle_ui_get_idle_time(PurpleIdleUi *ui);
+
+G_END_DECLS
+
+#endif /* PURPLE_ID_UI_H */
diff --git a/libpurple/purpleidleui.c b/libpurple/purpleidleui.c
new file mode 100644
--- /dev/null
+++ b/libpurple/purpleidleui.c
@@ -0,0 +1,45 @@
+/*
+ * Purple - Internet Messaging Library
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
+ *
+ * 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, see <https://www.gnu.org/licenses/>.
+ */
+
+#include "purpleidleui.h"
+
+/******************************************************************************
+ * GInterface Implementation
+ *****************************************************************************/
+G_DEFINE_INTERFACE(PurpleIdleUi, purple_idle_ui, G_TYPE_INVALID)
+
+static void
+purple_idle_ui_default_init(PurpleIdleUiInterface *iface) {
+}
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+time_t
+purple_idle_ui_get_idle_time(PurpleIdleUi *ui) {
+    PurpleIdleUiInterface *iface = NULL;
+
+    g_return_val_if_fail(PURPLE_IS_IDLE_UI(ui), 0);
+
+    iface = PURPLE_IDLE_UI_GET_IFACE(ui);
+    if(iface != NULL && iface->get_idle_time != NULL) {
+        return iface->get_idle_time(ui);
+    }
+
+    return 0;
+}
diff --git a/pidgin/gtkidle.h b/pidgin/gtkidle.h
--- a/pidgin/gtkidle.h
+++ b/pidgin/gtkidle.h
@@ -1,8 +1,6 @@
-/* pidgin
- *
- * Pidgin 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.
+/*
+ * Pidgin - Universal Chat Client
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
  *
  * 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
@@ -15,34 +13,42 @@
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #if !defined(PIDGIN_GLOBAL_HEADER_INSIDE) && !defined(PIDGIN_COMPILATION)
 # error "only <pidgin.h> may be included directly"
 #endif
 
-#ifndef _PIDGIN_IDLE_H_
-#define _PIDGIN_IDLE_H_
+#ifndef PIDGIN_IDLE_H
+#define PIDGIN_IDLE_H
 
 #include <purple.h>
 
 G_BEGIN_DECLS
 
-/**************************************************************************/
-/* GTK Idle API                                                           */
-/**************************************************************************/
+/**
+ * PidginIdle:
+ *
+ * An implementation of [iface@Purple.IdleUi] for Pidgin.
+ *
+ * Since: 3.0.0
+ */
+
+#define PIDGIN_TYPE_IDLE (pidgin_idle_get_type())
+G_DECLARE_FINAL_TYPE(PidginIdle, pidgin_idle, PIDGIN, IDLE, GObject)
 
 /**
- * pidgin_idle_get_ui_ops:
+ * pidgin_idle_new:
  *
- * Returns the GTK idle UI ops.
+ * Creates a new [class@Idle].
  *
- * Returns: The UI operations structure.
+ * Returns: (transfer full): The new instance.
+ *
+ * Since: 3.0.0
  */
-PurpleIdleUiOps *pidgin_idle_get_ui_ops(void);
+PurpleIdleUi *pidgin_idle_new(void);
 
 G_END_DECLS
 
-#endif /* _PIDGIN_IDLE_H_ */
+#endif /* PIDGIN_IDLE_H */
diff --git a/pidgin/gtkidle.c b/pidgin/gtkidle.c
--- a/pidgin/gtkidle.c
+++ b/pidgin/gtkidle.c
@@ -1,9 +1,6 @@
 /*
- * pidgin
- *
- * Pidgin 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.
+ * Pidgin - Universal Chat Client
+ * Copyright (C) Pidgin Developers <devel@pidgin.im>
  *
  * 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
@@ -16,9 +13,7 @@
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
- *
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -46,6 +41,10 @@
 
 #include <purple.h>
 
+struct _PidginIdle {
+	GObject parent;
+};
+
 #if !defined(HAVE_IOKIT) && !defined(_WIN32)
 typedef struct {
 	gchar *bus_name;
@@ -70,6 +69,10 @@
 };
 #endif /* !HAVE_IOKIT && !_WIN32 */
 
+/******************************************************************************
+ * PurpleIdleUI Implementation
+ *****************************************************************************/
+
 /*
  * pidgin_get_time_idle:
  *
@@ -83,8 +86,7 @@
  * Returns: The number of seconds the user has been idle.
  */
 static time_t
-pidgin_get_time_idle(void)
-{
+pidgin_idle_get_idle_time(PurpleIdleUi *ui) {
 # ifdef HAVE_IOKIT
 	/* Query the IOKit API */
 	double idleSeconds = -1;
@@ -190,17 +192,37 @@
 # endif /* !HAVE_IOKIT */
 }
 
-static PurpleIdleUiOps ui_ops =
-{
-	pidgin_get_time_idle,
-	NULL,
-	NULL,
-	NULL,
-	NULL
-};
+static void
+pidgin_idle_purple_ui_init(PurpleIdleUiInterface *iface) {
+	iface->get_idle_time = pidgin_idle_get_idle_time;
+}
 
-PurpleIdleUiOps *
-pidgin_idle_get_ui_ops()
-{
-	return &ui_ops;
+/******************************************************************************
+ * GObject Implementation
+ *****************************************************************************/
+G_DEFINE_TYPE_EXTENDED(
+	PidginIdle,
+	pidgin_idle,
+	G_TYPE_OBJECT,
+	0,
+	G_IMPLEMENT_INTERFACE(
+		PURPLE_TYPE_IDLE_UI,
+		pidgin_idle_purple_ui_init
+	)
+);
+
+static void
+pidgin_idle_init(PidginIdle *idle) {
 }
+
+static void
+pidgin_idle_class_init(PidginIdleClass *klass) {
+}
+
+/******************************************************************************
+ * Public API
+ *****************************************************************************/
+PurpleIdleUi *
+pidgin_idle_new(void) {
+	return g_object_new(PIDGIN_TYPE_IDLE, NULL);
+}
diff --git a/pidgin/libpidgin.c b/pidgin/libpidgin.c
--- a/pidgin/libpidgin.c
+++ b/pidgin/libpidgin.c
@@ -262,7 +262,7 @@
 	purple_request_set_ui_ops(pidgin_request_get_ui_ops());
 	purple_connections_set_ui_ops(pidgin_connections_get_ui_ops());
 	purple_whiteboard_set_ui_ops(pidgin_whiteboard_get_ui_ops());
-	purple_idle_set_ui_ops(pidgin_idle_get_ui_ops());
+	purple_idle_set_ui(pidgin_idle_new());
 
 	pidgin_accounts_init();
 	pidgin_connection_init();
diff --git a/po/POTFILES.in b/po/POTFILES.in
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -248,6 +248,7 @@
 libpurple/purple-gio.c
 libpurple/purplehistoryadapter.c
 libpurple/purplehistorymanager.c
+libpurple/purpleidleui.c
 libpurple/purpleimconversation.c
 libpurple/purplekeyvaluepair.c
 libpurple/purplemarkup.c
