[shotwell/wip/pluggable-auth: 4/16] Move authenticator in extra file



commit b69393062abc3b442cdb5003d7940f69496097c2
Author: Jens Georg <mail jensge org>
Date:   Mon Dec 19 19:28:39 2016 +0100

    Move authenticator in extra file

 .../shotwell-publishing/FacebookPublishing.vala    |  275 +-------------------
 .../FacebookPublishingAuthenticator.vala           |  277 ++++++++++++++++++++
 po/POTFILES.in                                     |    1 +
 po/POTFILES.skip                                   |    1 +
 publish.am                                         |    1 +
 5 files changed, 282 insertions(+), 273 deletions(-)
---
diff --git a/plugins/shotwell-publishing/FacebookPublishing.vala 
b/plugins/shotwell-publishing/FacebookPublishing.vala
index 0a9f14c..3e1345e 100644
--- a/plugins/shotwell-publishing/FacebookPublishing.vala
+++ b/plugins/shotwell-publishing/FacebookPublishing.vala
@@ -58,13 +58,7 @@ namespace Publishing.Facebook {
 // truly, deep-down know what you're doing)
 public const string SERVICE_NAME = "facebook";
 internal const string USER_VISIBLE_NAME = "Facebook";
-internal const string APPLICATION_ID = "1612018629063184";
 internal const string DEFAULT_ALBUM_NAME = _("Shotwell Connect");
-internal const string SERVICE_WELCOME_MESSAGE =
-    _("You are not currently logged into Facebook.\n\nIf you don’t yet have a Facebook account, you can 
create one during the login process. During login, Shotwell Connect may ask you for permission to upload 
photos and publish to your feed. These permissions are required for Shotwell Connect to function.");
-internal const string RESTART_ERROR_MESSAGE =
-    _("You have already logged in and out of Facebook during this Shotwell session.\nTo continue publishing 
to Facebook, quit and restart Shotwell, then try publishing again.");
-internal const string USER_AGENT = "Java/1.6.0_16";
 internal const int EXPIRED_SESSION_STATUS_CODE = 400;
 
 internal class Album {
@@ -171,116 +165,6 @@ internal class PublishingParameters {
     }
 }
 
-public class FacebookAuthenticator : Spit.Publishing.Authenticator, GLib.Object {
-    private Spit.Publishing.PluginHost host;
-    private WebAuthenticationPane web_auth_pane = null;
-    private GLib.HashTable<string, Variant> params;
-
-    /* Interface functions */
-    public FacebookAuthenticator(Spit.Publishing.PluginHost host) {
-        this.host = host;
-        this.params = new GLib.HashTable<string, Variant>(str_hash, str_equal);
-    }
-
-    public void authenticate() {
-        this.do_show_service_welcome_pane();
-    }
-
-    public bool can_logout() {
-        return true;
-    }
-
-    public GLib.HashTable<string, Variant> get_authentication_parameter() {
-        return this.params;
-    }
-
-    public void invalidate_persistent_session() {
-    }
-
-    public void logout() {
-    }
-
-    /* Private functions */
-    private void do_show_service_welcome_pane() {
-        debug("ACTION: showing service welcome pane.");
-
-        host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_login_clicked);
-        host.set_service_locked(false);
-    }
-
-    private void on_login_clicked() {
-        debug("EVENT: user clicked 'Login' on welcome pane.");
-
-        do_hosted_web_authentication();
-    }
-
-    private void do_hosted_web_authentication() {
-        debug("ACTION: doing hosted web authentication.");
-
-        this.host.set_service_locked(false);
-
-        this.web_auth_pane = new WebAuthenticationPane();
-        this.web_auth_pane.login_succeeded.connect(on_web_auth_pane_login_succeeded);
-        this.web_auth_pane.login_failed.connect(on_web_auth_pane_login_failed);
-
-        this.host.install_dialog_pane(this.web_auth_pane,
-                                      Spit.Publishing.PluginHost.ButtonMode.CANCEL);
-
-    }
-
-    private void on_web_auth_pane_login_succeeded(string success_url) {
-        debug("EVENT: hosted web login succeeded.");
-
-        do_authenticate_session(success_url);
-    }
-
-    private void on_web_auth_pane_login_failed() {
-        debug("EVENT: hosted web login failed.");
-
-        // In this case, "failed" doesn't mean that the user didn't enter the right username and
-        // password -- Facebook handles that case inside the Facebook Connect web control. Instead,
-        // it means that no session was initiated in response to our login request. The only
-        // way this happens is if the user clicks the "Cancel" button that appears inside
-        // the web control. In this case, the correct behavior is to return the user to the
-        // service welcome pane so that they can start the web interaction again.
-        do_show_service_welcome_pane();
-    }
-
-    private void do_authenticate_session(string good_login_uri) {
-        debug("ACTION: preparing to extract session information encoded in uri = '%s'",
-             good_login_uri);
-
-        // the raw uri is percent-encoded, so decode it
-        string decoded_uri = Soup.URI.decode(good_login_uri);
-
-        // locate the access token within the URI
-        string? access_token = null;
-        int index = decoded_uri.index_of("#access_token=");
-        if (index >= 0)
-            access_token = decoded_uri[index:decoded_uri.length];
-        if (access_token == null) {
-            host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE(
-                "Server redirect URL contained no access token"));
-            return;
-        }
-
-        // remove any trailing parameters from the session description string
-        string? trailing_params = null;
-        index = access_token.index_of_char('&');
-        if (index >= 0)
-            trailing_params = access_token[index:access_token.length];
-        if (trailing_params != null)
-            access_token = access_token.replace(trailing_params, "");
-
-        // remove the key from the session description string
-        access_token = access_token.replace("#access_token=", "");
-        this.params.insert("AccessToken", new Variant.string(access_token));
-
-        this.authenticated();
-    }
-
-}
-
 public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
     private PublishingParameters publishing_params;
     private weak Spit.Publishing.PluginHost host = null;
@@ -302,7 +186,7 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
         this.host = host;
 
         this.publishing_params = new PublishingParameters();
-        this.authenticator = new FacebookAuthenticator(host);
+        this.authenticator = new Publishing.Facebook.FacebookAuthenticator(host);
 
         this.graph_session = new GraphSession();
         graph_session.authenticated.connect(on_session_authenticated);
@@ -492,6 +376,7 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
 
     private void do_logout() {
         debug("ACTION: clearing persistent session information and restaring interaction.");
+        this.authenticator.logout();
 
         invalidate_persistent_session();
 
@@ -836,13 +721,6 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
             this.authenticator.authenticated.connect(on_authenticator_succeeded);
             this.authenticator.authentication_failed.connect(on_authenticator_failed);
             this.authenticator.authenticate();
-/*            if (WebAuthenticationPane.is_cache_dirty()) {
-                host.set_service_locked(false);
-                host.install_static_message_pane(RESTART_ERROR_MESSAGE,
-                    Spit.Publishing.PluginHost.ButtonMode.CANCEL);
-            } else {
-                do_show_service_welcome_pane();
-            } */
         }
     }
 
