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>2013-04-30 10:14:34 +0400
committereionrobb <eionrobb@8ca6c67d-4297-256d-f884-781da6d5760b>2013-04-30 10:14:34 +0400
commit3de274b6ee795a89ffb9f172e739db87f00edae9 (patch)
tree1c2d19df1d53ded0d1237fa1c33f64a0ec88dda4
parent91177e8ca43b1aeaf376f582de928372121392a8 (diff)
Add an advanced account option to 'always use https' for message polling, which reduces message lag at the expense of some CPU cycles
-rw-r--r--steam-mobile/libsteam.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/steam-mobile/libsteam.c b/steam-mobile/libsteam.c
index c3576bb..68076ff 100644
--- a/steam-mobile/libsteam.c
+++ b/steam-mobile/libsteam.c
@@ -443,11 +443,13 @@ steam_poll(SteamAccount *sa, gboolean secure, guint message)
{
GString *post = g_string_new(NULL);
SteamMethod method = STEAM_METHOD_POST;
- const gchar *url = NULL;
+ const gchar *url = "/ISteamWebUserPresenceOAuth/PollStatus/v0001";
- if (secure == TRUE)
+ if (secure == TRUE || purple_account_get_bool(sa->account, "always_use_https", FALSE))
{
method |= STEAM_METHOD_SSL;
+ url = "/ISteamWebUserPresenceOAuth/Poll/v0001";
+
g_string_append_printf(post, "access_token=%s&", purple_url_encode(purple_account_get_string(sa->account, "access_token", "")));
} else {
g_string_append_printf(post, "steamid=%s&", purple_url_encode(sa->steamid));
@@ -456,9 +458,6 @@ steam_poll(SteamAccount *sa, gboolean secure, guint message)
g_string_append_printf(post, "message=%u&", message?message:sa->message);
g_string_append_printf(post, "secidletime=%d", sa->idletime);
- url = "/ISteamWebUserPresenceOAuth/PollStatus/v0001";
- if (secure == TRUE)
- url = "/ISteamWebUserPresenceOAuth/Poll/v0001";
steam_post_or_get(sa, method, NULL, url, post->str, steam_poll_cb, GINT_TO_POINTER(secure?1:0), TRUE);
g_string_free(post, TRUE);
@@ -1057,6 +1056,12 @@ static void plugin_init(PurplePlugin *plugin)
"steam_guard_code", "");
prpl_info->protocol_options = g_list_append(
prpl_info->protocol_options, option);
+
+ option = purple_account_option_bool_new(
+ _("Always use HTTPS"),
+ "always_use_https", FALSE);
+ prpl_info->protocol_options = g_list_append(
+ prpl_info->protocol_options, option);
}
static PurplePluginProtocolInfo prpl_info = {