Merged in CMaiku/pidgin (pull request #112)

Thu, 01 Sep 2016 23:08:43 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 01 Sep 2016 23:08:43 -0500
changeset 37974
b7ecc46eaff8
parent 37970
5f9bb0cf3f77 (current diff)
parent 37973
c9a2d2176444 (diff)
child 37977
2cc052ab7505

Merged in CMaiku/pidgin (pull request #112)

Fix some GI annotation warnings

--- a/libpurple/Makefile.am	Thu Sep 01 11:18:33 2016 -0500
+++ b/libpurple/Makefile.am	Thu Sep 01 23:08:43 2016 -0500
@@ -503,7 +503,7 @@
 	$(addprefix media/, $(purple_mediaheaders))
 
 Purple-$(PURPLE_MAJOR_VERSION).$(PURPLE_MINOR_VERSION).gir: $(builddir)/libpurple.la
-Purple_3_0_gir_INCLUDES = GObject-2.0
+Purple_3_0_gir_INCLUDES = Gio-2.0 GObject-2.0
 if PLUGINS
 Purple_3_0_gir_INCLUDES += GPlugin-0.0
 endif
--- a/libpurple/purple-gio.h	Thu Sep 01 11:18:33 2016 -0500
+++ b/libpurple/purple-gio.h	Thu Sep 01 23:08:43 2016 -0500
@@ -44,8 +44,8 @@
 /**
  * purple_gio_graceful_close:
  * @stream: A #GIOStream to close
- * @input: (optional): A #GInputStream which wraps @stream's input stream
- * @output: (optional): A #GOutputStream which wraps @stream's output stream
+ * @input: (nullable): A #GInputStream which wraps @stream's input stream
+ * @output: (nullable): A #GOutputStream which wraps @stream's output stream
  *
  * Closes @input, @output, @stream. If there are pending operations, it
  * asynchronously waits for the operations to finish before closing the
@@ -64,7 +64,7 @@
  * A helper function to simplify creating a #GSocketClient. It's intended
  * to be used in protocol plugins.
  *
- * Returns: A new #GSocketClient with the appropriate
+ * Returns: (transfer full): A new #GSocketClient with the appropriate
  * GProxyResolver, based on the #PurpleAccount settings and
  * TLS Certificate handling, or NULL if an error occurred.
  */
--- a/libpurple/tls-certificate-info.c	Thu Sep 01 11:18:33 2016 -0500
+++ b/libpurple/tls-certificate-info.c	Thu Sep 01 23:08:43 2016 -0500
@@ -222,6 +222,19 @@
 	gchar *value;
 } DerOIDValue;
 
+static DerOIDValue *
+der_oid_value_copy(DerOIDValue *data)
+{
+	DerOIDValue *ret;
+
+	g_return_val_if_fail(data != NULL, NULL);
+
+	ret = g_new0(DerOIDValue, 1);
+	ret->oid = g_strdup(data->oid);
+	ret->value = g_strdup(data->value);
+	return ret;
+}
+
 static void
 der_oid_value_free(DerOIDValue *data)
 {
@@ -603,6 +616,24 @@
 	return info;
 }
 
+static PurpleTlsCertificateInfo *
+purple_tls_certificate_info_copy(PurpleTlsCertificateInfo *info)
+{
+	PurpleTlsCertificateInfo *ret;
+
+	g_return_val_if_fail(info != NULL, NULL);
+
+	ret = g_new0(PurpleTlsCertificateInfo, 1);
+	ret->issuer = g_slist_copy_deep(info->issuer,
+			(GCopyFunc)der_oid_value_copy, NULL);
+	ret->notBefore = g_date_time_ref(info->notBefore);
+	ret->notAfter = g_date_time_ref(info->notAfter);
+	ret->subject = g_slist_copy_deep(info->subject,
+			(GCopyFunc)der_oid_value_copy, NULL);
+
+	return ret;
+}
+
 void
 purple_tls_certificate_info_free(PurpleTlsCertificateInfo *info)
 {
@@ -618,6 +649,10 @@
 	g_free(info);
 }
 
+G_DEFINE_BOXED_TYPE(PurpleTlsCertificateInfo, purple_tls_certificate_info,
+		purple_tls_certificate_info_copy,
+		purple_tls_certificate_info_free);
+
 /* Looks up the relative distinguished name (RDN) from an ObjectID */
 static const gchar *
 lookup_rdn_name_by_oid(const gchar *oid)
--- a/libpurple/tls-certificate-info.h	Thu Sep 01 11:18:33 2016 -0500
+++ b/libpurple/tls-certificate-info.h	Thu Sep 01 23:08:43 2016 -0500
@@ -46,6 +46,16 @@
  */
 typedef struct _PurpleTlsCertificateInfo PurpleTlsCertificateInfo;
 
+#define PURPLE_TYPE_TLS_CERTIFICATE_INFO \
+		(purple_tls_certificate_info_get_type())
+
+/**
+ * purple_tls_certificate_info_get_type:
+ *
+ * Returns: The #GType for the #PurpleTlsCertificateInfo boxed structure.
+ */
+GType purple_tls_certificate_info_get_type(void);
+
 /**
  * purple_tls_certificate_get_info:
  * @certificate: Certificate from which to parse the info
@@ -95,7 +105,7 @@
  *
  * Returns the SHA1 fingerprint of the cert
  *
- * Returns: The SHA1 fingerprint of the cert
+ * Returns: (transfer full): The SHA1 fingerprint of the cert
  */
 GByteArray *
 purple_tls_certificate_get_fingerprint_sha1(GTlsCertificate *certificate);
--- a/libpurple/tls-certificate.h	Thu Sep 01 11:18:33 2016 -0500
+++ b/libpurple/tls-certificate.h	Thu Sep 01 23:08:43 2016 -0500
@@ -45,7 +45,7 @@
  * purple_tls_certificate_trust() and friends. These IDs can then be passed
  * to purple_certificate_path() or used directly, if desired.
  *
- * Returns: (element-type utf8): The #GList of IDs described above
+ * Returns: (transfer full) (element-type utf8): #GList of IDs described above
  *          Free with purple_certificate_free_ids()
  */
 GList *
@@ -53,7 +53,8 @@
 
 /**
  * purple_tls_certificate_free_ids:
- * @ids: List of ids retrieved from purple_certificate_list_ids()
+ * @ids: (transfer full) (element-type utf8): List of ids retrieved from
+ *       purple_certificate_list_ids()
  *
  * Frees the list of IDs returned from purple_certificate_list_ids().
  */
@@ -66,6 +67,8 @@
  * @error: A GError location to store the error occurring, or NULL to ignore
  *
  * Loads the certificate referenced by ID into a #GTlsCertificate object.
+ *
+ * Returns: (transfer full): #GTlsCertificate loaded from ID
  */
 GTlsCertificate *
 purple_tls_certificate_new_from_id(const gchar *id, GError **error);
@@ -106,7 +109,7 @@
  * Connects the Purple TLS certificate subsystem to @conn so it will accept
  * certificates trusted by purple_tls_certificate_trust() and friends.
  *
- * Returns: (transfer: none) (type GObject.Object): @conn, similar to
+ * Returns: (transfer none) (type GObject.Object): @conn, similar to
  *          g_object_connect()
  */
 gpointer
@@ -120,7 +123,7 @@
  * connections it creates will accept certificates trusted by
  * purple_tls_certificate_trust() and friends.
  *
- * Returns: (transfer: none) (type GObject.Object): @client, similar to
+ * Returns: (transfer none) (type GObject.Object): @client, similar to
  *          g_object_connect()
  */
 gpointer

mercurial