[frogr] Do not force flicksoup to always ask for 'write' permissions.



commit 2b7e4accc063bbaf77e92ee8f0bc54e19b325b92
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Wed Apr 4 15:30:13 2012 +0200

    Do not force flicksoup to always ask for 'write' permissions.
    
    Do it from frogr instead.

 src/flicksoup/fsp-session.c |    3 +--
 src/frogr-controller.c      |   11 ++++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/flicksoup/fsp-session.c b/src/flicksoup/fsp-session.c
index 923dc01..7aa8ff4 100644
--- a/src/flicksoup/fsp-session.c
+++ b/src/flicksoup/fsp-session.c
@@ -1745,8 +1745,7 @@ fsp_session_get_auth_url_finish         (FspSession    *self,
 
       /* Build the authorization url */
       auth_url = g_strdup_printf ("http://www.flickr.com/services/oauth/authorize";
-                                  "?perms=write"
-                                  "&oauth_token=%s",
+                                  "?oauth_token=%s",
                                   priv->token);
 
       fsp_data_free (FSP_DATA (auth_token));
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 117b986..75be64a 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -453,15 +453,18 @@ _get_auth_url_cb (GObject *obj, GAsyncResult *res, gpointer data)
   if (auth_url != NULL && error == NULL)
     {
       GtkWindow *window = NULL;
+      gchar *url_with_permissions = NULL;
 
-      frogr_util_open_uri (auth_url);
+      url_with_permissions = g_strdup_printf ("%s&perms=write", auth_url);
+      frogr_util_open_uri (url_with_permissions);
 
       /* Run the auth confirmation dialog */
       window = frogr_main_view_get_window (priv->mainview);
       frogr_auth_dialog_show (window, CONFIRM_AUTHORIZATION);
 
-      DEBUG ("Auth URL: %s", auth_url);
+      DEBUG ("Auth URL: %s", url_with_permissions);
 
+      g_free (url_with_permissions);
       g_free (auth_url);
     }
 
@@ -498,11 +501,13 @@ _complete_auth_cb (GObject *object, GAsyncResult *result, gpointer data)
 
           /* Set and save the auth token and the settings to disk */
           account = frogr_account_new_with_token (auth_token->token);
-          frogr_account_set_permissions (account, auth_token->permissions);
           frogr_account_set_id (account, auth_token->nsid);
           frogr_account_set_username (account, auth_token->username);
           frogr_account_set_fullname (account, auth_token->fullname);
 
+          /* Frogr always always ask for 'write' permissions at the moment */
+          frogr_account_set_permissions (account, "write");
+
           frogr_controller_set_active_account (controller, account);
 
           DEBUG ("%s", "Authorization successfully completed!");



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