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:
authorEion Robb <eion@robbmob.com>2016-01-24 12:34:08 +0300
committerEion Robb <eion@robbmob.com>2016-01-24 12:34:08 +0300
commit239cb361a44767c459685a41021c129cc3c119e7 (patch)
tree45d9ef8fb40313b0fcb0cfbbb30a98dfd9a0c939
parenta3f59e3bf550b2c9a1b01e1ccd8b02032360911d (diff)
parentaf012ccf9597bebda5bc930eb422426c7df79de6 (diff)
Merge pull request #130 from tripplet/captcha_url
Added option to display the url of the captcha
-rw-r--r--steam-mobile/libsteam.c10
-rw-r--r--steam-mobile/libsteam.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index bcb51c0..f4a31d5 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -255,7 +255,11 @@ steam_captcha_image_cb(PurpleUtilFetchUrlData *url_data, gpointer userdata, cons
group = purple_request_field_group_new(NULL);
purple_request_fields_add_group(fields, group);
+#ifdef DISPLAY_CAPTCHA_AS_URL
+ field = purple_request_field_string_new("captcha_image", _("Image url"), g_strdup_printf(STEAM_CAPTCHA_URL, sa->captcha_gid), FALSE);
+#else
field = purple_request_field_image_new("captcha_image", _("Image"), response, len);
+#endif
purple_request_field_group_add_field(group, field);
field = purple_request_field_string_new("captcha_response", _("Response"), "", FALSE);
@@ -263,7 +267,11 @@ steam_captcha_image_cb(PurpleUtilFetchUrlData *url_data, gpointer userdata, cons
purple_request_fields(sa->pc,
_("Steam Captcha"), _("Steam Captcha"),
+#ifdef DISPLAY_CAPTCHA_AS_URL
+ _("Paste the url in your browser and input the displayed captcha"),
+#else
_("Please verify you are human by typing the following"),
+#endif
fields,
_("OK"), G_CALLBACK(steam_captcha_ok_cb),
_("Logout"), G_CALLBACK(steam_captcha_cancel_cb),
@@ -1271,7 +1279,7 @@ steam_login_cb(SteamAccount *sa, JsonObject *obj, gpointer user_data)
} else if (json_object_get_boolean_member(obj, "captcha_needed"))
{
const gchar *captcha_gid = json_object_get_string_member(obj, "captcha_gid");
- gchar *captcha_url = g_strdup_printf("https://steamcommunity.com/public/captcha.php?gid=%s", captcha_gid);
+ gchar *captcha_url = g_strdup_printf(STEAM_CAPTCHA_URL, captcha_gid);
sa->captcha_gid = g_strdup(captcha_gid);
#if PURPLE_VERSION_CHECK(3, 0, 0)
diff --git a/steam-mobile/libsteam.h b/steam-mobile/libsteam.h
index 39568db..d744765 100644
--- a/steam-mobile/libsteam.h
+++ b/steam-mobile/libsteam.h
@@ -65,6 +65,8 @@
#define STEAM_PLUGIN_ID "prpl-steam-mobile"
#define STEAM_PLUGIN_VERSION "1.6.1"
+#define STEAM_CAPTCHA_URL "https://steamcommunity.com/public/captcha.php?gid=%s"
+
typedef struct _SteamAccount SteamAccount;
typedef struct _SteamBuddy SteamBuddy;