Author: gonzalo
Date: 2006-10-05 09:52:27 -0400 (Thu, 05 Oct 2006)
New Revision: 66286

Modified:
   trunk/google-sharp/ChangeLog
   trunk/google-sharp/src/Mono.Google/Authentication.cs
Log:
2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * src/Mono.Google/Authentication.cs: 'CaptchaRequired' is reported as
        'cr'. Fix typo in format.



Modified: trunk/google-sharp/ChangeLog
===================================================================
--- trunk/google-sharp/ChangeLog        2006-10-05 13:27:33 UTC (rev 66285)
+++ trunk/google-sharp/ChangeLog        2006-10-05 13:52:27 UTC (rev 66286)
@@ -1,5 +1,10 @@
 2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * src/Mono.Google/Authentication.cs: 'CaptchaRequired' is reported as
+       'cr'. Fix typo in format.
+
+2006-10-05 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * src/Mono.Google/GoogleConnection.cs:
        * src/Mono.Google/Authentication.cs:
        * src/Mono.Google/CaptchaException.cs:

Modified: trunk/google-sharp/src/Mono.Google/Authentication.cs
===================================================================
--- trunk/google-sharp/src/Mono.Google/Authentication.cs        2006-10-05 
13:27:33 UTC (rev 66285)
+++ trunk/google-sharp/src/Mono.Google/Authentication.cs        2006-10-05 
13:52:27 UTC (rev 66286)
@@ -69,7 +69,7 @@
                        string appname = HttpUtility.UrlEncode 
(conn.ApplicationName);
                        content.AppendFormat 
("Email={0}&Passwd={1}&source={2}&PersistentCookie=0&accountType=HOSTED%5FOR%5FGOOGLE",
 user, password, appname);
                        if (token != null) {
-                               content.AppendFormat 
("&logintoken={0}&logincaptcha={2}", token, captcha);
+                               content.AppendFormat 
("&logintoken={0}&logincaptcha={1}", token, captcha);
                        }
                        byte [] bytes = Encoding.UTF8.GetBytes 
(content.ToString ());
 
@@ -154,9 +154,15 @@
                                        if (str.StartsWith ("Url=")) {
                                                url = str.Substring (4);
                                        } else if (str.StartsWith ("Error=")) {
-                                               try {
-                                                       error = (AuthErrorCode) 
Enum.Parse (typeof (AuthErrorCode), str.Substring (6));
-                                               } catch {}
+                                               string code = str.Substring (6);
+                                               if (code == "cr") {
+                                                       error = 
AuthErrorCode.CaptchaRequired;
+                                               } else {
+                                                       try {
+                                                               error = 
(AuthErrorCode) Enum.Parse (typeof (AuthErrorCode), code);
+                                                       } catch {
+                                                       }
+                                               }
                                        } else if (str.StartsWith 
("CaptchaToken=")) {
                                                token = str.Substring (13);
                                        } else if (str.StartsWith 
("CaptchaUrl=")) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to