# HG changeset patch
# Node ID 348c54b8419c
# Parent  954ee1c27d5c
diff --git a/libpurple/protocols/facebook/api.h b/libpurple/protocols/facebook/api.h
--- a/libpurple/protocols/facebook/api.h
+++ b/libpurple/protocols/facebook/api.h
@@ -699,7 +699,7 @@ fb_api_thread(FbApi *api, FbId tid);
 /**
  * fb_api_thread_create:
  * @api: The #FbApi.
- * @uids: The #GSList of #FbId's.
+ * @uids: (element-type FbId): The #GSList of #FbId's.
  *
  * Sends a thread creation request. In order to create a thread, there
  * must be at least two other users in @uids.
diff --git a/libpurple/protocols/facebook/data.h b/libpurple/protocols/facebook/data.h
--- a/libpurple/protocols/facebook/data.h
+++ b/libpurple/protocols/facebook/data.h
@@ -93,20 +93,18 @@ void
 fb_data_save(FbData *fata);
 
 /**
- * fb_data_add_timeout:
+ * fb_data_save_timeout:
  * @fata: The #FbData.
  * @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.
  */
 void
-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);
 
 /**
  * fb_data_clear_timeout:
@@ -127,7 +125,7 @@ fb_data_clear_timeout(FbData *fata, cons
  *
  * Gets the #FbApi from the #FbData.
  *
- * Return: The #FbApi.
+ * Return: (transfer none): The #FbApi.
  */
 FbApi *
 fb_data_get_api(FbData *fata);
@@ -138,7 +136,7 @@ fb_data_get_api(FbData *fata);
  *
  * Gets the #PurpleConnection from the #FbData.
  *
- * Return: The #PurpleConnection.
+ * Return: (transfer none): The #PurpleConnection.
  */
 PurpleConnection *
 fb_data_get_connection(FbData *fata);
@@ -149,7 +147,7 @@ fb_data_get_connection(FbData *fata);
  *
  * Gets the #PurpleRoomlist from the #FbData.
  *
- * Return: The #PurpleRoomlist.
+ * Return: (transfer none): The #PurpleRoomlist.
  */
 PurpleRoomlist *
 fb_data_get_roomlist(FbData *fata);
@@ -213,9 +211,10 @@ fb_data_remove_message(FbData *fata, FbA
  * @uid: The user #FbId.
  *
  * Gets a #GSList of messages by the user #FbId from the #FbData. The
- * #FbApiMessage's are removed from the #FbData. The returned #GSList
- * and its #FbApiMessage's should be freed with #fb_api_message_free()
- * and #g_slist_free_full() when no longer needed.
+ * #FbApiMessage's are removed from the #FbData.
+ *
+ * Returns: (element-type FbApiMessage) (transfer full): The messages from the
+ *          user.
  */
 GSList *
 fb_data_take_messages(FbData *fata, FbId uid);
@@ -232,7 +231,7 @@ fb_data_take_messages(FbData *fata, FbId
  * from HTTP sources. After calling this, #fb_data_image_queue() should
  * be called to queue the fetching process.
  *
- * Return: The #FbDataImage.
+ * Return: (transfer none): The #FbDataImage.
  */
 FbDataImage *
 fb_data_image_add(FbData *fata, const gchar *url, FbDataImageFunc func,
@@ -266,7 +265,7 @@ fb_data_image_get_data(FbDataImage *img)
  *
  * Gets the #FbData from the #FbDataImage.
  *
- * Returns: The #FbData.
+ * Returns: (transfer none): The #FbData.
  */
 FbData *
 fb_data_image_get_fata(FbDataImage *img);
diff --git a/libpurple/protocols/facebook/data.c b/libpurple/protocols/facebook/data.c
--- a/libpurple/protocols/facebook/data.c
+++ b/libpurple/protocols/facebook/data.c
@@ -288,21 +288,16 @@ fb_data_save(FbData *fata)
 }
 
 void
-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)
 {
 	FbDataPrivate *priv;
-	gchar *key;
-	guint id;
 
 	g_return_if_fail(FB_IS_DATA(fata));
 	priv = fata->priv;
 
 	fb_data_clear_timeout(fata, name, TRUE);
 
-	key = g_strdup(name);
-	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));
 }
 
 void
diff --git a/libpurple/protocols/facebook/facebook.c b/libpurple/protocols/facebook/facebook.c
--- a/libpurple/protocols/facebook/facebook.c
+++ b/libpurple/protocols/facebook/facebook.c
@@ -213,8 +213,8 @@ fb_sync_contacts_add_timeout(FbData *fat
 	}
 
 	sync *= 60;
-	fb_data_add_timeout(fata, "sync-contacts", sync, fb_cb_sync_contacts,
-	                    fata);
+	fb_data_save_timeout(fata, "sync-contacts",
+	                     g_timeout_add_seconds(sync, fb_cb_sync_contacts, fata));
 }
 
 static void
