[libgdata] Bug 634033 — Use standard login URI for YouTube



commit a0944994877651f63fb7f9bcde76e9a7961d416c
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Dec 1 20:52:08 2010 +0000

    Bug 634033 â?? Use standard login URI for YouTube
    
    YouTube is switching over to using the same ClientLogin URI as all other
    GData services. This obsoletes GDataYouTubeService:youtube-user, which will
    disappear shortly.
    
    Closes: bgo#634033

 gdata/services/youtube/gdata-youtube-service.c |   37 ------------------------
 gdata/tests/youtube.c                          |    3 --
 2 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index 8fcc79e..bf5a80c 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -86,7 +86,6 @@ gdata_youtube_service_error_quark (void)
 static void gdata_youtube_service_finalize (GObject *object);
 static void gdata_youtube_service_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec);
 static void gdata_youtube_service_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec);
-static gboolean parse_authentication_response (GDataService *self, guint status, const gchar *response_body, gint length, GError **error);
 static void append_query_headers (GDataService *self, SoupMessage *message);
 static void parse_error_response (GDataService *self, GDataOperationType operation_type, guint status, const gchar *reason_phrase,
                                   const gchar *response_body, gint length, GError **error);
@@ -116,8 +115,6 @@ gdata_youtube_service_class_init (GDataYouTubeServiceClass *klass)
 	gobject_class->finalize = gdata_youtube_service_finalize;
 
 	service_class->service_name = "youtube";
-	service_class->authentication_uri = "https://www.google.com/youtube/accounts/ClientLogin";;
-	service_class->parse_authentication_response = parse_authentication_response;
 	service_class->append_query_headers = append_query_headers;
 	service_class->parse_error_response = parse_error_response;
 
@@ -201,40 +198,6 @@ gdata_youtube_service_set_property (GObject *object, guint property_id, const GV
 	}
 }
 
-static gboolean
-parse_authentication_response (GDataService *self, guint status, const gchar *response_body, gint length, GError **error)
-{
-	GDataYouTubeServicePrivate *priv = GDATA_YOUTUBE_SERVICE (self)->priv;
-	gchar *user_start, *user_end;
-
-	/* Chain up to the parent method first */
-	if (GDATA_SERVICE_CLASS (gdata_youtube_service_parent_class)->parse_authentication_response (self, status,
-		                                                                                     response_body, length, error) == FALSE) {
-		return FALSE;
-	}
-
-	/* Parse the response */
-	user_start = strstr (response_body, "YouTubeUser=");
-	if (user_start == NULL)
-		goto protocol_error;
-	user_start += strlen ("YouTubeUser=");
-
-	user_end = strstr (user_start, "\n");
-	if (user_end == NULL)
-		goto protocol_error;
-
-	priv->youtube_user = g_strndup (user_start, user_end - user_start);
-	if (priv->youtube_user == NULL || strlen (priv->youtube_user) == 0)
-		goto protocol_error;
-
-	return TRUE;
-
-protocol_error:
-	g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR,
-	                     _("The server returned a malformed response."));
-	return FALSE;
-}
-
 static void
 append_query_headers (GDataService *self, SoupMessage *message)
 {
diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
index d8082a1..c9e1f33 100644
--- a/gdata/tests/youtube.c
+++ b/gdata/tests/youtube.c
@@ -24,7 +24,6 @@
 #include "common.h"
 
 #define DEVELOPER_KEY "AI39si7Me3Q7zYs6hmkFvpRBD2nrkVjYYsUO5lh_3HdOkGRc9g6Z4nzxZatk_aAo2EsA21k7vrda0OO6oFg2rnhMedZXPyXoEw"
-#define YT_USERNAME "GDataTest"
 
 static void
 test_authentication (void)
@@ -51,7 +50,6 @@ test_authentication (void)
 	g_assert (gdata_service_is_authenticated (service) == TRUE);
 	g_assert_cmpstr (gdata_service_get_username (service), ==, USERNAME);
 	g_assert_cmpstr (gdata_service_get_password (service), ==, PASSWORD);
-	g_assert_cmpstr (gdata_youtube_service_get_youtube_user (GDATA_YOUTUBE_SERVICE (service)), ==, YT_USERNAME);
 
 	g_object_unref (service);
 }
@@ -73,7 +71,6 @@ test_authentication_async_cb (GDataService *service, GAsyncResult *async_result,
 	g_assert (gdata_service_is_authenticated (service) == TRUE);
 	g_assert_cmpstr (gdata_service_get_username (service), ==, USERNAME);
 	g_assert_cmpstr (gdata_service_get_password (service), ==, PASSWORD);
-	g_assert_cmpstr (gdata_youtube_service_get_youtube_user (GDATA_YOUTUBE_SERVICE (service)), ==, YT_USERNAME);
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]