diff options
author | esainane <esainane+github@gmail.com> | 2015-11-15 07:54:19 +0300 |
---|---|---|
committer | esainane <esainane+github@gmail.com> | 2015-11-15 07:54:19 +0300 |
commit | 484774fab4775d83e6311174fd304b1d7ae6ad05 (patch) | |
tree | 784c6fecb4aae595be79189212e43f67e008846e /steam-mobile | |
parent | d768fafd40216c39ecda3d718436491e9ad0045e (diff) |
Rework steam_set_steam_guard_token_cb
This makes it more consistent with steam_set_two_factor_auth_code_cb.
Email login via bitlbee in libpurple mode now appears to be fully functional.
This requires regression testing to make sure that no corner cases are broken, or that nothing in pidgin/finch was broken by this change.
Diffstat (limited to 'steam-mobile')
-rw-r--r-- | steam-mobile/libsteam.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c index b732d8c..57e41a9 100644 --- a/steam-mobile/libsteam.c +++ b/steam-mobile/libsteam.c @@ -1148,18 +1148,15 @@ steam_login_with_access_token(SteamAccount *sa) static void
steam_set_steam_guard_token_cb(gpointer data, const gchar *steam_guard_token)
{
- PurpleAccount *account = data;
-
- if (steam_guard_token == NULL)
- steam_guard_token = "";
-
- purple_account_set_string(account, "steam_guard_code", steam_guard_token);
+ SteamAccount *sa = data;
- 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);
- }
+ if (steam_guard_token && *steam_guard_token) {
+ purple_account_set_string(sa->account, "steam_guard_code", steam_guard_token);
+ steam_get_rsa_key(sa);
+ } else {
+ purple_connection_error_reason(sa->pc, PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED,
+ "Could not authenticate steam-guard code.");
+ }
}
static void
@@ -1215,11 +1212,12 @@ steam_login_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data) if (json_object_has_member(obj, "emailsteamid"))
purple_account_set_string(sa->account, "emailsteamid", json_object_get_string_member(obj, "emailsteamid"));
- purple_request_input(NULL, NULL, _("Set your Steam Guard Code"),
+ purple_request_input(sa->pc, NULL, _("Set your Steam Guard Code"),
_("Copy the Steam Guard Code you will have received in your email"), NULL,
FALSE, FALSE, "Steam Guard Code", _("OK"),
G_CALLBACK(steam_set_steam_guard_token_cb), _("Cancel"),
- NULL, sa->account, NULL, NULL, sa->account);
+ G_CALLBACK(steam_set_steam_guard_token_cb), sa->account,
+ NULL, NULL, sa);
}
} else if (json_object_get_boolean_member(obj, "captcha_needed"))
{
|