libpurple/account.h

branch
soc.2007.xmpp
changeset 19895
158490a51f8b
parent 19892
593a2e8407b3
child 19897
8b5abbdebc87
--- a/libpurple/account.h	Wed Sep 05 12:56:35 2007 +0000
+++ b/libpurple/account.h	Wed Sep 05 22:32:14 2007 +0000
@@ -36,6 +36,8 @@
 
 typedef gboolean (*PurpleFilterAccountFunc)(PurpleAccount *account);
 typedef void (*PurpleAccountRequestAuthorizationCb)(void *);
+typedef void (*PurpleAccountRegistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
+typedef void (*PurpleAccountUnregistrationCb)(PurpleAccount *account, gboolean succeeded, void *user_data);
 
 #include "connection.h"
 #include "log.h"
@@ -136,6 +138,8 @@
 	PurpleLog *system_log;        /**< The system log                         */
 
 	void *ui_data;              /**< The UI can put data here.              */
+	PurpleAccountRegistrationCb registration_cb;
+	void *registration_cb_user_data;
 };
 
 #ifdef __cplusplus
@@ -172,6 +176,15 @@
 void purple_account_connect(PurpleAccount *account);
 
 /**
+ * Sets the callback for successful registration.
+ *
+ * @param account	The account for which this callback should be used
+ * @param cb	The callback
+ * @param user_data	The user data passed to the callback
+ */
+void purple_account_set_register_callback(PurpleAccount *account, PurpleAccountRegistrationCb cb, void *user_data);
+
+/**
  * Registers an account.
  *
  * @param account The account to register.
@@ -179,6 +192,15 @@
 void purple_account_register(PurpleAccount *account);
 
 /**
+ * Unregisters an account (deleting it from the server).
+ *
+ * @param account The account to unregister.
+ * @param cb Optional callback to be called when unregistration is complete
+ * @param user_data user data to pass to the callback
+ */
+void purple_account_unregister(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
+
+/**
  * Disconnects from an account.
  *
  * @param account The account to disconnect from.

mercurial