# HG changeset patch # User Paul Aurich # Date 1265172338 0 # Node ID 9cdf9bc6c1edd8e3f56fd74124ca1a6af48fda87 # Parent 4d50162d809e4916722d9d5d53024eda7afb9615 jabber: When doing writes while disconnecting, 'ignore' errors. In some UIs (Adium and I believe Pidgin), the UI could end up displaying "Lost Connection to Server" instead of (e.g.) "Resource conflict", which masks the actual issue. diff -r 4d50162d809e -r 9cdf9bc6c1ed libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Wed Feb 03 01:03:09 2010 +0000 +++ b/libpurple/protocols/jabber/jabber.c Wed Feb 03 04:45:38 2010 +0000 @@ -356,11 +356,20 @@ } if (ret < 0 && errno != EAGAIN) { - gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), - g_strerror(errno)); - purple_connection_error_reason(js->gc, - PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); - g_free(tmp); + PurpleAccount *account = purple_connection_get_account(js->gc); + /* + * The server may have closed the socket (on a stream error), so if + * we're disconnecting, don't generate (possibly another) error that + * (for some UIs) would mask the first. + */ + if (!account->disconnecting) { + gchar *tmp = g_strdup_printf(_("Lost connection with server: %s"), + g_strerror(errno)); + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp); + g_free(tmp); + } + success = FALSE; } else if (ret < len) { if (ret < 0)