[libgdata] [core] Add support for AccountMigrated authentication errors



commit 3c184a926ec17a44b03a8cc13aaa30ee085f80c4
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 1 23:02:39 2010 +0100

    [core] Add support for AccountMigrated authentication errors
    
    These are used by YouTube to signal that new login credentials need to
    be used in order to log in.

 gdata/gdata-service.c |    6 ++++++
 gdata/gdata-service.h |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 15af813..deab96f 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -689,6 +689,12 @@ authenticate (GDataService *self, const gchar *username, const gchar *password,
 			             /* Translators: the parameter is a URI for further information. */
 			             _("You have not agreed to the service's terms and conditions. (%s)"), uri);
 			goto login_error;
+		} else if (strncmp (error_start, "AccountMigrated", error_end - error_start) == 0) {
+			/* This is non-standard, and used by YouTube since it's got messed-up accounts */
+			g_set_error (error, GDATA_AUTHENTICATION_ERROR, GDATA_AUTHENTICATION_ERROR_ACCOUNT_MIGRATED,
+			             /* Translators: the parameter is a URI for further information. */
+			             _("This account has been migrated. Please log in online to receive your new username and password. (%s)"), uri);
+			goto login_error;
 		} else if (strncmp (error_start, "AccountDeleted", error_end - error_start) == 0) {
 			g_set_error (error, GDATA_AUTHENTICATION_ERROR, GDATA_AUTHENTICATION_ERROR_ACCOUNT_DELETED,
 			             /* Translators: the parameter is a URI for further information. */
diff --git a/gdata/gdata-service.h b/gdata/gdata-service.h
index 15632b2..28d1e56 100644
--- a/gdata/gdata-service.h
+++ b/gdata/gdata-service.h
@@ -97,6 +97,8 @@ typedef enum {
  * @GDATA_AUTHENTICATION_ERROR_ACCOUNT_DELETED: The user account has been deleted.
  * @GDATA_AUTHENTICATION_ERROR_ACCOUNT_DISABLED: The user account has been disabled.
  * @GDATA_AUTHENTICATION_ERROR_SERVICE_DISABLED: The user's access to the specified service has been disabled. (The user account may still be valid.)
+ * @GDATA_AUTHENTICATION_ERROR_ACCOUNT_MIGRATED: The user's account login details have been migrated to a new system. (This is used for the transition
+ * from the old YouTube login details to the new ones.)
  *
  * Error codes for #GDataService authentication operations. See the
  * <ulink type="http" url="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html#Errors";>Google accounts documentation</ulink> for
@@ -109,7 +111,8 @@ typedef enum {
 	GDATA_AUTHENTICATION_ERROR_CAPTCHA_REQUIRED,
 	GDATA_AUTHENTICATION_ERROR_ACCOUNT_DELETED,
 	GDATA_AUTHENTICATION_ERROR_ACCOUNT_DISABLED,
-	GDATA_AUTHENTICATION_ERROR_SERVICE_DISABLED
+	GDATA_AUTHENTICATION_ERROR_SERVICE_DISABLED,
+	GDATA_AUTHENTICATION_ERROR_ACCOUNT_MIGRATED
 } GDataAuthenticationError;
 
 /**



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