--- a/libpurple/connection.c Mon Sep 17 15:23:29 2007 +0000
+++ b/libpurple/connection.c Mon Sep 17 15:30:51 2007 +0000
@@ -524,6 +524,34 @@
purple_connection_get_account(gc));
+purple_connection_reason_is_fatal (PurpleDisconnectReason reason) + case PURPLE_REASON_NONE_SPECIFIED: + case PURPLE_REASON_NETWORK_ERROR: + case PURPLE_REASON_REQUESTED: + case PURPLE_REASON_AUTHENTICATION_FAILED: + case PURPLE_REASON_ENCRYPTION_ERROR: + case PURPLE_REASON_NAME_IN_USE: + case PURPLE_REASON_CERT_NOT_PROVIDED: + case PURPLE_REASON_CERT_UNTRUSTED: + case PURPLE_REASON_CERT_EXPIRED: + case PURPLE_REASON_CERT_NOT_ACTIVATED: + case PURPLE_REASON_CERT_HOSTNAME_MISMATCH: + case PURPLE_REASON_CERT_FINGERPRINT_MISMATCH: + case PURPLE_REASON_CERT_SELF_SIGNED: + case PURPLE_REASON_CERT_OTHER_ERROR: + case PURPLE_REASON_OTHER_ERROR: + g_assert_not_reached (); purple_connections_disconnect_all(void)
--- a/libpurple/connection.h Mon Sep 17 15:23:29 2007 +0000
+++ b/libpurple/connection.h Mon Sep 17 15:30:51 2007 +0000
@@ -372,6 +372,26 @@
PurpleDisconnectReason reason,
const char *description);
+ * Reports whether a disconnection reason is fatal (in which case the account + * should probably not be automatically reconnected) or transient (so + * auto-reconnection is a good idea. + * For instance, #PURPLE_REASON_NETWORK_ERROR is a temporary + * error, which might be caused by losing the network connection, so + * @a purple_connection_reason_is_fatal(PURPLE_REASON_NETWORK_ERROR) is + * @a FALSE. On the other hand, #PURPLE_REASON_AUTHENTICATION_FAILED probably + * indicates a misconfiguration of the account which needs the user to go fix + * purple_connection_reason_is_fatal(PURPLE_REASON_AUTHENTICATION_FAILED) + * (This function is meant to replace checking PurpleConnection.wants_to_die.) + * @return @a TRUE iff automatic reconnection is a bad idea. +purple_connection_reason_is_fatal (PurpleDisconnectReason reason); /**************************************************************************/