--- a/libpurple/protocols/facebook/data.c Sun Mar 13 22:06:00 2022 -0500
+++ b/libpurple/protocols/facebook/data.c Sun Mar 13 22:06:00 2022 -0500
@@ -288,21 +288,16 @@
-fb_data_add_timeout(FbData *fata, const gchar *name, guint interval,
- GSourceFunc func, gpointer data)
+fb_data_save_timeout(FbData *fata, const gchar *name, guint id)
g_return_if_fail(FB_IS_DATA(fata));
fb_data_clear_timeout(fata, name, TRUE);
- id = g_timeout_add_seconds(interval, func, data);
- g_hash_table_replace(priv->evs, key, GUINT_TO_POINTER(id));
+ g_hash_table_replace(priv->evs, g_strdup(name), GUINT_TO_POINTER(id)); --- a/libpurple/protocols/facebook/data.h Sun Mar 13 22:06:00 2022 -0500
+++ b/libpurple/protocols/facebook/data.h Sun Mar 13 22:06:00 2022 -0500
@@ -93,20 +93,18 @@
fb_data_save(FbData *fata);
+ * fb_data_save_timeout: * @name: The name of the timeout.
- * @interval: The time, in seconds, between calls to @func.
- * @func: The #GSourceFunc.
- * @data: The data passed to @func.
+ * @id: The source id of the timeout. - * Adds a new callback timer. The callback is called repeatedly on the
- * basis of @interval, until @func returns #FALSE. The timeout should
- * be cleared with #fb_data_clear_timeout() when no longer needed.
+ * Saves a new callback timer. The callback should be added to the main loop + * with `g_timeout_add` or similar, and the returned source identifier passed + * to this function. The timeout should be cleared with + * #fb_data_clear_timeout() when no longer needed. -fb_data_add_timeout(FbData *fata, const gchar *name, guint interval,
- GSourceFunc func, gpointer data);
+fb_data_save_timeout(FbData *fata, const gchar *name, guint id); --- a/libpurple/protocols/facebook/facebook.c Sun Mar 13 22:06:00 2022 -0500
+++ b/libpurple/protocols/facebook/facebook.c Sun Mar 13 22:06:00 2022 -0500
@@ -213,8 +213,8 @@
- fb_data_add_timeout(fata, "sync-contacts", sync, fb_cb_sync_contacts,
+ fb_data_save_timeout(fata, "sync-contacts", + g_timeout_add_seconds(sync, fb_cb_sync_contacts, fata)); @@ -889,7 +889,8 @@
/* Use event loop for purple_conversation_has_focus() */
name = purple_conversation_get_name(conv);
tname = g_strconcat("conv-read-", name, NULL);
- fb_data_add_timeout(fata, tname, 0, fb_cb_conv_read, conv);
+ fb_data_save_timeout(fata, tname, + g_timeout_add_seconds(0, fb_cb_conv_read, conv));