Skip to content

Commit

Permalink
Prevent the account from being disabled when trying to reconnect to t…
Browse files Browse the repository at this point in the history
…he account without an internet connection
  • Loading branch information
EionRobb committed Jul 15, 2021
1 parent a6d4e07 commit a68a486
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions googlechat_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,15 @@ googlechat_auth_get_dynamite_token_cb(PurpleHttpConnection *http_conn, PurpleHtt
const gchar *raw_response;
gsize response_len;

if (purple_http_response_get_error(response) != NULL) {
purple_connection_error(ha->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Auth error"));
if (!purple_http_response_is_successful(response)) {
int error_code = purple_http_response_get_code(response);
if (error_code == 401 || error_code == 403) {
purple_connection_error(ha->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
_("Auth error"));
} else {
purple_connection_error(ha->pc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
purple_http_response_get_error(response));
}
return;
}

Expand Down

0 comments on commit a68a486

Please sign in to comment.