@@ -889,7 +889,8 @@ fb_cb_conv_updated(PurpleConversation *c
 		/* 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));
 		g_free(tname);
 	}
 }
diff --git a/libpurple/protocols/facebook/http.h b/libpurple/protocols/facebook/http.h
--- a/libpurple/protocols/facebook/http.h
+++ b/libpurple/protocols/facebook/http.h
@@ -82,7 +82,7 @@ gboolean fb_http_error_chk(SoupMessage *
  * instead of freeing, the returned #FbHttpParams can be closed with
  * #fb_http_params_close().
  *
- * Returns: The new #FbHttpParams.
+ * Returns: (transfer full): The new #FbHttpParams.
  */
 FbHttpParams *
 fb_http_params_new(void);
@@ -98,7 +98,7 @@ fb_http_params_new(void);
  * instead of freeing, the returned #FbHttpParams can be closed with
  * #fb_http_params_close().
  *
- * Returns: The new #FbHttpParams.
+ * Returns: (transfer full): The new #FbHttpParams.
  */
 FbHttpParams *
 fb_http_params_new_parse(const gchar *data, gboolean isurl);
diff --git a/libpurple/protocols/facebook/json.h b/libpurple/protocols/facebook/json.h
--- a/libpurple/protocols/facebook/json.h
+++ b/libpurple/protocols/facebook/json.h
@@ -97,7 +97,7 @@ fb_json_error_quark(void);
  * freeing, the returned #JsonBuilder can be closed with
  * #fb_json_bldr_close().
  *
- * Returns: The new #JsonBuilder.
+ * Returns: (transfer full): The new #JsonBuilder.
  */
 JsonBuilder *
 fb_json_bldr_new(JsonNodeType type);
diff --git a/libpurple/protocols/facebook/meson.build b/libpurple/protocols/facebook/meson.build
--- a/libpurple/protocols/facebook/meson.build
+++ b/libpurple/protocols/facebook/meson.build
@@ -41,7 +41,7 @@ if DYNAMIC_FACEBOOK
 	if enable_introspection
 		introspection_sources = FACEBOOK_SOURCES
 
-		facebook_gir_includes = ['GObject-2.0', 'Gio-2.0', 'Gst-1.0', 'Json-1.0', libpurple_gir[0]]
+		facebook_gir_includes = ['GObject-2.0', 'Gio-2.0', 'Gst-1.0', 'Json-1.0', 'Soup-2.4', libpurple_gir[0]]
 
 		facebook_gir = gnome.generate_gir(facebook_prpl,
 		    sources : introspection_sources,
diff --git a/libpurple/protocols/facebook/thrift.h b/libpurple/protocols/facebook/thrift.h
--- a/libpurple/protocols/facebook/thrift.h
+++ b/libpurple/protocols/facebook/thrift.h
@@ -112,8 +112,6 @@ fb_thrift_get_pos(FbThrift *thft);
  * @pos: The position.
  *
  * Sets the cursor position of an #FbThrift.
- *
- * Returns: The #GByteArray.
  */
 void
 fb_thrift_set_pos(FbThrift *thft, guint pos);
@@ -123,8 +121,6 @@ fb_thrift_set_pos(FbThrift *thft, guint 
  * @thft: The #FbThrift.
  *
  * Resets the cursor position of an #FbThrift.
- *
- * Returns: The #GByteArray.
  */
 void
 fb_thrift_reset(FbThrift *thft);
diff --git a/libpurple/protocols/facebook/util.h b/libpurple/protocols/facebook/util.h
--- a/libpurple/protocols/facebook/util.h
+++ b/libpurple/protocols/facebook/util.h
@@ -99,7 +99,7 @@ fb_util_error_quark(void);
  *
  * Finds a buddy by their name or alias.
  *
- * Returns: The #PurpleBuddy if found, otherwise #NULL.
+ * Returns: (transfer none): The #PurpleBuddy if found, otherwise #NULL.
  */
 PurpleBuddy *
 fb_util_account_find_buddy(PurpleAccount *acct, PurpleChatConversation *chat,
@@ -230,10 +230,10 @@ fb_util_rand_alnum(guint len);
  * @title: The title of the message or #NULL.
  * @primary: The main point of the message or #NULL.
  * @secondary: The secondary information or #NULL.
- * @select: A #GSList of selected buddies or #NULL.
+ * @select: (element-type PurpleBuddy): A #GSList of selected buddies or #NULL.
  * @multi: #TRUE to for multiple buddy selections, otherwise #FALSE.
- * @ok_cb: The callback for the `OK` button or #NULL.
- * @cancel_cb: The callback for the `Cancel` button or #NULL.
+ * @ok_cb: (scope async): The callback for the `OK` button or #NULL.
+ * @cancel_cb: (scope async): The callback for the `Cancel` button or #NULL.
  * @data: The user-defined data.
  *
  * Displays a buddy list selection form.
@@ -314,7 +314,7 @@ fb_util_zlib_test(const GByteArray *byte
  * Deflates a #GByteArray with zlib. The returned #GByteArray should be
  * freed with #g_byte_array_free() when no longer needed.
  *
- * Returns: The deflated #GByteArray or #NULL on error.
+ * Returns: (transfer full): The deflated #GByteArray or #NULL on error.
  */
 GByteArray *
 fb_util_zlib_deflate(const GByteArray *bytes, GError **error);
@@ -327,7 +327,7 @@ fb_util_zlib_deflate(const GByteArray *b
  * Inflates a #GByteArray with zlib. The returned #GByteArray should be
  * freed with #g_byte_array_free() when no longer needed.
  *
- * Returns: The inflated #GByteArray or #NULL on error.
+ * Returns: (transfer full): The inflated #GByteArray or #NULL on error.
  */
 GByteArray *
 fb_util_zlib_inflate(const GByteArray *bytes, GError **error);
