Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/EionRobb/pidgin-opensteamworks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2014-01-15 00:27:59 +0400
committereionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2014-01-15 00:27:59 +0400
commitb77c8b0b70758829fae45a31ff1d791dc8b803d2 (patch)
tree5b579458d45602810efcde5d2bbe738568aee796
parenta8f491aff86fbd1db61d63e9993d7f0a59999f3b (diff)
Better handling of an incorrect SteamGuard token, re-enable a disabled account after setting the correct SteamGuard token via the UI
-rw-r--r--steam-mobile/libsteam.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index b18b07d..6b2e243 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -959,7 +959,12 @@ steam_set_steam_guard_token_cb(gpointer data, const gchar *steam_guard_token)
PurpleAccount *account = data;
purple_account_set_string(account, "steam_guard_code", steam_guard_token);
- purple_account_connect(account);
+
+ if (!purple_account_get_enabled(account, purple_core_get_ui())) {
+ purple_account_set_enabled(account, purple_core_get_ui(), TRUE);
+ } else {
+ purple_account_connect(account);
+ }
}
static void
@@ -1005,7 +1010,12 @@ steam_login_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data)
purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, error_description);
} else
{
- purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, error_description);
+ if (g_str_equal(error_description, "SteamGuard"))
+ {
+ steam_set_steam_guard_token_cb(sa->account, NULL);
+ } else {
+ purple_connection_error(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, error_description);
+ }
}
}
}