@@ -861,155 +739,6 @@ public class FacebookPublisher : Spit.Publishing.Publisher, GLib.Object {
     }
 }
 
-internal class WebAuthenticationPane : Shotwell.Plugins.Common.WebAuthenticationPane {
-    private static bool cache_dirty = false;
-
-    public signal void login_succeeded(string success_url);
-    public signal void login_failed();
-
-    public WebAuthenticationPane() {
-        Object (login_uri : get_login_url ());
-    }
-
-    private class LocaleLookup {
-        public string prefix;
-        public string translation;
-        public string? exception_code;
-        public string? exception_translation;
-        public string? exception_code_2;
-        public string? exception_translation_2;
-        
-        public LocaleLookup(string prefix, string translation, string? exception_code = null, 
-            string? exception_translation  = null, string? exception_code_2  = null, 
-            string? exception_translation_2 = null) {
-            this.prefix = prefix;
-            this.translation = translation;
-            this.exception_code = exception_code;
-            this.exception_translation = exception_translation;
-            this.exception_code_2 = exception_code_2;
-            this.exception_translation_2 = exception_translation_2;
-        }
-        
-    }
-    
-    private static LocaleLookup[] locale_lookup_table = {
-        new LocaleLookup( "es", "es-la", "ES", "es-es" ),
-        new LocaleLookup( "en", "en-gb", "US", "en-us" ),
-        new LocaleLookup( "fr", "fr-fr", "CA", "fr-ca" ),
-        new LocaleLookup( "pt", "pt-br", "PT", "pt-pt" ),
-        new LocaleLookup( "zh", "zh-cn", "HK", "zh-hk", "TW", "zh-tw" ),
-        new LocaleLookup( "af", "af-za" ),
-        new LocaleLookup( "ar", "ar-ar" ),
-        new LocaleLookup( "nb", "nb-no" ),
-        new LocaleLookup( "no", "nb-no" ),
-        new LocaleLookup( "id", "id-id" ),
-        new LocaleLookup( "ms", "ms-my" ),
-        new LocaleLookup( "ca", "ca-es" ),
-        new LocaleLookup( "cs", "cs-cz" ),
-        new LocaleLookup( "cy", "cy-gb" ),
-        new LocaleLookup( "da", "da-dk" ),
-        new LocaleLookup( "de", "de-de" ),
-        new LocaleLookup( "tl", "tl-ph" ),
-        new LocaleLookup( "ko", "ko-kr" ),
-        new LocaleLookup( "hr", "hr-hr" ),
-        new LocaleLookup( "it", "it-it" ),
-        new LocaleLookup( "lt", "lt-lt" ),
-        new LocaleLookup( "hu", "hu-hu" ),
-        new LocaleLookup( "nl", "nl-nl" ),
-        new LocaleLookup( "ja", "ja-jp" ),
-        new LocaleLookup( "nb", "nb-no" ),
-        new LocaleLookup( "no", "nb-no" ),
-        new LocaleLookup( "pl", "pl-pl" ),
-        new LocaleLookup( "ro", "ro-ro" ),
-        new LocaleLookup( "ru", "ru-ru" ),
-        new LocaleLookup( "sk", "sk-sk" ),
-        new LocaleLookup( "sl", "sl-si" ),
-        new LocaleLookup( "sv", "sv-se" ),
-        new LocaleLookup( "th", "th-th" ),
-        new LocaleLookup( "vi", "vi-vn" ),
-        new LocaleLookup( "tr", "tr-tr" ),
-        new LocaleLookup( "el", "el-gr" ),
-        new LocaleLookup( "bg", "bg-bg" ),
-        new LocaleLookup( "sr", "sr-rs" ),
-        new LocaleLookup( "he", "he-il" ),
-        new LocaleLookup( "hi", "hi-in" ),
-        new LocaleLookup( "bn", "bn-in" ),
-        new LocaleLookup( "pa", "pa-in" ),
-        new LocaleLookup( "ta", "ta-in" ),
-        new LocaleLookup( "te", "te-in" ),
-        new LocaleLookup( "ml", "ml-in" )
-    };
-    
-    private static string get_system_locale_as_facebook_locale() {
-        unowned string? raw_system_locale = Intl.setlocale(LocaleCategory.ALL, "");
-        if (raw_system_locale == null || raw_system_locale == "")
-            return "www";
-        
-        string system_locale = raw_system_locale.split(".")[0];
-        
-        foreach (LocaleLookup locale_lookup in locale_lookup_table) {
-            if (!system_locale.has_prefix(locale_lookup.prefix))
-                continue;
-            
-            if (locale_lookup.exception_code != null) {
-                assert(locale_lookup.exception_translation != null);
-                
-                if (system_locale.contains(locale_lookup.exception_code))
-                    return locale_lookup.exception_translation;
-            }
-            
-            if (locale_lookup.exception_code_2 != null) {
-                assert(locale_lookup.exception_translation_2 != null);
-                
-                if (system_locale.contains(locale_lookup.exception_code_2))
-                    return locale_lookup.exception_translation_2;
-            }
-            
-            return locale_lookup.translation;
-        }
-        
-        // default
-        return "www";
-    }
-
-    private static string get_login_url() {
-        var facebook_locale = get_system_locale_as_facebook_locale();
-
-        return 
"https://%s.facebook.com/dialog/oauth?client_id=%s&redirect_uri=https://www.facebook.com/connect/login_success.html&display=popup&scope=publish_actions,user_photos,user_videos&response_type=token".printf(facebook_locale,
 APPLICATION_ID);
-    }
-
-    public override void on_page_load() {
-        string loaded_url = get_view ().uri.dup();
-        debug("loaded url: " + loaded_url);
-
-        // strip parameters from the loaded url
-        if (loaded_url.contains("?")) {
-            int index = loaded_url.index_of_char('?');
-            string params = loaded_url[index:loaded_url.length];
-            loaded_url = loaded_url.replace(params, "");
-        }
-
-        // were we redirected to the facebook login success page?
-        if (loaded_url.contains("login_success")) {
-            cache_dirty = true;
-            login_succeeded(get_view ().uri);
-            return;
-        }
-
-        // were we redirected to the login total failure page?
-        if (loaded_url.contains("login_failure")) {
-            login_failed();
-            return;
-        }
-    }
-
-#if 0
-    public static bool is_cache_dirty() {
-        return cache_dirty;
-    }
-#endif
-}
-
 internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object {
     private Gtk.Builder builder;
     private Gtk.Box pane_widget = null;
diff --git a/plugins/shotwell-publishing/FacebookPublishingAuthenticator.vala 
b/plugins/shotwell-publishing/FacebookPublishingAuthenticator.vala
new file mode 100644
index 0000000..ba9c6a7
--- /dev/null
+++ b/plugins/shotwell-publishing/FacebookPublishingAuthenticator.vala
@@ -0,0 +1,277 @@
+/* Copyright 2016 Software Freedom Conservancy Inc.
+ *
+ * This software is licensed under the GNU Lesser General Public License
+ * (version 2.1 or later).  See the COPYING file in this distribution.
+ */
+
+namespace Publishing.Facebook {
+    private const string APPLICATION_ID = "1612018629063184";
+
+    private class WebAuthenticationPane : Shotwell.Plugins.Common.WebAuthenticationPane {
+        private static bool cache_dirty = false;
+
+        public signal void login_succeeded(string success_url);
+        public signal void login_failed();
+
+        public WebAuthenticationPane() {
+            Object (login_uri : get_login_url ());
+        }
+
+        private class LocaleLookup {
+            public string prefix;
+            public string translation;
+            public string? exception_code;
+            public string? exception_translation;
+            public string? exception_code_2;
+            public string? exception_translation_2;
+
+            public LocaleLookup(string prefix, string translation, string? exception_code = null,
+                string? exception_translation  = null, string? exception_code_2  = null,
+                string? exception_translation_2 = null) {
+                this.prefix = prefix;
+                this.translation = translation;
+                this.exception_code = exception_code;
+                this.exception_translation = exception_translation;
+                this.exception_code_2 = exception_code_2;
+                this.exception_translation_2 = exception_translation_2;
+            }
+
+        }
+
+        private static LocaleLookup[] locale_lookup_table = {
+            new LocaleLookup( "es", "es-la", "ES", "es-es" ),
+            new LocaleLookup( "en", "en-gb", "US", "en-us" ),
+            new LocaleLookup( "fr", "fr-fr", "CA", "fr-ca" ),
+            new LocaleLookup( "pt", "pt-br", "PT", "pt-pt" ),
+            new LocaleLookup( "zh", "zh-cn", "HK", "zh-hk", "TW", "zh-tw" ),
+            new LocaleLookup( "af", "af-za" ),
+            new LocaleLookup( "ar", "ar-ar" ),
+            new LocaleLookup( "nb", "nb-no" ),
+            new LocaleLookup( "no", "nb-no" ),
+            new LocaleLookup( "id", "id-id" ),
+            new LocaleLookup( "ms", "ms-my" ),
+            new LocaleLookup( "ca", "ca-es" ),
+            new LocaleLookup( "cs", "cs-cz" ),
+            new LocaleLookup( "cy", "cy-gb" ),
+            new LocaleLookup( "da", "da-dk" ),
+            new LocaleLookup( "de", "de-de" ),
+            new LocaleLookup( "tl", "tl-ph" ),
+            new LocaleLookup( "ko", "ko-kr" ),
+            new LocaleLookup( "hr", "hr-hr" ),
+            new LocaleLookup( "it", "it-it" ),
+            new LocaleLookup( "lt", "lt-lt" ),
+            new LocaleLookup( "hu", "hu-hu" ),
+            new LocaleLookup( "nl", "nl-nl" ),
+            new LocaleLookup( "ja", "ja-jp" ),
+            new LocaleLookup( "nb", "nb-no" ),
+            new LocaleLookup( "no", "nb-no" ),
+            new LocaleLookup( "pl", "pl-pl" ),
+            new LocaleLookup( "ro", "ro-ro" ),
+            new LocaleLookup( "ru", "ru-ru" ),
+            new LocaleLookup( "sk", "sk-sk" ),
+            new LocaleLookup( "sl", "sl-si" ),
+            new LocaleLookup( "sv", "sv-se" ),
+            new LocaleLookup( "th", "th-th" ),
+            new LocaleLookup( "vi", "vi-vn" ),
+            new LocaleLookup( "tr", "tr-tr" ),
+            new LocaleLookup( "el", "el-gr" ),
+            new LocaleLookup( "bg", "bg-bg" ),
+            new LocaleLookup( "sr", "sr-rs" ),
+            new LocaleLookup( "he", "he-il" ),
+            new LocaleLookup( "hi", "hi-in" ),
+            new LocaleLookup( "bn", "bn-in" ),
+            new LocaleLookup( "pa", "pa-in" ),
+            new LocaleLookup( "ta", "ta-in" ),
+            new LocaleLookup( "te", "te-in" ),
+            new LocaleLookup( "ml", "ml-in" )
+        };
+
+        private static string get_system_locale_as_facebook_locale() {
+            unowned string? raw_system_locale = Intl.setlocale(LocaleCategory.ALL, "");
+            if (raw_system_locale == null || raw_system_locale == "")
+                return "www";
+
+            string system_locale = raw_system_locale.split(".")[0];
+
+            foreach (LocaleLookup locale_lookup in locale_lookup_table) {
+                if (!system_locale.has_prefix(locale_lookup.prefix))
+                    continue;
+
+                if (locale_lookup.exception_code != null) {
+                    assert(locale_lookup.exception_translation != null);
+
+                    if (system_locale.contains(locale_lookup.exception_code))
+                        return locale_lookup.exception_translation;
+                }
+
+                if (locale_lookup.exception_code_2 != null) {
+                    assert(locale_lookup.exception_translation_2 != null);
+
+                    if (system_locale.contains(locale_lookup.exception_code_2))
+                        return locale_lookup.exception_translation_2;
+                }
+
+                return locale_lookup.translation;
+            }
+
+            // default
+            return "www";
+        }
+
+        private static string get_login_url() {
+            var facebook_locale = get_system_locale_as_facebook_locale();
+
+            return 
"https://%s.facebook.com/dialog/oauth?client_id=%s&redirect_uri=https://www.facebook.com/connect/login_success.html&display=popup&scope=publish_actions,user_photos,user_videos&response_type=token".printf(facebook_locale,
 APPLICATION_ID);
+        }
+
+        public override void on_page_load() {
+            string loaded_url = get_view ().uri.dup();
+            debug("loaded url: " + loaded_url);
+
+            // strip parameters from the loaded url
+            if (loaded_url.contains("?")) {
+                int index = loaded_url.index_of_char('?');
+                string params = loaded_url[index:loaded_url.length];
+                loaded_url = loaded_url.replace(params, "");
+            }
+
+            // were we redirected to the facebook login success page?
+            if (loaded_url.contains("login_success")) {
+                cache_dirty = true;
+                login_succeeded(get_view ().uri);
+                return;
+            }
+
+            // were we redirected to the login total failure page?
+            if (loaded_url.contains("login_failure")) {
+                login_failed();
+                return;
+            }
+        }
+
+        public static bool is_cache_dirty() {
+            return cache_dirty;
+        }
+    }
+
+    public class FacebookAuthenticator : Spit.Publishing.Authenticator, GLib.Object {
+        private Spit.Publishing.PluginHost host;
+        private Publishing.Facebook.WebAuthenticationPane web_auth_pane = null;
+        private GLib.HashTable<string, Variant> params;
+
+        private const string SERVICE_WELCOME_MESSAGE =
+    _("You are not currently logged into Facebook.\n\nIf you don’t yet have a Facebook account, you can 
create one during the login process. During login, Shotwell Connect may ask you for permission to upload 
photos and publish to your feed. These permissions are required for Shotwell Connect to function.");
+        private const string RESTART_ERROR_MESSAGE =
+    _("You have already logged in and out of Facebook during this Shotwell session.\nTo continue publishing 
to Facebook, quit and restart Shotwell, then try publishing again.");
+
+        /* Interface functions */
+        public FacebookAuthenticator(Spit.Publishing.PluginHost host) {
+            this.host = host;
+            this.params = new GLib.HashTable<string, Variant>(str_hash, str_equal);
+        }
+
+        public void authenticate() {
+            // FIXME: Find a way for a proper logout
+            if (WebAuthenticationPane.is_cache_dirty()) {
+                host.set_service_locked(false);
+                host.install_static_message_pane(RESTART_ERROR_MESSAGE,
+                                                 Spit.Publishing.PluginHost.ButtonMode.CANCEL);
+            } else {
+                this.do_show_service_welcome_pane();
+            }
+        }
+
+        public bool can_logout() {
+            return true;
+        }
+
+        public GLib.HashTable<string, Variant> get_authentication_parameter() {
+            return this.params;
+        }
+
+        public void invalidate_persistent_session() {
+        }
+
+        public void logout() {
+        }
+
+        /* Private functions */
+        private void do_show_service_welcome_pane() {
+            debug("ACTION: showing service welcome pane.");
+
+            host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_login_clicked);
+            host.set_service_locked(false);
+        }
+
+        private void on_login_clicked() {
+            debug("EVENT: user clicked 'Login' on welcome pane.");
+
+            do_hosted_web_authentication();
+        }
+
+        private void do_hosted_web_authentication() {
+            debug("ACTION: doing hosted web authentication.");
+
+            this.host.set_service_locked(false);
+
+            this.web_auth_pane = new WebAuthenticationPane();
+            this.web_auth_pane.login_succeeded.connect(on_web_auth_pane_login_succeeded);
+            this.web_auth_pane.login_failed.connect(on_web_auth_pane_login_failed);
+
+            this.host.install_dialog_pane(this.web_auth_pane,
+                                          Spit.Publishing.PluginHost.ButtonMode.CANCEL);
+
+        }
+
+        private void on_web_auth_pane_login_succeeded(string success_url) {
+            debug("EVENT: hosted web login succeeded.");
+
+            do_authenticate_session(success_url);
+        }
+
+        private void on_web_auth_pane_login_failed() {
+            debug("EVENT: hosted web login failed.");
+
+            // In this case, "failed" doesn't mean that the user didn't enter the right username and
+            // password -- Facebook handles that case inside the Facebook Connect web control. Instead,
+            // it means that no session was initiated in response to our login request. The only
+            // way this happens is if the user clicks the "Cancel" button that appears inside
+            // the web control. In this case, the correct behavior is to return the user to the
+            // service welcome pane so that they can start the web interaction again.
+            do_show_service_welcome_pane();
+        }
+
+        private void do_authenticate_session(string good_login_uri) {
+            debug("ACTION: preparing to extract session information encoded in uri = '%s'",
+                 good_login_uri);
+
+            // the raw uri is percent-encoded, so decode it
+            string decoded_uri = Soup.URI.decode(good_login_uri);
+
+            // locate the access token within the URI
+            string? access_token = null;
+            int index = decoded_uri.index_of("#access_token=");
+            if (index >= 0)
+                access_token = decoded_uri[index:decoded_uri.length];
+            if (access_token == null) {
+                host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE(
+                    "Server redirect URL contained no access token"));
+                return;
+            }
+
+            // remove any trailing parameters from the session description string
+            string? trailing_params = null;
+            index = access_token.index_of_char('&');
+            if (index >= 0)
+                trailing_params = access_token[index:access_token.length];
+            if (trailing_params != null)
+                access_token = access_token.replace(trailing_params, "");
+
+            // remove the key from the session description string
+            access_token = access_token.replace("#access_token=", "");
+            this.params.insert("AccessToken", new Variant.string(access_token));
+
+            this.authenticated();
+        }
+    }
+} // namespace Publishing.Facebook;
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4d7e209..c7f1a57 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,6 +23,7 @@ plugins/shotwell-publishing-extras/YandexPublishing.vala
 plugins/shotwell-publishing-extras/yandex_publish_model.ui
 plugins/shotwell-publishing/facebook_publishing_options_pane.ui
 plugins/shotwell-publishing/FacebookPublishing.vala
+plugins/shotwell-publishing/FacebookPublishingAuthenticator.vala
 plugins/shotwell-publishing/flickr_pin_entry_pane.ui
 plugins/shotwell-publishing/flickr_publishing_options_pane.ui
 plugins/shotwell-publishing/FlickrPublishing.vala
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 168f7af..cd0371e 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -13,6 +13,7 @@ plugins/shotwell-publishing-extras/shotwell-publishing-extras.c
 plugins/shotwell-publishing-extras/TumblrPublishing.c
 plugins/shotwell-publishing-extras/YandexPublishing.c
 plugins/shotwell-publishing/FacebookPublishing.c
+plugins/shotwell-publishing/FacebookPublishingAuthenticator.c
 plugins/shotwell-publishing/FlickrPublishing.c
 plugins/shotwell-publishing/PicasaPublishing.c
 plugins/shotwell-publishing/PiwigoPublishing.c
diff --git a/publish.am b/publish.am
index 1407713..a6ab780 100644
--- a/publish.am
+++ b/publish.am
@@ -19,6 +19,7 @@ dist_noinst_DATA += \
 plugins_shotwell_publishing_shotwell_publishing_la_SOURCES = \
        plugins/shotwell-publishing/shotwell-publishing.vala \
        plugins/shotwell-publishing/FacebookPublishing.vala \
+       plugins/shotwell-publishing/FacebookPublishingAuthenticator.vala \
        plugins/shotwell-publishing/PicasaPublishing.vala \
        plugins/shotwell-publishing/FlickrPublishing.vala \
        plugins/shotwell-publishing/YouTubePublishing.vala \


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