changeset 20818:c560286daede

Clarify the documentation of the return value of purple_connection_reason_is_fatal, and explain why purple_connection_error checks wants_to_die.
author Will Thompson <will.thompson@collabora.co.uk>
date Wed, 10 Oct 2007 15:16:20 +0000
parents 38d7c849d444
children 6d8708b99de1
files libpurple/connection.c libpurple/connection.h
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/connection.c	Tue Oct 09 15:03:48 2007 +0000
+++ b/libpurple/connection.c	Wed Oct 10 15:16:20 2007 +0000
@@ -488,6 +488,12 @@
 void
 purple_connection_error(PurpleConnection *gc, const char *text)
 {
+	/* prpls that have not been updated to use disconnection reasons will
+	 * be setting wants_to_die before calling this function, so choose
+	 * PURPLE_REASON_OTHER_ERROR (which is fatal) if it's true, and
+	 * PURPLE_REASON_NETWORK_ERROR (which isn't) if not.  See the
+	 * documentation in connection.h.
+	 */
 	PurpleDisconnectReason reason = gc->wants_to_die
 	                              ? PURPLE_REASON_OTHER_ERROR
 	                              : PURPLE_REASON_NETWORK_ERROR;
--- a/libpurple/connection.h	Tue Oct 09 15:03:48 2007 +0000
+++ b/libpurple/connection.h	Wed Oct 10 15:16:20 2007 +0000
@@ -429,7 +429,8 @@
  *
  * (This function is meant to replace checking PurpleConnection.wants_to_die.)
  *
- * @return @c TRUE iff automatic reconnection is a bad idea.
+ * @return @c TRUE if the account should not be automatically reconnected, and
+ *         @c FALSE otherwise.
  */
 gboolean
 purple_connection_reason_is_fatal (PurpleDisconnectReason reason);