pidgin: 27d469c9: Add a function for prompting about a cer...

qulogic at pidgin.im qulogic at pidgin.im
Mon Feb 27 18:11:48 EST 2012


----------------------------------------------------------------------
Revision: 27d469c9facde5032c8b2cf99ea2efc1963342e1
Parent:   c05da2a6c225b797e95e3231d5c6628fc9eb32e5
Author:   qulogic at pidgin.im
Date:     02/25/12 23:37:10
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/27d469c9facde5032c8b2cf99ea2efc1963342e1

Changelog: 

Add a function for prompting about a certificate. This is basically
a small wrapper around the request field API.

Changes against parent c05da2a6c225b797e95e3231d5c6628fc9eb32e5

  patched  ChangeLog.API
  patched  libpurple/request.c
  patched  libpurple/request.h

-------------- next part --------------
============================================================
--- libpurple/request.c	551f66771a9a00291a9822347095b9c490d73cc4
+++ libpurple/request.c	be1f4184caffba042a3dc1e280d0d7902db078b3
@@ -1666,6 +1666,29 @@ purple_request_folder(void *handle, cons
 	return NULL;
 }
 
+void *
+purple_request_certificate(void *handle, const char *title,
+                                  const char *primary, const char *secondary,
+                                  PurpleCertificate *cert,
+                                  const char *ok_text, GCallback ok_cb,
+                                  const char *cancel_text, GCallback cancel_cb,
+                                  void *user_data)
+{
+	PurpleRequestFields *fields;
+	PurpleRequestFieldGroup *group;
+	PurpleRequestField *field;
+
+	fields = purple_request_fields_new();
+	group = purple_request_field_group_new(NULL);
+	purple_request_fields_add_group(fields, group);
+	field = purple_request_field_certificate_new("certificate", "Certificate", cert);
+	purple_request_field_group_add_field(group, field);
+
+	return purple_request_fields(handle, title, primary, secondary, fields,
+	                             ok_text, ok_cb, cancel_text, cancel_cb,
+	                             NULL, NULL, NULL, user_data);
+}
+
 static void
 purple_request_close_info(PurpleRequestInfo *info)
 {
============================================================
--- libpurple/request.h	1c782c4b021cb66bd16561508bbc45fa25c16de8
+++ libpurple/request.h	93a60e13a8448a70aa0590dbd7d5d7448c11e3cd
@@ -1531,6 +1531,37 @@ void *purple_request_folder(void *handle
 	PurpleAccount *account, const char *who, PurpleConversation *conv,
 	void *user_data);
 
+/**
+ * Prompts the user for action over a certificate.
+ *
+ * This is often represented as a dialog with a button for each action.
+ *
+ * @param handle        The plugin or connection handle.  For some things this
+ *                      is <em>extremely</em> important.  See the comments on
+ *                      purple_request_input().
+ * @param title         The title of the message, or @c NULL if it should have
+ *                      no title.
+ * @param primary       The main point of the message, or @c NULL if you're
+ *                      feeling enigmatic.
+ * @param secondary     Secondary information, or @c NULL if there is none.
+ * @param cert          The #PurpleCertificate associated with this request.
+ * @param ok_text       The text for the @c OK button, which may not be @c NULL.
+ * @param ok_cb         The callback for the @c OK button, which may not be
+ *                      @c NULL.
+ * @param cancel_text   The text for the @c Cancel button, which may not be
+ *                      @c NULL.
+ * @param cancel_cb     The callback for the @c Cancel button, which may be
+ *                      @c NULL.
+ * @param user_data     The data to pass to the callback.
+ *
+ * @return A UI-specific handle.
+ */
+void *purple_request_certificate(void *handle, const char *title,
+	const char *primary, const char *secondary, PurpleCertificate *cert,
+	const char *ok_text, GCallback ok_cb,
+	const char *cancel_text, GCallback cancel_cb,
+	void *user_data);
+
 /*@}*/
 
 /**************************************************************************/
============================================================
--- ChangeLog.API	a6c8b3380e958b5b0ffc3b5d4e57655fcc88157d
+++ ChangeLog.API	5d0ac3dc93b70eba41df86c9183e0adbf557b4fe
@@ -34,6 +34,7 @@ version 3.0.0 (??/??/????):
 		* purple_menu_action_set_data
 		* purple_menu_action_set_callback
 		* purple_menu_action_set_children
+		* purple_request_certificate
 		* purple_request_field_certificate_new
 		* purple_request_field_certificate_get_value
 		* purple_request_field_get_tooltip


More information about the Commits mailing list