summaryrefslogtreecommitdiff
path: root/libpurple/account.h
diff options
context:
space:
mode:
authorWill Thompson <resiak@pidgin.im>2007-10-27 17:26:17 +0000
committerWill Thompson <resiak@pidgin.im>2007-10-27 17:26:17 +0000
commite7ba6c7c9248d82bdaac959c4b9fe21b0c438c30 (patch)
treeaf66fce4c0fc7a949fb950b739bfda2ca030ba4d /libpurple/account.h
parent9ab7ba038be4f870f6c044d1cd6cd4066b9f0ee0 (diff)
downloadpidgin-e7ba6c7c9248d82bdaac959c4b9fe21b0c438c30.tar.gz
Make PurpleAccount keep track of the last connection error suffered (or not, if
the account is happily connected or is disconnected without error). Add a signal which fires when the current error changes, and an accessor to get the current error. The error itself is stored inside a private struct.
Diffstat (limited to 'libpurple/account.h')
-rw-r--r--libpurple/account.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libpurple/account.h b/libpurple/account.h
index 0bd4d79d00..32ebcefc63 100644
--- a/libpurple/account.h
+++ b/libpurple/account.h
@@ -140,8 +140,19 @@ struct _PurpleAccount
void *ui_data; /**< The UI can put data here. */
PurpleAccountRegistrationCb registration_cb;
void *registration_cb_user_data;
+
+ gpointer priv; /**< Pointer to opaque private data. */
};
+/** The error most recently encountered on an account. */
+typedef struct
+{
+ /** The type of error. */
+ PurpleConnectionError reason;
+ /** A localised, human-readable description of the error. */
+ const char *description;
+} PurpleAccountCurrentError;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -893,6 +904,16 @@ void purple_account_change_password(PurpleAccount *account, const char *orig_pw,
*/
gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy);
+/**
+ * Get the error that caused the account to be disconnected, or @c NULL if the
+ * account is happily connected or disconnected without an error.
+ *
+ * @param account The account whose error should be retrieved.
+ * @constreturn The type of error and a human-readable description of the
+ * current error, or @c NULL if there is no current error.
+ */
+const PurpleAccountCurrentError *purple_account_get_current_error(PurpleAccount *account);
+
/*@}*/
/**************************************************************************/