[libsocialweb/libsocialweb-0.25] vimeo: Added a local test server option.
- From: Ross Burton <rburton src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsocialweb/libsocialweb-0.25] vimeo: Added a local test server option.
- Date: Thu, 30 Jun 2011 22:30:31 +0000 (UTC)
commit 682854a734eaa07e38746827b69186293128c026
Author: Eitan Isaacson <eitan isaacson collabora co uk>
Date: Mon Mar 28 10:52:22 2011 -0700
vimeo: Added a local test server option.
services/vimeo/vimeo.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/services/vimeo/vimeo.c b/services/vimeo/vimeo.c
index 39afc3c..ad0d927 100644
--- a/services/vimeo/vimeo.c
+++ b/services/vimeo/vimeo.c
@@ -214,8 +214,10 @@ _check_access_token_cb (RestProxyCall *call,
RestXmlNode *username = rest_xml_node_find (root, "username");
if (username != NULL) {
+ const gchar *host = g_getenv ("SW_LOCAL_VIMEO");
priv->username = g_strdup (username->content);
- rest_proxy_bind (priv->simple_proxy, priv->username);
+ rest_proxy_bind (priv->simple_proxy, host ? host : "vimeo.com",
+ priv->username);
}
rest_xml_node_unref (root);
@@ -293,6 +295,14 @@ got_tokens_cb (RestProxy *proxy, gboolean got_tokens, gpointer user_data)
if (got_tokens) {
RestProxyCall *call;
OAuthProxy *upload_proxy = OAUTH_PROXY (priv->proxy);
+ const gchar *host = g_getenv ("SW_LOCAL_VIMEO");
+
+ /* For local testing with a mock Vimeo service. */
+ if (host != NULL) {
+ gchar *url = g_strdup_printf ("http://%s/", host);
+ g_object_set (priv->proxy, "url-format", url, NULL);
+ g_free (url);
+ }
oauth_proxy_set_token (OAUTH_PROXY (priv->upload_proxy),
oauth_proxy_get_token (upload_proxy));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]