comparison libpurple/account.h @ 21366:8858a42ca237

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.
author Will Thompson <will.thompson@collabora.co.uk>
date Sat, 27 Oct 2007 17:26:17 +0000
parents f296be2a1039
children 71c1f2da4ff2
comparison
equal deleted inserted replaced
21365:3a269007711e 21366:8858a42ca237
138 PurpleLog *system_log; /**< The system log */ 138 PurpleLog *system_log; /**< The system log */
139 139
140 void *ui_data; /**< The UI can put data here. */ 140 void *ui_data; /**< The UI can put data here. */
141 PurpleAccountRegistrationCb registration_cb; 141 PurpleAccountRegistrationCb registration_cb;
142 void *registration_cb_user_data; 142 void *registration_cb_user_data;
143
144 gpointer priv; /**< Pointer to opaque private data. */
143 }; 145 };
146
147 /** The error most recently encountered on an account. */
148 typedef struct
149 {
150 /** The type of error. */
151 PurpleConnectionError reason;
152 /** A localised, human-readable description of the error. */
153 const char *description;
154 } PurpleAccountCurrentError;
144 155
145 #ifdef __cplusplus 156 #ifdef __cplusplus
146 extern "C" { 157 extern "C" {
147 #endif 158 #endif
148 159
891 * @param account The account 902 * @param account The account
892 * @param buddy The buddy 903 * @param buddy The buddy
893 */ 904 */
894 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy); 905 gboolean purple_account_supports_offline_message(PurpleAccount *account, PurpleBuddy *buddy);
895 906
907 /**
908 * Get the error that caused the account to be disconnected, or @c NULL if the
909 * account is happily connected or disconnected without an error.
910 *
911 * @param account The account whose error should be retrieved.
912 * @constreturn The type of error and a human-readable description of the
913 * current error, or @c NULL if there is no current error.
914 */
915 const PurpleAccountCurrentError *purple_account_get_current_error(PurpleAccount *account);
916
896 /*@}*/ 917 /*@}*/
897 918
898 /**************************************************************************/ 919 /**************************************************************************/
899 /** @name Accounts API */ 920 /** @name Accounts API */
900 /**************************************************************************/ 921 /**************************************************************************/