From 3253d99365813f2d2ffd05e10cbb8c11f53d746e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 22 Mar 2017 06:39:17 +0100 Subject: New upstream version 0.26.0 --- .../shotwell/FacebookPublishingAuthenticator.c | 2300 ++++++++++++ .../shotwell/FacebookPublishingAuthenticator.vala | 318 ++ .../shotwell/FlickrPublishingAuthenticator.c | 3687 ++++++++++++++++++++ .../shotwell/FlickrPublishingAuthenticator.vala | 552 +++ .../authenticator/shotwell/GoogleAuthenticator.c | 2690 ++++++++++++++ .../shotwell/GoogleAuthenticator.vala | 409 +++ .../shotwell/ShotwellAuthenticatorFactory.c | 356 ++ .../shotwell/ShotwellAuthenticatorFactory.vala | 40 + .../shotwell/flickr_pin_entry_pane.ui | 90 + .../org.gnome.Shotwell.Authenticator.gresource.xml | 6 + 10 files changed, 10448 insertions(+) create mode 100644 plugins/authenticator/shotwell/FacebookPublishingAuthenticator.c create mode 100644 plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala create mode 100644 plugins/authenticator/shotwell/FlickrPublishingAuthenticator.c create mode 100644 plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala create mode 100644 plugins/authenticator/shotwell/GoogleAuthenticator.c create mode 100644 plugins/authenticator/shotwell/GoogleAuthenticator.vala create mode 100644 plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.c create mode 100644 plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala create mode 100644 plugins/authenticator/shotwell/flickr_pin_entry_pane.ui create mode 100644 plugins/authenticator/shotwell/org.gnome.Shotwell.Authenticator.gresource.xml (limited to 'plugins/authenticator/shotwell') diff --git a/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.c b/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.c new file mode 100644 index 0000000..8db6ac0 --- /dev/null +++ b/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.c @@ -0,0 +1,2300 @@ +/* FacebookPublishingAuthenticator.c generated by valac 0.34.4, the Vala compiler + * generated from FacebookPublishingAuthenticator.vala, do not modify */ + +/* 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. + */ + +#include +#include +#include +#include +#include "shotwell-plugin-common.h" +#include +#include +#include "shotwell-plugin-dev-1.0.h" +#include +#include +#include + + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE (publishing_authenticator_shotwell_facebook_web_authentication_pane_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellFacebookWebAuthenticationPane)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_WEB_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_WEB_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass)) + +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPane PublishingAuthenticatorShotwellFacebookWebAuthenticationPane; +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass; +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPanePrivate PublishingAuthenticatorShotwellFacebookWebAuthenticationPanePrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP (publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_LOCALE_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_LOCALE_LOOKUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_IS_LOCALE_LOOKUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_IS_LOCALE_LOOKUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_LOCALE_LOOKUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass)) + +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup; +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass; +#define _g_free0(var) (var = (g_free (var), NULL)) +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupPrivate PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupPrivate; +#define _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref0(var) ((var == NULL) ? NULL : (var = (publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (var), NULL))) +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +typedef struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneParamSpecLocaleLookup PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneParamSpecLocaleLookup; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK (publishing_authenticator_shotwell_facebook_facebook_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebookClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebookClass)) + +typedef struct _PublishingAuthenticatorShotwellFacebookFacebook PublishingAuthenticatorShotwellFacebookFacebook; +typedef struct _PublishingAuthenticatorShotwellFacebookFacebookClass PublishingAuthenticatorShotwellFacebookFacebookClass; +typedef struct _PublishingAuthenticatorShotwellFacebookFacebookPrivate PublishingAuthenticatorShotwellFacebookFacebookPrivate; +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPane { + ShotwellPluginsCommonWebAuthenticationPane parent_instance; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPanePrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass { + ShotwellPluginsCommonWebAuthenticationPaneClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup { + GTypeInstance parent_instance; + volatile int ref_count; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupPrivate * priv; + gchar* prefix; + gchar* translation; + gchar* exception_code; + gchar* exception_translation; + gchar* exception_code_2; + gchar* exception_translation_2; +}; + +struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass { + GTypeClass parent_class; + void (*finalize) (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup *self); +}; + +struct _PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneParamSpecLocaleLookup { + GParamSpec parent_instance; +}; + +struct _PublishingAuthenticatorShotwellFacebookFacebook { + GObject parent_instance; + PublishingAuthenticatorShotwellFacebookFacebookPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFacebookFacebookClass { + GObjectClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFacebookFacebookPrivate { + SpitPublishingPluginHost* host; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* web_auth_pane; + GHashTable* params; +}; + + +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_parent_class = NULL; +static gboolean publishing_authenticator_shotwell_facebook_web_authentication_pane_cache_dirty; +static gboolean publishing_authenticator_shotwell_facebook_web_authentication_pane_cache_dirty = FALSE; +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table; +static gint publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table_length1; +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table = NULL; +static gint publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table_length1 = 0; +static gint _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table_size_ = 0; +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_facebook_facebook_parent_class = NULL; +static SpitPublishingAuthenticatorIface* publishing_authenticator_shotwell_facebook_facebook_spit_publishing_authenticator_parent_iface = NULL; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_APPLICATION_ID "1612018629063184" +GType publishing_authenticator_shotwell_facebook_web_authentication_pane_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_DUMMY_PROPERTY +}; +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (gpointer instance); +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (gpointer instance); +static GParamSpec* publishing_authenticator_shotwell_facebook_web_authentication_pane_param_spec_locale_lookup (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) G_GNUC_UNUSED; +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_set_locale_lookup (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_take_locale_lookup (GValue* value, gpointer v_object) G_GNUC_UNUSED; +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_value_get_locale_lookup (const GValue* value) G_GNUC_UNUSED; +static GType publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_get_type (void) G_GNUC_CONST G_GNUC_UNUSED; +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new (const gchar* prefix, const gchar* translation, const gchar* exception_code, const gchar* exception_translation, const gchar* exception_code_2, const gchar* exception_translation_2); +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_construct (GType object_type, const gchar* prefix, const gchar* translation, const gchar* exception_code, const gchar* exception_translation, const gchar* exception_code_2, const gchar* exception_translation_2); +PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* publishing_authenticator_shotwell_facebook_web_authentication_pane_new (void); +PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* publishing_authenticator_shotwell_facebook_web_authentication_pane_construct (GType object_type); +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_get_login_url (void); +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_get_system_locale_as_facebook_locale (void); +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_real_on_page_load (ShotwellPluginsCommonWebAuthenticationPane* base); +gboolean publishing_authenticator_shotwell_facebook_web_authentication_pane_is_cache_dirty (void); +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_LOCALE_LOOKUP_DUMMY_PROPERTY +}; +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_finalize (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* obj); +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_finalize (GObject* obj); +GType publishing_authenticator_shotwell_facebook_facebook_get_type (void) G_GNUC_CONST; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebookPrivate)) +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_DUMMY_PROPERTY +}; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_SERVICE_WELCOME_MESSAGE _ ("You are not currently logged into Facebook.\n" \ +"\n" \ +"If you don’t yet have a Facebook account, you can create one during th" \ +"e login process. During login, Shotwell Connect may ask you for permis" \ +"sion to upload photos and publish to your feed. These permissions are " \ +"required for Shotwell Connect to function.") +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_RESTART_ERROR_MESSAGE _ ("You have already logged in and out of Facebook during this Shotwell se" \ +"ssion.\n" \ +"To continue publishing to Facebook, quit and restart Shotwell, then tr" \ +"y publishing again.") +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_new (SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_construct (GType object_type, SpitPublishingPluginHost* host); +static void _g_free0_ (gpointer var); +static void _g_variant_unref0_ (gpointer var); +static void publishing_authenticator_shotwell_facebook_facebook_real_authenticate (SpitPublishingAuthenticator* base); +static gboolean publishing_authenticator_shotwell_facebook_facebook_is_persistent_session_valid (PublishingAuthenticatorShotwellFacebookFacebook* self); +static gchar* publishing_authenticator_shotwell_facebook_facebook_get_persistent_access_token (PublishingAuthenticatorShotwellFacebookFacebook* self); +static void publishing_authenticator_shotwell_facebook_facebook_do_show_service_welcome_pane (PublishingAuthenticatorShotwellFacebookFacebook* self); +static gboolean publishing_authenticator_shotwell_facebook_facebook_real_can_logout (SpitPublishingAuthenticator* base); +static GHashTable* publishing_authenticator_shotwell_facebook_facebook_real_get_authentication_parameter (SpitPublishingAuthenticator* base); +void publishing_authenticator_shotwell_facebook_facebook_invalidate_persistent_session (PublishingAuthenticatorShotwellFacebookFacebook* self); +static void publishing_authenticator_shotwell_facebook_facebook_set_persistent_access_token (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* access_token); +static void publishing_authenticator_shotwell_facebook_facebook_real_logout (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_facebook_facebook_real_refresh (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_facebook_facebook_on_login_clicked (PublishingAuthenticatorShotwellFacebookFacebook* self); +static void _publishing_authenticator_shotwell_facebook_facebook_on_login_clicked_spit_publishing_login_callback (gpointer self); +static void publishing_authenticator_shotwell_facebook_facebook_do_hosted_web_authentication (PublishingAuthenticatorShotwellFacebookFacebook* self); +static void publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* success_url); +static void _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_succeeded (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _sender, const gchar* success_url, gpointer self); +static void publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed (PublishingAuthenticatorShotwellFacebookFacebook* self); +static void _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_failed (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _sender, gpointer self); +static void publishing_authenticator_shotwell_facebook_facebook_do_authenticate_session (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* good_login_uri); +static void publishing_authenticator_shotwell_facebook_facebook_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); +static gint _vala_array_length (gpointer array); + + +PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* publishing_authenticator_shotwell_facebook_web_authentication_pane_construct (GType object_type) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane * self = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_get_login_url (); +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = _tmp0_; +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane*) g_object_new (object_type, "login-uri", _tmp1_, NULL); +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (_tmp1_); +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self; +#line 200 "FacebookPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* publishing_authenticator_shotwell_facebook_web_authentication_pane_new (void) { +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_facebook_web_authentication_pane_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE); +#line 207 "FacebookPublishingAuthenticator.c" +} + + +static gpointer _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref0 (gpointer self) { +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self ? publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (self) : NULL; +#line 214 "FacebookPublishingAuthenticator.c" +} + + +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 1376 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, FALSE); +#line 1376 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, FALSE); +#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = needle; +#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); +#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp1_ != NULL; +#line 1377 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 234 "FacebookPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_get_system_locale_as_facebook_locale (void) { + gchar* result = NULL; + const gchar* raw_system_locale = NULL; + const gchar* _tmp0_ = NULL; + gboolean _tmp1_ = FALSE; + const gchar* _tmp2_ = NULL; + gchar* system_locale = NULL; + const gchar* _tmp5_ = NULL; + gchar** _tmp6_ = NULL; + gchar** _tmp7_ = NULL; + gchar** _tmp8_ = NULL; + gint _tmp8__length1 = 0; + const gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; + gchar* _tmp11_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** _tmp12_ = NULL; + gint _tmp12__length1 = 0; + gchar* _tmp43_ = NULL; +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = setlocale (LC_ALL, ""); +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + raw_system_locale = _tmp0_; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = raw_system_locale; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp2_ == NULL) { +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = TRUE; +#line 266 "FacebookPublishingAuthenticator.c" + } else { + const gchar* _tmp3_ = NULL; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = raw_system_locale; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = g_strcmp0 (_tmp3_, "") == 0; +#line 273 "FacebookPublishingAuthenticator.c" + } +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp1_) { +#line 277 "FacebookPublishingAuthenticator.c" + gchar* _tmp4_ = NULL; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = g_strdup ("www"); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp4_; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 285 "FacebookPublishingAuthenticator.c" + } +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = raw_system_locale; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = _tmp6_ = g_strsplit (_tmp5_, ".", 0); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = _tmp7_; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8__length1 = _vala_array_length (_tmp6_); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp9_ = _tmp8_[0]; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp10_ = g_strdup (_tmp9_); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp11_ = _tmp10_; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = (_vala_array_free (_tmp8_, _tmp8__length1, (GDestroyNotify) g_free), NULL); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + system_locale = _tmp11_; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp12_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp12__length1 = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table_length1; +#line 309 "FacebookPublishingAuthenticator.c" + { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** locale_lookup_collection = NULL; + gint locale_lookup_collection_length1 = 0; + gint _locale_lookup_collection_size_ = 0; + gint locale_lookup_it = 0; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + locale_lookup_collection = _tmp12_; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + locale_lookup_collection_length1 = _tmp12__length1; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + for (locale_lookup_it = 0; locale_lookup_it < _tmp12__length1; locale_lookup_it = locale_lookup_it + 1) { +#line 321 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp13_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* locale_lookup = NULL; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp13_ = _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref0 (locale_lookup_collection[locale_lookup_it]); +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + locale_lookup = _tmp13_; +#line 328 "FacebookPublishingAuthenticator.c" + { + const gchar* _tmp14_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp15_ = NULL; + const gchar* _tmp16_ = NULL; + gboolean _tmp17_ = FALSE; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp18_ = NULL; + const gchar* _tmp19_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp29_ = NULL; + const gchar* _tmp30_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp40_ = NULL; + const gchar* _tmp41_ = NULL; + gchar* _tmp42_ = NULL; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp14_ = system_locale; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp15_ = locale_lookup; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp16_ = _tmp15_->prefix; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp17_ = g_str_has_prefix (_tmp14_, _tmp16_); +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (!_tmp17_) { +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref0 (locale_lookup); +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + continue; +#line 355 "FacebookPublishingAuthenticator.c" + } +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp18_ = locale_lookup; +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp19_ = _tmp18_->exception_code; +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp19_ != NULL) { +#line 363 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp20_ = NULL; + const gchar* _tmp21_ = NULL; + const gchar* _tmp22_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp23_ = NULL; + const gchar* _tmp24_ = NULL; + gboolean _tmp25_ = FALSE; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp20_ = locale_lookup; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp21_ = _tmp20_->exception_translation; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _vala_assert (_tmp21_ != NULL, "locale_lookup.exception_translation != null"); +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp22_ = system_locale; +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp23_ = locale_lookup; +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp24_ = _tmp23_->exception_code; +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp25_ = string_contains (_tmp22_, _tmp24_); +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp25_) { +#line 386 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp26_ = NULL; + const gchar* _tmp27_ = NULL; + gchar* _tmp28_ = NULL; +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp26_ = locale_lookup; +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp27_ = _tmp26_->exception_translation; +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp28_ = g_strdup (_tmp27_); +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp28_; +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref0 (locale_lookup); +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (system_locale); +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 404 "FacebookPublishingAuthenticator.c" + } + } +#line 110 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp29_ = locale_lookup; +#line 110 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp30_ = _tmp29_->exception_code_2; +#line 110 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp30_ != NULL) { +#line 413 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp31_ = NULL; + const gchar* _tmp32_ = NULL; + const gchar* _tmp33_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp34_ = NULL; + const gchar* _tmp35_ = NULL; + gboolean _tmp36_ = FALSE; +#line 111 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp31_ = locale_lookup; +#line 111 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp32_ = _tmp31_->exception_translation_2; +#line 111 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _vala_assert (_tmp32_ != NULL, "locale_lookup.exception_translation_2 != null"); +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp33_ = system_locale; +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp34_ = locale_lookup; +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp35_ = _tmp34_->exception_code_2; +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp36_ = string_contains (_tmp33_, _tmp35_); +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp36_) { +#line 436 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp37_ = NULL; + const gchar* _tmp38_ = NULL; + gchar* _tmp39_ = NULL; +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp37_ = locale_lookup; +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp38_ = _tmp37_->exception_translation_2; +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp39_ = g_strdup (_tmp38_); +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp39_; +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref0 (locale_lookup); +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (system_locale); +#line 114 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 454 "FacebookPublishingAuthenticator.c" + } + } +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp40_ = locale_lookup; +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp41_ = _tmp40_->translation; +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp42_ = g_strdup (_tmp41_); +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp42_; +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref0 (locale_lookup); +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (system_locale); +#line 117 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 471 "FacebookPublishingAuthenticator.c" + } + } + } +#line 121 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp43_ = g_strdup ("www"); +#line 121 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp43_; +#line 121 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (system_locale); +#line 121 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 483 "FacebookPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_get_login_url (void) { + gchar* result = NULL; + gchar* facebook_locale = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_get_system_locale_as_facebook_locale (); +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + facebook_locale = _tmp0_; +#line 127 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = g_strdup_printf ("https://%s.facebook.com/dialog/oauth?client_id=%s&redirect_uri=https:/" \ +"/www.facebook.com/connect/login_success.html&display=popup&scope=publi" \ +"sh_actions,user_photos,user_videos&response_type=token", facebook_locale, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_APPLICATION_ID); +#line 127 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp1_; +#line 127 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (facebook_locale); +#line 127 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 504 "FacebookPublishingAuthenticator.c" +} + + +static gint string_index_of_char (const gchar* self, gunichar c, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + gunichar _tmp1_ = 0U; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1007 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 1008 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 1008 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = c; +#line 1008 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = g_utf8_strchr (((gchar*) self) + _tmp0_, (gssize) -1, _tmp1_); +#line 1008 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 1010 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 1010 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 529 "FacebookPublishingAuthenticator.c" + gchar* _tmp4_ = NULL; +#line 1011 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 1011 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 1011 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 537 "FacebookPublishingAuthenticator.c" + } else { +#line 1013 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = -1; +#line 1013 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 543 "FacebookPublishingAuthenticator.c" + } +} + + +static gchar* string_slice (const gchar* self, glong start, glong end) { + gchar* result = NULL; + glong string_length = 0L; + gint _tmp0_ = 0; + gint _tmp1_ = 0; + glong _tmp2_ = 0L; + glong _tmp5_ = 0L; + gboolean _tmp8_ = FALSE; + glong _tmp9_ = 0L; + gboolean _tmp12_ = FALSE; + glong _tmp13_ = 0L; + glong _tmp16_ = 0L; + glong _tmp17_ = 0L; + glong _tmp18_ = 0L; + glong _tmp19_ = 0L; + glong _tmp20_ = 0L; + gchar* _tmp21_ = NULL; +#line 1328 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = strlen (self); +#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = _tmp0_; +#line 1329 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + string_length = (glong) _tmp1_; +#line 1330 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = start; +#line 1330 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp2_ < ((glong) 0)) { +#line 577 "FacebookPublishingAuthenticator.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; +#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = string_length; +#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = start; +#line 1331 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + start = _tmp3_ + _tmp4_; +#line 586 "FacebookPublishingAuthenticator.c" + } +#line 1333 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1333 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp5_ < ((glong) 0)) { +#line 592 "FacebookPublishingAuthenticator.c" + glong _tmp6_ = 0L; + glong _tmp7_ = 0L; +#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = string_length; +#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp7_ = end; +#line 1334 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + end = _tmp6_ + _tmp7_; +#line 601 "FacebookPublishingAuthenticator.c" + } +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp9_ = start; +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp9_ >= ((glong) 0)) { +#line 607 "FacebookPublishingAuthenticator.c" + glong _tmp10_ = 0L; + glong _tmp11_ = 0L; +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp10_ = start; +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp11_ = string_length; +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp8_ = _tmp10_ <= _tmp11_; +#line 616 "FacebookPublishingAuthenticator.c" + } else { +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp8_ = FALSE; +#line 620 "FacebookPublishingAuthenticator.c" + } +#line 1336 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp8_, NULL); +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp13_ = end; +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp13_ >= ((glong) 0)) { +#line 628 "FacebookPublishingAuthenticator.c" + glong _tmp14_ = 0L; + glong _tmp15_ = 0L; +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp14_ = end; +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp12_ = _tmp14_ <= _tmp15_; +#line 637 "FacebookPublishingAuthenticator.c" + } else { +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp12_ = FALSE; +#line 641 "FacebookPublishingAuthenticator.c" + } +#line 1337 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_, NULL); +#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp16_ = start; +#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp17_ = end; +#line 1338 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp16_ <= _tmp17_, NULL); +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp18_ = start; +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp19_ = end; +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp20_ = start; +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp21_ = g_strndup (((gchar*) self) + _tmp18_, (gsize) (_tmp19_ - _tmp20_)); +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp21_; +#line 1339 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 663 "FacebookPublishingAuthenticator.c" +} + + +static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) { + gchar* result = NULL; + GError * _inner_error_ = NULL; +#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (old != NULL, NULL); +#line 1380 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (replacement != NULL, NULL); +#line 676 "FacebookPublishingAuthenticator.c" + { + GRegex* regex = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + GRegex* _tmp3_ = NULL; + GRegex* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + GRegex* _tmp6_ = NULL; + const gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = old; +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = g_regex_escape_string (_tmp0_, -1); +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = _tmp1_; +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_); +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = _tmp3_; +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_free0 (_tmp2_); +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + regex = _tmp4_; +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_inner_error_->domain == G_REGEX_ERROR) { +#line 707 "FacebookPublishingAuthenticator.c" + goto __catch0_g_regex_error; + } +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1382 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return NULL; +#line 716 "FacebookPublishingAuthenticator.c" + } +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = regex; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp7_ = replacement; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp8_ = g_regex_replace_literal (_tmp6_, self, (gssize) -1, 0, _tmp7_, 0, &_inner_error_); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = _tmp8_; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_inner_error_->domain == G_REGEX_ERROR) { +#line 732 "FacebookPublishingAuthenticator.c" + goto __catch0_g_regex_error; + } +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return NULL; +#line 743 "FacebookPublishingAuthenticator.c" + } +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp9_ = _tmp5_; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = NULL; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp9_; +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_free0 (_tmp5_); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_regex_unref0 (regex); +#line 1383 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 757 "FacebookPublishingAuthenticator.c" + } + goto __finally0; + __catch0_g_regex_error: + { + GError* e = NULL; +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + e = _inner_error_; +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _inner_error_ = NULL; +#line 1385 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_assert_not_reached (); +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _g_error_free0 (e); +#line 771 "FacebookPublishingAuthenticator.c" + } + __finally0: +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_clear_error (&_inner_error_); +#line 1381 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return NULL; +#line 782 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_real_on_page_load (ShotwellPluginsCommonWebAuthenticationPane* base) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane * self; + gchar* loaded_url = NULL; + WebKitWebView* _tmp0_ = NULL; + WebKitWebView* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + const gchar* _tmp9_ = NULL; + gboolean _tmp10_ = FALSE; + const gchar* _tmp22_ = NULL; + gboolean _tmp23_ = FALSE; + const gchar* _tmp28_ = NULL; + gboolean _tmp29_ = FALSE; +#line 130 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellFacebookWebAuthenticationPane); +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = shotwell_plugins_common_web_authentication_pane_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_WEB_AUTHENTICATION_PANE, ShotwellPluginsCommonWebAuthenticationPane)); +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = _tmp0_; +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = webkit_web_view_get_uri (_tmp1_); +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = g_strdup (_tmp3_); +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = _tmp4_; +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (_tmp1_); +#line 131 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + loaded_url = _tmp5_; +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp6_ = loaded_url; +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = g_strconcat ("loaded url: ", _tmp6_, NULL); +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = _tmp7_; +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:132: %s", _tmp8_); +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (_tmp8_); +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp9_ = loaded_url; +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp10_ = string_contains (_tmp9_, "?"); +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp10_) { +#line 839 "FacebookPublishingAuthenticator.c" + gint index = 0; + const gchar* _tmp11_ = NULL; + gint _tmp12_ = 0; + gchar* params = NULL; + const gchar* _tmp13_ = NULL; + gint _tmp14_ = 0; + const gchar* _tmp15_ = NULL; + gint _tmp16_ = 0; + gint _tmp17_ = 0; + gchar* _tmp18_ = NULL; + const gchar* _tmp19_ = NULL; + const gchar* _tmp20_ = NULL; + gchar* _tmp21_ = NULL; +#line 136 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp11_ = loaded_url; +#line 136 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp12_ = string_index_of_char (_tmp11_, (gunichar) '?', 0); +#line 136 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + index = _tmp12_; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp13_ = loaded_url; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp14_ = index; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp15_ = loaded_url; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp16_ = strlen (_tmp15_); +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp17_ = _tmp16_; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp18_ = string_slice (_tmp13_, (glong) _tmp14_, (glong) _tmp17_); +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + params = _tmp18_; +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp19_ = loaded_url; +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp20_ = params; +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp21_ = string_replace (_tmp19_, _tmp20_, ""); +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (loaded_url); +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + loaded_url = _tmp21_; +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (params); +#line 885 "FacebookPublishingAuthenticator.c" + } +#line 142 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp22_ = loaded_url; +#line 142 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp23_ = string_contains (_tmp22_, "login_success"); +#line 142 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp23_) { +#line 893 "FacebookPublishingAuthenticator.c" + WebKitWebView* _tmp24_ = NULL; + WebKitWebView* _tmp25_ = NULL; + const gchar* _tmp26_ = NULL; + const gchar* _tmp27_ = NULL; +#line 143 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_cache_dirty = TRUE; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp24_ = shotwell_plugins_common_web_authentication_pane_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_WEB_AUTHENTICATION_PANE, ShotwellPluginsCommonWebAuthenticationPane)); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp25_ = _tmp24_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp26_ = webkit_web_view_get_uri (_tmp25_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp27_ = _tmp26_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_emit_by_name (self, "login-succeeded", _tmp27_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (_tmp25_); +#line 145 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (loaded_url); +#line 145 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return; +#line 916 "FacebookPublishingAuthenticator.c" + } +#line 149 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp28_ = loaded_url; +#line 149 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp29_ = string_contains (_tmp28_, "login_failure"); +#line 149 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp29_) { +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_emit_by_name (self, "login-failed"); +#line 151 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (loaded_url); +#line 151 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return; +#line 930 "FacebookPublishingAuthenticator.c" + } +#line 130 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (loaded_url); +#line 934 "FacebookPublishingAuthenticator.c" +} + + +gboolean publishing_authenticator_shotwell_facebook_web_authentication_pane_is_cache_dirty (void) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; +#line 156 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_cache_dirty; +#line 156 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp0_; +#line 156 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 947 "FacebookPublishingAuthenticator.c" +} + + +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_construct (GType object_type, const gchar* prefix, const gchar* translation, const gchar* exception_code, const gchar* exception_translation, const gchar* exception_code_2, const gchar* exception_translation_2) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* self = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + const gchar* _tmp10_ = NULL; + gchar* _tmp11_ = NULL; +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (prefix != NULL, NULL); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (translation != NULL, NULL); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup*) g_type_create_instance (object_type); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = prefix; +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->prefix); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->prefix = _tmp1_; +#line 35 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = translation; +#line 35 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 35 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->translation); +#line 35 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->translation = _tmp3_; +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = exception_code; +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_code); +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->exception_code = _tmp5_; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp6_ = exception_translation; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = g_strdup (_tmp6_); +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_translation); +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->exception_translation = _tmp7_; +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = exception_code_2; +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp9_ = g_strdup (_tmp8_); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_code_2); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->exception_code_2 = _tmp9_; +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp10_ = exception_translation_2; +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp11_ = g_strdup (_tmp10_); +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_translation_2); +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->exception_translation_2 = _tmp11_; +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self; +#line 1021 "FacebookPublishingAuthenticator.c" +} + + +static PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new (const gchar* prefix, const gchar* translation, const gchar* exception_code, const gchar* exception_translation, const gchar* exception_code_2, const gchar* exception_translation_2) { +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP, prefix, translation, exception_code, exception_translation, exception_code_2, exception_translation_2); +#line 1028 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_init (GValue* value) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = NULL; +#line 1035 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_free_value (GValue* value) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (value->data[0].v_pointer) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (value->data[0].v_pointer); +#line 1044 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_copy_value (const GValue* src_value, GValue* dest_value) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (src_value->data[0].v_pointer) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + dest_value->data[0].v_pointer = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (src_value->data[0].v_pointer); +#line 1054 "FacebookPublishingAuthenticator.c" + } else { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + dest_value->data[0].v_pointer = NULL; +#line 1058 "FacebookPublishingAuthenticator.c" + } +} + + +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_peek_pointer (const GValue* value) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return value->data[0].v_pointer; +#line 1066 "FacebookPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (collect_values[0].v_pointer) { +#line 1073 "FacebookPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* object; + object = collect_values[0].v_pointer; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (object->parent_instance.g_class == NULL) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 1080 "FacebookPublishingAuthenticator.c" + } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL); +#line 1084 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (object); +#line 1088 "FacebookPublishingAuthenticator.c" + } else { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = NULL; +#line 1092 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return NULL; +#line 1096 "FacebookPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** object_p; + object_p = collect_values[0].v_pointer; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (!object_p) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value)); +#line 1107 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (!value->data[0].v_pointer) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + *object_p = NULL; +#line 1113 "FacebookPublishingAuthenticator.c" + } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + *object_p = value->data[0].v_pointer; +#line 1117 "FacebookPublishingAuthenticator.c" + } else { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + *object_p = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (value->data[0].v_pointer); +#line 1121 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return NULL; +#line 1125 "FacebookPublishingAuthenticator.c" +} + + +static GParamSpec* publishing_authenticator_shotwell_facebook_web_authentication_pane_param_spec_locale_lookup (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneParamSpecLocaleLookup* spec; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (g_type_is_a (object_type, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP), NULL); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + G_PARAM_SPEC (spec)->value_type = object_type; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return G_PARAM_SPEC (spec); +#line 1139 "FacebookPublishingAuthenticator.c" +} + + +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_value_get_locale_lookup (const GValue* value) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP), NULL); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return value->data[0].v_pointer; +#line 1148 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_set_locale_lookup (GValue* value, gpointer v_object) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* old; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + old = value->data[0].v_pointer; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (v_object) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = v_object; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (value->data[0].v_pointer); +#line 1168 "FacebookPublishingAuthenticator.c" + } else { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = NULL; +#line 1172 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (old) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (old); +#line 1178 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_value_take_locale_lookup (GValue* value, gpointer v_object) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* old; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + old = value->data[0].v_pointer; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (v_object) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP)); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value))); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = v_object; +#line 1197 "FacebookPublishingAuthenticator.c" + } else { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + value->data[0].v_pointer = NULL; +#line 1201 "FacebookPublishingAuthenticator.c" + } +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (old) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (old); +#line 1207 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_class_init (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass * klass) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_parent_class = g_type_class_peek_parent (klass); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + ((PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass *) klass)->finalize = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_finalize; +#line 1217 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_instance_init (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup * self) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->ref_count = 1; +#line 1224 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_finalize (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* obj) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup * self; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_TYPE_LOCALE_LOOKUP, PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_handlers_destroy (self); +#line 24 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->prefix); +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->translation); +#line 26 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_code); +#line 27 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_translation); +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_code_2); +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (self->exception_translation_2); +#line 1246 "FacebookPublishingAuthenticator.c" +} + + +static GType publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id__volatile)) { + static const GTypeValueTable g_define_type_value_table = { publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_init, publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_free_value, publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_copy_value, publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_peek_pointer, "p", publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_collect_value, "p", publishing_authenticator_shotwell_facebook_web_authentication_pane_value_locale_lookup_lcopy_value }; + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookupClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_instance_init, &g_define_type_value_table }; + static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) }; + GType publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id; + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id = g_type_register_fundamental (g_type_fundamental_next (), "PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup", &g_define_type_info, &g_define_type_fundamental_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id__volatile, publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id); + } + return publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_type_id__volatile; +} + + +static gpointer publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_ref (gpointer instance) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* self; + self = instance; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_atomic_int_inc (&self->ref_count); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return instance; +#line 1271 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_unref (gpointer instance) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* self; + self = instance; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (g_atomic_int_dec_and_test (&self->ref_count)) { +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_WEB_AUTHENTICATION_PANE_LOCALE_LOOKUP_GET_CLASS (self)->finalize (self); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_type_free_instance ((GTypeInstance *) self); +#line 1284 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_class_init (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass * klass) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp0_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp1_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp2_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp3_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp4_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp5_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp6_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp7_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp8_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp9_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp10_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp11_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp12_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp13_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp14_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp15_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp16_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp17_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp18_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp19_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp20_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp21_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp22_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp23_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp24_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp25_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp26_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp27_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp28_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp29_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp30_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp31_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp32_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp33_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp34_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp35_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp36_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp37_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp38_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp39_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp40_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp41_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp42_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp43_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup* _tmp44_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup** _tmp45_ = NULL; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_parent_class = g_type_class_peek_parent (klass); +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + ((ShotwellPluginsCommonWebAuthenticationPaneClass *) klass)->on_page_load = publishing_authenticator_shotwell_facebook_web_authentication_pane_real_on_page_load; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_facebook_web_authentication_pane_finalize; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_new ("login_succeeded", PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_new ("login_failed", PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("es", "es-la", "ES", "es-es", NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("en", "en-gb", "US", "en-us", NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("fr", "fr-fr", "CA", "fr-ca", NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("pt", "pt-br", "PT", "pt-pt", NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("zh", "zh-cn", "HK", "zh-hk", "TW", "zh-tw"); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("af", "af-za", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp6_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ar", "ar-ar", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("nb", "nb-no", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("no", "nb-no", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp9_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("id", "id-id", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp10_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ms", "ms-my", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp11_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ca", "ca-es", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp12_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("cs", "cs-cz", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp13_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("cy", "cy-gb", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp14_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("da", "da-dk", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp15_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("de", "de-de", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp16_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("tl", "tl-ph", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp17_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ko", "ko-kr", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp18_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("hr", "hr-hr", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp19_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("it", "it-it", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp20_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("lt", "lt-lt", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp21_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("hu", "hu-hu", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp22_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("nl", "nl-nl", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp23_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ja", "ja-jp", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp24_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("nb", "nb-no", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp25_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("no", "nb-no", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp26_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("pl", "pl-pl", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp27_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ro", "ro-ro", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp28_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ru", "ru-ru", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp29_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("sk", "sk-sk", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp30_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("sl", "sl-si", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp31_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("sv", "sv-se", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp32_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("th", "th-th", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp33_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("vi", "vi-vn", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp34_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("tr", "tr-tr", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp35_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("el", "el-gr", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp36_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("bg", "bg-bg", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp37_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("sr", "sr-rs", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp38_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("he", "he-il", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp39_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("hi", "hi-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp40_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("bn", "bn-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp41_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("pa", "pa-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp42_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ta", "ta-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp43_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("te", "te-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp44_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_new ("ml", "ml-in", NULL, NULL, NULL, NULL); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_ = g_new0 (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneLocaleLookup*, 45 + 1); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[0] = _tmp0_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[1] = _tmp1_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[2] = _tmp2_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[3] = _tmp3_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[4] = _tmp4_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[5] = _tmp5_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[6] = _tmp6_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[7] = _tmp7_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[8] = _tmp8_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[9] = _tmp9_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[10] = _tmp10_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[11] = _tmp11_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[12] = _tmp12_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[13] = _tmp13_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[14] = _tmp14_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[15] = _tmp15_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[16] = _tmp16_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[17] = _tmp17_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[18] = _tmp18_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[19] = _tmp19_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[20] = _tmp20_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[21] = _tmp21_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[22] = _tmp22_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[23] = _tmp23_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[24] = _tmp24_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[25] = _tmp25_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[26] = _tmp26_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[27] = _tmp27_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[28] = _tmp28_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[29] = _tmp29_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[30] = _tmp30_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[31] = _tmp31_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[32] = _tmp32_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[33] = _tmp33_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[34] = _tmp34_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[35] = _tmp35_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[36] = _tmp36_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[37] = _tmp37_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[38] = _tmp38_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[39] = _tmp39_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[40] = _tmp40_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[41] = _tmp41_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[42] = _tmp42_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[43] = _tmp43_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp45_[44] = _tmp44_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table = _tmp45_; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_web_authentication_pane_locale_lookup_table_length1 = 45; +#line 1532 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_instance_init (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane * self) { +} + + +static void publishing_authenticator_shotwell_facebook_web_authentication_pane_finalize (GObject* obj) { + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane * self; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellFacebookWebAuthenticationPane); +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_facebook_web_authentication_pane_parent_class)->finalize (obj); +#line 1546 "FacebookPublishingAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_facebook_web_authentication_pane_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFacebookWebAuthenticationPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_facebook_web_authentication_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_facebook_web_authentication_pane_instance_init, NULL }; + GType publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id; + publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id = g_type_register_static (SHOTWELL_PLUGINS_COMMON_TYPE_WEB_AUTHENTICATION_PANE, "PublishingAuthenticatorShotwellFacebookWebAuthenticationPane", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id__volatile, publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id); + } + return publishing_authenticator_shotwell_facebook_web_authentication_pane_type_id__volatile; +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 172 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self ? g_object_ref (self) : NULL; +#line 1565 "FacebookPublishingAuthenticator.c" +} + + +static void _g_free0_ (gpointer var) { +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + var = (g_free (var), NULL); +#line 1572 "FacebookPublishingAuthenticator.c" +} + + +static void _g_variant_unref0_ (gpointer var) { +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)); +#line 1579 "FacebookPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_construct (GType object_type, SpitPublishingPluginHost* host) { + PublishingAuthenticatorShotwellFacebookFacebook * self = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + GHashFunc _tmp2_ = NULL; + GEqualFunc _tmp3_ = NULL; + GHashTable* _tmp4_ = NULL; +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (SPIT_PUBLISHING_IS_PLUGIN_HOST (host), NULL); +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFacebookFacebook*) g_object_new (object_type, NULL); +#line 172 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = host; +#line 172 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#line 172 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 172 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->priv->host = _tmp1_; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = g_str_hash; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = g_str_equal; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, _g_variant_unref0_); +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->priv->params = _tmp4_; +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self; +#line 1614 "FacebookPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_new (SpitPublishingPluginHost* host) { +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_facebook_facebook_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, host); +#line 1621 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_real_authenticate (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFacebookFacebook * self; + gboolean _tmp0_ = FALSE; + gboolean _tmp6_ = FALSE; +#line 176 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_facebook_is_persistent_session_valid (self); +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp0_) { +#line 1635 "FacebookPublishingAuthenticator.c" + gchar* access_token = NULL; + gchar* _tmp1_ = NULL; + GHashTable* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + GVariant* _tmp5_ = NULL; +#line 181 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = publishing_authenticator_shotwell_facebook_facebook_get_persistent_access_token (self); +#line 181 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + access_token = _tmp1_; +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = self->priv->params; +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = g_strdup ("AccessToken"); +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = access_token; +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = g_variant_new_string (_tmp4_); +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_variant_ref_sink (_tmp5_); +#line 182 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_hash_table_insert (_tmp2_, _tmp3_, _tmp5_); +#line 183 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authenticated"); +#line 184 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 184 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return; +#line 1664 "FacebookPublishingAuthenticator.c" + } +#line 188 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp6_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_is_cache_dirty (); +#line 188 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp6_) { +#line 1670 "FacebookPublishingAuthenticator.c" + SpitPublishingPluginHost* _tmp7_ = NULL; + SpitPublishingPluginHost* _tmp8_ = NULL; +#line 189 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = self->priv->host; +#line 189 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp7_, FALSE); +#line 190 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = self->priv->host; +#line 190 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_static_message_pane (_tmp8_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_RESTART_ERROR_MESSAGE, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 1681 "FacebookPublishingAuthenticator.c" + } else { +#line 193 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_do_show_service_welcome_pane (self); +#line 1685 "FacebookPublishingAuthenticator.c" + } +} + + +static gboolean publishing_authenticator_shotwell_facebook_facebook_real_can_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFacebookFacebook * self; + gboolean result = FALSE; +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 198 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = TRUE; +#line 198 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 1699 "FacebookPublishingAuthenticator.c" +} + + +static gpointer _g_hash_table_ref0 (gpointer self) { +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return self ? g_hash_table_ref (self) : NULL; +#line 1706 "FacebookPublishingAuthenticator.c" +} + + +static GHashTable* publishing_authenticator_shotwell_facebook_facebook_real_get_authentication_parameter (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFacebookFacebook * self; + GHashTable* result = NULL; + GHashTable* _tmp0_ = NULL; + GHashTable* _tmp1_ = NULL; +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = self->priv->params; +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = _g_hash_table_ref0 (_tmp0_); +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp1_; +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 1725 "FacebookPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_facebook_facebook_invalidate_persistent_session (PublishingAuthenticatorShotwellFacebookFacebook* self) { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 206 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:206: invalidating saved Facebook " \ +"session."); +#line 207 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_set_persistent_access_token (self, ""); +#line 1736 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_real_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFacebookFacebook * self; +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_invalidate_persistent_session (self); +#line 1746 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_real_refresh (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFacebookFacebook * self; +#line 214 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 1754 "FacebookPublishingAuthenticator.c" +} + + +static gboolean publishing_authenticator_shotwell_facebook_facebook_is_persistent_session_valid (PublishingAuthenticatorShotwellFacebookFacebook* self) { + gboolean result = FALSE; + gchar* token = NULL; + gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + const gchar* _tmp3_ = NULL; +#line 219 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self), FALSE); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_facebook_facebook_get_persistent_access_token (self); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + token = _tmp0_; +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = token; +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp1_ != NULL) { +#line 1774 "FacebookPublishingAuthenticator.c" + const gchar* _tmp2_ = NULL; +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = token; +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:223: existing Facebook session fo" \ +"und in configuration database (access_token = %s).", _tmp2_); +#line 1780 "FacebookPublishingAuthenticator.c" + } else { +#line 226 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:226: no existing Facebook session" \ +" available."); +#line 1784 "FacebookPublishingAuthenticator.c" + } +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = token; +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp3_ != NULL; +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (token); +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 1794 "FacebookPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_facebook_facebook_get_persistent_access_token (PublishingAuthenticatorShotwellFacebookFacebook* self) { + gchar* result = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 231 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self), NULL); +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_token", NULL); +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + result = _tmp1_; +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return result; +#line 1812 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_set_persistent_access_token (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* access_token) { + SpitPublishingPluginHost* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 235 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 235 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (access_token != NULL); +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = access_token; +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_token", _tmp1_); +#line 1829 "FacebookPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_facebook_facebook_on_login_clicked_spit_publishing_login_callback (gpointer self) { +#line 242 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_on_login_clicked ((PublishingAuthenticatorShotwellFacebookFacebook*) self); +#line 1836 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_do_show_service_welcome_pane (PublishingAuthenticatorShotwellFacebookFacebook* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; +#line 239 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:240: ACTION: showing service welc" \ +"ome pane."); +#line 242 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 242 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_welcome_pane (_tmp0_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_SERVICE_WELCOME_MESSAGE, _publishing_authenticator_shotwell_facebook_facebook_on_login_clicked_spit_publishing_login_callback, self); +#line 243 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 243 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp1_, FALSE); +#line 1855 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_on_login_clicked (PublishingAuthenticatorShotwellFacebookFacebook* self) { +#line 246 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 247 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:247: EVENT: user clicked 'Login' " \ +"on welcome pane."); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_do_hosted_web_authentication (self); +#line 1866 "FacebookPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_succeeded (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _sender, const gchar* success_url, gpointer self) { +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded ((PublishingAuthenticatorShotwellFacebookFacebook*) self, success_url); +#line 1873 "FacebookPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_failed (PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _sender, gpointer self) { +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed ((PublishingAuthenticatorShotwellFacebookFacebook*) self); +#line 1880 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_do_hosted_web_authentication (PublishingAuthenticatorShotwellFacebookFacebook* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _tmp1_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _tmp2_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _tmp3_ = NULL; + SpitPublishingPluginHost* _tmp4_ = NULL; + PublishingAuthenticatorShotwellFacebookWebAuthenticationPane* _tmp5_ = NULL; +#line 252 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 253 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:253: ACTION: doing hosted web aut" \ +"hentication."); +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE); +#line 257 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = publishing_authenticator_shotwell_facebook_web_authentication_pane_new (); +#line 257 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->web_auth_pane); +#line 257 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->priv->web_auth_pane = _tmp1_; +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = self->priv->web_auth_pane; +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_connect_object (_tmp2_, "login-succeeded", (GCallback) _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_succeeded, self, 0); +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = self->priv->web_auth_pane; +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_connect_object (_tmp3_, "login-failed", (GCallback) _publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed_publishing_authenticator_shotwell_facebook_web_authentication_pane_login_failed, self, 0); +#line 261 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 261 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = self->priv->web_auth_pane; +#line 261 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_dialog_pane (_tmp4_, G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 1919 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_succeeded (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* success_url) { + const gchar* _tmp0_ = NULL; +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (success_url != NULL); +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:267: EVENT: hosted web login succ" \ +"eeded."); +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = success_url; +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_do_authenticate_session (self, _tmp0_); +#line 1935 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_on_web_auth_pane_login_failed (PublishingAuthenticatorShotwellFacebookFacebook* self) { +#line 272 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 273 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:273: EVENT: hosted web login fail" \ +"ed."); +#line 281 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_do_show_service_welcome_pane (self); +#line 1946 "FacebookPublishingAuthenticator.c" +} + + +static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 987 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 987 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, 0); +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = needle; +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 990 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 990 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 1973 "FacebookPublishingAuthenticator.c" + gchar* _tmp4_ = NULL; +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 1981 "FacebookPublishingAuthenticator.c" + } else { +#line 993 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = -1; +#line 993 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 1987 "FacebookPublishingAuthenticator.c" + } +} + + +static void publishing_authenticator_shotwell_facebook_facebook_do_authenticate_session (PublishingAuthenticatorShotwellFacebookFacebook* self, const gchar* good_login_uri) { + const gchar* _tmp0_ = NULL; + gchar* decoded_uri = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* access_token = NULL; + gint index = 0; + const gchar* _tmp3_ = NULL; + gint _tmp4_ = 0; + gint _tmp5_ = 0; + const gchar* _tmp12_ = NULL; + gchar* trailing_params = NULL; + const gchar* _tmp16_ = NULL; + gint _tmp17_ = 0; + gint _tmp18_ = 0; + const gchar* _tmp25_ = NULL; + const gchar* _tmp29_ = NULL; + gchar* _tmp30_ = NULL; + GHashTable* _tmp31_ = NULL; + gchar* _tmp32_ = NULL; + const gchar* _tmp33_ = NULL; + GVariant* _tmp34_ = NULL; + const gchar* _tmp35_ = NULL; +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK (self)); +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_return_if_fail (good_login_uri != NULL); +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp0_ = good_login_uri; +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_debug ("FacebookPublishingAuthenticator.vala:285: ACTION: preparing to extract" \ +" session information encoded in uri = '%s'", _tmp0_); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp1_ = good_login_uri; +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp2_ = soup_uri_decode (_tmp1_); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + decoded_uri = _tmp2_; +#line 292 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + access_token = NULL; +#line 293 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp3_ = decoded_uri; +#line 293 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp4_ = string_index_of (_tmp3_, "#access_token=", 0); +#line 293 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + index = _tmp4_; +#line 294 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp5_ = index; +#line 294 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp5_ >= 0) { +#line 2041 "FacebookPublishingAuthenticator.c" + const gchar* _tmp6_ = NULL; + gint _tmp7_ = 0; + const gchar* _tmp8_ = NULL; + gint _tmp9_ = 0; + gint _tmp10_ = 0; + gchar* _tmp11_ = NULL; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp6_ = decoded_uri; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp7_ = index; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp8_ = decoded_uri; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp9_ = strlen (_tmp8_); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp10_ = _tmp9_; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp11_ = string_slice (_tmp6_, (glong) _tmp7_, (glong) _tmp10_); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + access_token = _tmp11_; +#line 2064 "FacebookPublishingAuthenticator.c" + } +#line 296 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp12_ = access_token; +#line 296 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp12_ == NULL) { +#line 2070 "FacebookPublishingAuthenticator.c" + SpitPublishingPluginHost* _tmp13_ = NULL; + GError* _tmp14_ = NULL; + GError* _tmp15_ = NULL; +#line 297 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp13_ = self->priv->host; +#line 297 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp14_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "Server redirect URL contained no access token"); +#line 297 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp15_ = _tmp14_; +#line 297 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp13_, _tmp15_); +#line 297 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_error_free0 (_tmp15_); +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (decoded_uri); +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + return; +#line 2090 "FacebookPublishingAuthenticator.c" + } +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + trailing_params = NULL; +#line 304 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp16_ = access_token; +#line 304 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp17_ = string_index_of_char (_tmp16_, (gunichar) '&', 0); +#line 304 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + index = _tmp17_; +#line 305 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp18_ = index; +#line 305 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp18_ >= 0) { +#line 2104 "FacebookPublishingAuthenticator.c" + const gchar* _tmp19_ = NULL; + gint _tmp20_ = 0; + const gchar* _tmp21_ = NULL; + gint _tmp22_ = 0; + gint _tmp23_ = 0; + gchar* _tmp24_ = NULL; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp19_ = access_token; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp20_ = index; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp21_ = access_token; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp22_ = strlen (_tmp21_); +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp23_ = _tmp22_; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp24_ = string_slice (_tmp19_, (glong) _tmp20_, (glong) _tmp23_); +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (trailing_params); +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + trailing_params = _tmp24_; +#line 2127 "FacebookPublishingAuthenticator.c" + } +#line 307 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp25_ = trailing_params; +#line 307 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + if (_tmp25_ != NULL) { +#line 2133 "FacebookPublishingAuthenticator.c" + const gchar* _tmp26_ = NULL; + const gchar* _tmp27_ = NULL; + gchar* _tmp28_ = NULL; +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp26_ = access_token; +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp27_ = trailing_params; +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp28_ = string_replace (_tmp26_, _tmp27_, ""); +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + access_token = _tmp28_; +#line 2147 "FacebookPublishingAuthenticator.c" + } +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp29_ = access_token; +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp30_ = string_replace (_tmp29_, "#access_token=", ""); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + access_token = _tmp30_; +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp31_ = self->priv->params; +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp32_ = g_strdup ("AccessToken"); +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp33_ = access_token; +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp34_ = g_variant_new_string (_tmp33_); +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_variant_ref_sink (_tmp34_); +#line 312 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_hash_table_insert (_tmp31_, _tmp32_, _tmp34_); +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _tmp35_ = access_token; +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_set_persistent_access_token (self, _tmp35_); +#line 315 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authenticated"); +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (trailing_params); +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (access_token); +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_free0 (decoded_uri); +#line 2181 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_class_init (PublishingAuthenticatorShotwellFacebookFacebookClass * klass) { +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_parent_class = g_type_class_peek_parent (klass); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + g_type_class_add_private (klass, sizeof (PublishingAuthenticatorShotwellFacebookFacebookPrivate)); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_facebook_facebook_finalize; +#line 2192 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_spit_publishing_authenticator_interface_init (SpitPublishingAuthenticatorIface * iface) { +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + publishing_authenticator_shotwell_facebook_facebook_spit_publishing_authenticator_parent_iface = g_type_interface_peek_parent (iface); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + iface->authenticate = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_facebook_facebook_real_authenticate; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + iface->can_logout = (gboolean (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_facebook_facebook_real_can_logout; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + iface->get_authentication_parameter = (GHashTable* (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_facebook_facebook_real_get_authentication_parameter; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + iface->logout = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_facebook_facebook_real_logout; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + iface->refresh = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_facebook_facebook_real_refresh; +#line 2209 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_instance_init (PublishingAuthenticatorShotwellFacebookFacebook * self) { +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->priv = PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_GET_PRIVATE (self); +#line 162 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self->priv->web_auth_pane = NULL; +#line 2218 "FacebookPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_facebook_facebook_finalize (GObject* obj) { + PublishingAuthenticatorShotwellFacebookFacebook * self; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook); +#line 161 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 162 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->web_auth_pane); +#line 163 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_facebook_facebook_parent_class)->finalize (obj); +#line 2234 "FacebookPublishingAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_facebook_facebook_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_facebook_facebook_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_facebook_facebook_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFacebookFacebookClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_facebook_facebook_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFacebookFacebook), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_facebook_facebook_instance_init, NULL }; + static const GInterfaceInfo spit_publishing_authenticator_info = { (GInterfaceInitFunc) publishing_authenticator_shotwell_facebook_facebook_spit_publishing_authenticator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType publishing_authenticator_shotwell_facebook_facebook_type_id; + publishing_authenticator_shotwell_facebook_facebook_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingAuthenticatorShotwellFacebookFacebook", &g_define_type_info, 0); + g_type_add_interface_static (publishing_authenticator_shotwell_facebook_facebook_type_id, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, &spit_publishing_authenticator_info); + g_once_init_leave (&publishing_authenticator_shotwell_facebook_facebook_type_id__volatile, publishing_authenticator_shotwell_facebook_facebook_type_id); + } + return publishing_authenticator_shotwell_facebook_facebook_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + +static gint _vala_array_length (gpointer array) { + int length; + length = 0; + if (array) { + while (((gpointer*) array)[length]) { + length++; + } + } + return length; +} + + + diff --git a/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala b/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala new file mode 100644 index 0000000..26a2363 --- /dev/null +++ b/plugins/authenticator/shotwell/FacebookPublishingAuthenticator.vala @@ -0,0 +1,318 @@ +/* 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. + */ + +using Shotwell; +using Shotwell.Plugins; + +namespace Publishing.Authenticator.Shotwell.Facebook { + private const string APPLICATION_ID = "1612018629063184"; + + private class WebAuthenticationPane : 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; + } + } + + internal class Facebook : Spit.Publishing.Authenticator, GLib.Object { + private Spit.Publishing.PluginHost host; + private Publishing.Authenticator.Shotwell.Facebook.WebAuthenticationPane web_auth_pane = null; + private GLib.HashTable 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 Facebook(Spit.Publishing.PluginHost host) { + this.host = host; + this.params = new GLib.HashTable(str_hash, str_equal); + } + + public void authenticate() { + // Do we have saved user credentials? If so, go ahead and authenticate the session + // with the saved credentials and proceed with the publishing interaction. Otherwise, show + // the Welcome pane + if (is_persistent_session_valid()) { + var access_token = get_persistent_access_token(); + this.params.insert("AccessToken", new Variant.string(access_token)); + this.authenticated(); + return; + } + + // 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 get_authentication_parameter() { + return this.params; + } + + public void invalidate_persistent_session() { + debug("invalidating saved Facebook session."); + set_persistent_access_token(""); + } + + public void logout() { + invalidate_persistent_session(); + } + + public void refresh() { + // No-Op with Flickr + } + + /* Private functions */ + private bool is_persistent_session_valid() { + string? token = get_persistent_access_token(); + + if (token != null) + debug("existing Facebook session found in configuration database (access_token = %s).", + token); + else + debug("no existing Facebook session available."); + + return token != null; + } + + private string? get_persistent_access_token() { + return host.get_config_string("access_token", null); + } + + private void set_persistent_access_token(string access_token) { + host.set_config_string("access_token", access_token); + } + + 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)); + set_persistent_access_token(access_token); + + this.authenticated(); + } + } +} // namespace Publishing.Facebook; diff --git a/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.c b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.c new file mode 100644 index 0000000..033eb84 --- /dev/null +++ b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.c @@ -0,0 +1,3687 @@ +/* FlickrPublishingAuthenticator.c generated by valac 0.34.4, the Vala compiler + * generated from FlickrPublishingAuthenticator.vala, do not modify */ + +/* 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. + */ + +#include +#include +#include +#include +#include "shotwell-plugin-common.h" +#include "shotwell-plugin-dev-1.0.h" +#include +#include +#include + + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION (publishing_authenticator_shotwell_flickr_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, PublishingAuthenticatorShotwellFlickrTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, PublishingAuthenticatorShotwellFlickrTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, PublishingAuthenticatorShotwellFlickrTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrTransaction PublishingAuthenticatorShotwellFlickrTransaction; +typedef struct _PublishingAuthenticatorShotwellFlickrTransactionClass PublishingAuthenticatorShotwellFlickrTransactionClass; +typedef struct _PublishingAuthenticatorShotwellFlickrTransactionPrivate PublishingAuthenticatorShotwellFlickrTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION (publishing_authenticator_shotwell_flickr_session_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSession)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSessionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSessionClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrSession PublishingAuthenticatorShotwellFlickrSession; +typedef struct _PublishingAuthenticatorShotwellFlickrSessionClass PublishingAuthenticatorShotwellFlickrSessionClass; +#define _g_free0(var) (var = (g_free (var), NULL)) +#define _publishing_rest_support_session_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_session_unref (var), NULL))) +typedef struct _PublishingAuthenticatorShotwellFlickrSessionPrivate PublishingAuthenticatorShotwellFlickrSessionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION (publishing_authenticator_shotwell_flickr_authentication_request_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_AUTHENTICATION_REQUEST_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION, PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_AUTHENTICATION_REQUEST_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION, PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_AUTHENTICATION_REQUEST_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_AUTHENTICATION_REQUEST_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_AUTHENTICATION_REQUEST_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION, PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction; +typedef struct _PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass; +typedef struct _PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionPrivate PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION (publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ACCESS_TOKEN_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION, PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ACCESS_TOKEN_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION, PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_ACCESS_TOKEN_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_ACCESS_TOKEN_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ACCESS_TOKEN_FETCH_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION, PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction; +typedef struct _PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass; +typedef struct _PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionPrivate PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE (publishing_authenticator_shotwell_flickr_pin_entry_pane_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPaneClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_PIN_ENTRY_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_PIN_ENTRY_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPaneClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrPinEntryPane PublishingAuthenticatorShotwellFlickrPinEntryPane; +typedef struct _PublishingAuthenticatorShotwellFlickrPinEntryPaneClass PublishingAuthenticatorShotwellFlickrPinEntryPaneClass; +typedef struct _PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_slist_free0(var) ((var == NULL) ? NULL : (var = (g_slist_free (var), NULL))) + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR (publishing_authenticator_shotwell_flickr_flickr_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickrClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickrClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrFlickr PublishingAuthenticatorShotwellFlickrFlickr; +typedef struct _PublishingAuthenticatorShotwellFlickrFlickrClass PublishingAuthenticatorShotwellFlickrFlickrClass; +typedef struct _PublishingAuthenticatorShotwellFlickrFlickrPrivate PublishingAuthenticatorShotwellFlickrFlickrPrivate; +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) +#define _publishing_rest_support_transaction_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_transaction_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _PublishingAuthenticatorShotwellFlickrTransaction { + PublishingRESTSupportTransaction parent_instance; + PublishingAuthenticatorShotwellFlickrTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrTransactionClass { + PublishingRESTSupportTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrSession { + PublishingRESTSupportSession parent_instance; + PublishingAuthenticatorShotwellFlickrSessionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrSessionClass { + PublishingRESTSupportSessionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrSessionPrivate { + gchar* request_phase_token; + gchar* request_phase_token_secret; + gchar* access_phase_token; + gchar* access_phase_token_secret; + gchar* username; + gchar* consumer_key; + gchar* consumer_secret; +}; + +struct _PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction { + PublishingAuthenticatorShotwellFlickrTransaction parent_instance; + PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass { + PublishingAuthenticatorShotwellFlickrTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction { + PublishingAuthenticatorShotwellFlickrTransaction parent_instance; + PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass { + PublishingAuthenticatorShotwellFlickrTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrPinEntryPane { + GObject parent_instance; + PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrPinEntryPaneClass { + GObjectClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate { + GtkBox* pane_widget; + GtkButton* continue_button; + GtkEntry* pin_entry; + GtkLabel* pin_entry_caption; + GtkLabel* explanatory_text; + GtkBuilder* builder; +}; + +struct _PublishingAuthenticatorShotwellFlickrFlickr { + GObject parent_instance; + PublishingAuthenticatorShotwellFlickrFlickrPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellFlickrFlickrClass { + GObjectClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellFlickrFlickrPrivate { + GHashTable* params; + PublishingAuthenticatorShotwellFlickrSession* session; + SpitPublishingPluginHost* host; +}; + + +static gpointer publishing_authenticator_shotwell_flickr_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_flickr_session_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_flickr_authentication_request_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_flickr_pin_entry_pane_parent_class = NULL; +static SpitPublishingDialogPaneIface* publishing_authenticator_shotwell_flickr_pin_entry_pane_spit_publishing_dialog_pane_parent_iface = NULL; +static gpointer publishing_authenticator_shotwell_flickr_flickr_parent_class = NULL; +static SpitPublishingAuthenticatorIface* publishing_authenticator_shotwell_flickr_flickr_spit_publishing_authenticator_parent_iface = NULL; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ENDPOINT_URL "https://api.flickr.com/services/rest" +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_EXPIRED_SESSION_ERROR_CODE "98" +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ENCODE_RFC_3986_EXTRA "!*'();:@&=+$,/?%#[] \\" +GType publishing_authenticator_shotwell_flickr_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TRANSACTION_DUMMY_PROPERTY +}; +GType publishing_authenticator_shotwell_flickr_session_get_type (void) G_GNUC_CONST; +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session, PublishingRESTSupportHttpMethod method); +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, PublishingRESTSupportHttpMethod method); +static void publishing_authenticator_shotwell_flickr_transaction_setup_arguments (PublishingAuthenticatorShotwellFlickrTransaction* self); +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_new_with_uri (PublishingAuthenticatorShotwellFlickrSession* session, const gchar* uri, PublishingRESTSupportHttpMethod method); +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_construct_with_uri (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, const gchar* uri, PublishingRESTSupportHttpMethod method); +gchar* publishing_authenticator_shotwell_flickr_session_get_oauth_nonce (PublishingAuthenticatorShotwellFlickrSession* self); +gchar* publishing_authenticator_shotwell_flickr_session_get_oauth_timestamp (PublishingAuthenticatorShotwellFlickrSession* self); +gchar* publishing_authenticator_shotwell_flickr_session_get_consumer_key (PublishingAuthenticatorShotwellFlickrSession* self); +static void publishing_authenticator_shotwell_flickr_transaction_real_execute (PublishingRESTSupportTransaction* base, GError** error); +void publishing_authenticator_shotwell_flickr_session_sign_transaction (PublishingAuthenticatorShotwellFlickrSession* self, PublishingRESTSupportTransaction* txn); +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSessionPrivate)) +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellFlickrSession* publishing_authenticator_shotwell_flickr_session_new (void); +PublishingAuthenticatorShotwellFlickrSession* publishing_authenticator_shotwell_flickr_session_construct (GType object_type); +static gboolean publishing_authenticator_shotwell_flickr_session_real_is_authenticated (PublishingRESTSupportSession* base); +void publishing_authenticator_shotwell_flickr_session_authenticate_from_persistent_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret, const gchar* username); +void publishing_authenticator_shotwell_flickr_session_deauthenticate (PublishingAuthenticatorShotwellFlickrSession* self); +void publishing_authenticator_shotwell_flickr_session_set_api_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* consumer_key, const gchar* consumer_secret); +void publishing_authenticator_shotwell_flickr_session_set_request_phase_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret); +void publishing_authenticator_shotwell_flickr_session_set_access_phase_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret, const gchar* username); +gchar* publishing_authenticator_shotwell_flickr_session_get_request_phase_token (PublishingAuthenticatorShotwellFlickrSession* self); +gchar* publishing_authenticator_shotwell_flickr_session_get_access_phase_token (PublishingAuthenticatorShotwellFlickrSession* self); +gchar* publishing_authenticator_shotwell_flickr_session_get_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrSession* self); +gchar* publishing_authenticator_shotwell_flickr_session_get_username (PublishingAuthenticatorShotwellFlickrSession* self); +static void publishing_authenticator_shotwell_flickr_session_finalize (PublishingRESTSupportSession* obj); +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_KEY "60dd96d4a2ad04888b09c9e18d82c26f" +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_SECRET "d0960565e03547c1" +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SERVICE_WELCOME_MESSAGE _ ("You are not currently logged into Flickr.\n" \ +"\n" \ +"Click Log in to log into Flickr in your Web browser. You will have to " \ +"authorize Shotwell Connect to link to your Flickr account.") +GType publishing_authenticator_shotwell_flickr_authentication_request_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_AUTHENTICATION_REQUEST_TRANSACTION_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* publishing_authenticator_shotwell_flickr_authentication_request_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session); +PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* publishing_authenticator_shotwell_flickr_authentication_request_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session); +GType publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ACCESS_TOKEN_FETCH_TRANSACTION_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session, const gchar* user_verifier); +PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, const gchar* user_verifier); +GType publishing_authenticator_shotwell_flickr_pin_entry_pane_get_type (void) G_GNUC_CONST; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate)) +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellFlickrPinEntryPane* publishing_authenticator_shotwell_flickr_pin_entry_pane_new (GtkBuilder* builder); +PublishingAuthenticatorShotwellFlickrPinEntryPane* publishing_authenticator_shotwell_flickr_pin_entry_pane_construct (GType object_type, GtkBuilder* builder); +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed (PublishingAuthenticatorShotwellFlickrPinEntryPane* self); +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked (PublishingAuthenticatorShotwellFlickrPinEntryPane* self); +static GtkWidget* publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_widget (SpitPublishingDialogPane* base); +static SpitPublishingDialogPaneGeometryOptions publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base); +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_installed (SpitPublishingDialogPane* base); +static void _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self); +static void _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self); +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base); +static void g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data); +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_finalize (GObject* obj); +GType publishing_authenticator_shotwell_flickr_flickr_get_type (void) G_GNUC_CONST; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickrPrivate)) +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_DUMMY_PROPERTY +}; +static void publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void _publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated_publishing_rest_support_session_authenticated (PublishingRESTSupportSession* _sender, gpointer self); +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_new (SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_construct (GType object_type, SpitPublishingPluginHost* host); +static void _g_free0_ (gpointer var); +static void _g_variant_unref0_ (gpointer var); +static GVariant* _variant_new1 (const gchar* value); +static GVariant* _variant_new2 (const gchar* value); +void publishing_authenticator_shotwell_flickr_flickr_invalidate_persistent_session (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token); +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* secret); +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_username (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* username); +static gboolean publishing_authenticator_shotwell_flickr_flickr_is_persistent_session_valid (PublishingAuthenticatorShotwellFlickrFlickr* self); +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_username (PublishingAuthenticatorShotwellFlickrFlickr* self); +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token (PublishingAuthenticatorShotwellFlickrFlickr* self); +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void publishing_authenticator_shotwell_flickr_flickr_real_authenticate (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_flickr_flickr_do_show_login_welcome_pane (PublishingAuthenticatorShotwellFlickrFlickr* self); +static gboolean publishing_authenticator_shotwell_flickr_flickr_real_can_logout (SpitPublishingAuthenticator* base); +static GHashTable* publishing_authenticator_shotwell_flickr_flickr_real_get_authentication_parameter (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_flickr_flickr_real_logout (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_flickr_flickr_real_refresh (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void _publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked_spit_publishing_login_callback (gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_do_run_authentication_request_transaction (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn); +static void _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn, GError* err); +static void _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_do_parse_token_info_from_auth_request (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* response); +static void publishing_authenticator_shotwell_flickr_flickr_on_authentication_token_available (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token, const gchar* token_secret); +static void publishing_authenticator_shotwell_flickr_flickr_do_launch_system_browser (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token); +static void publishing_authenticator_shotwell_flickr_flickr_on_system_browser_launched (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void publishing_authenticator_shotwell_flickr_flickr_do_show_pin_entry_pane (PublishingAuthenticatorShotwellFlickrFlickr* self); +static void publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingAuthenticatorShotwellFlickrPinEntryPane* sender, const gchar* pin); +static void _publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed_publishing_authenticator_shotwell_flickr_pin_entry_pane_proceed (PublishingAuthenticatorShotwellFlickrPinEntryPane* _sender, PublishingAuthenticatorShotwellFlickrPinEntryPane* sender, const gchar* authorization_pin, gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_do_verify_pin (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* pin); +static void publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn); +static void _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn, GError* err); +static void _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self); +static void publishing_authenticator_shotwell_flickr_flickr_do_extract_access_phase_credentials_from_reponse (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* response); +static GVariant* _variant_new3 (gchar* value); +static GVariant* _variant_new4 (gchar* value); +static GVariant* _variant_new5 (gchar* value); +static void publishing_authenticator_shotwell_flickr_flickr_finalize (GObject* obj); +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func); +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func); + + +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, PublishingRESTSupportHttpMethod method) { + PublishingAuthenticatorShotwellFlickrTransaction* self = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; + PublishingRESTSupportHttpMethod _tmp1_ = 0; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (session), NULL); +#line 15 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = session; +#line 15 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = method; +#line 15 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrTransaction*) publishing_rest_support_transaction_construct (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), _tmp1_); +#line 16 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_transaction_setup_arguments (self); +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 326 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session, PublishingRESTSupportHttpMethod method) { +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, session, method); +#line 333 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_construct_with_uri (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, const gchar* uri, PublishingRESTSupportHttpMethod method) { + PublishingAuthenticatorShotwellFlickrTransaction* self = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + PublishingRESTSupportHttpMethod _tmp2_ = 0; +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (session), NULL); +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (uri != NULL, NULL); +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = session; +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = uri; +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = method; +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), _tmp1_, _tmp2_); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_transaction_setup_arguments (self); +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 358 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrTransaction* publishing_authenticator_shotwell_flickr_transaction_new_with_uri (PublishingAuthenticatorShotwellFlickrSession* session, const gchar* uri, PublishingRESTSupportHttpMethod method) { +#line 19 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_transaction_construct_with_uri (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, session, uri, method); +#line 365 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_transaction_setup_arguments (PublishingAuthenticatorShotwellFlickrTransaction* self) { + PublishingAuthenticatorShotwellFlickrSession* session = NULL; + PublishingRESTSupportSession* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_TRANSACTION (self)); +#line 26 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = publishing_rest_support_transaction_get_parent_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)); +#line 26 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + session = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSession); +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = publishing_authenticator_shotwell_flickr_session_get_oauth_nonce (session); +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = _tmp1_; +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_nonce", _tmp2_); +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp2_); +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_signature_method", "HMAC-SHA1"); +#line 30 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_version", "1.0"); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_callback", "oob"); +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_flickr_session_get_oauth_timestamp (session); +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_timestamp", _tmp4_); +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp4_); +#line 33 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = publishing_authenticator_shotwell_flickr_session_get_consumer_key (session); +#line 33 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 33 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_consumer_key", _tmp6_); +#line 33 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp6_); +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_session_unref0 (session); +#line 416 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_transaction_real_execute (PublishingRESTSupportTransaction* base, GError** error) { + PublishingAuthenticatorShotwellFlickrTransaction * self; + PublishingRESTSupportSession* _tmp0_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp1_ = NULL; + GError * _inner_error_ = NULL; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, PublishingAuthenticatorShotwellFlickrTransaction); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = publishing_rest_support_transaction_get_parent_session (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSession); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_sign_transaction (_tmp1_, G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction)); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_session_unref0 (_tmp1_); +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + PUBLISHING_REST_SUPPORT_TRANSACTION_CLASS (publishing_authenticator_shotwell_flickr_transaction_parent_class)->execute (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_inner_error_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) { +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_propagate_error (error, _inner_error_); +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 445 "FlickrPublishingAuthenticator.c" + } else { +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 453 "FlickrPublishingAuthenticator.c" + } + } +} + + +static void publishing_authenticator_shotwell_flickr_transaction_class_init (PublishingAuthenticatorShotwellFlickrTransactionClass * klass) { +#line 12 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_transaction_parent_class = g_type_class_peek_parent (klass); +#line 12 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + ((PublishingRESTSupportTransactionClass *) klass)->execute = publishing_authenticator_shotwell_flickr_transaction_real_execute; +#line 464 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_transaction_instance_init (PublishingAuthenticatorShotwellFlickrTransaction * self) { +} + + +GType publishing_authenticator_shotwell_flickr_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_flickr_transaction_type_id; + publishing_authenticator_shotwell_flickr_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellFlickrTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_transaction_type_id__volatile, publishing_authenticator_shotwell_flickr_transaction_type_id); + } + return publishing_authenticator_shotwell_flickr_transaction_type_id__volatile; +} + + +PublishingAuthenticatorShotwellFlickrSession* publishing_authenticator_shotwell_flickr_session_construct (GType object_type) { + PublishingAuthenticatorShotwellFlickrSession* self = NULL; +#line 54 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrSession*) publishing_rest_support_session_construct (object_type, NULL); +#line 53 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 490 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrSession* publishing_authenticator_shotwell_flickr_session_new (void) { +#line 53 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_session_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION); +#line 497 "FlickrPublishingAuthenticator.c" +} + + +static gboolean publishing_authenticator_shotwell_flickr_session_real_is_authenticated (PublishingRESTSupportSession* base) { + PublishingAuthenticatorShotwellFlickrSession * self; + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + const gchar* _tmp2_ = NULL; +#line 57 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSession); +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = self->priv->access_phase_token; +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp2_ != NULL) { +#line 513 "FlickrPublishingAuthenticator.c" + const gchar* _tmp3_ = NULL; +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = self->priv->access_phase_token_secret; +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _tmp3_ != NULL; +#line 519 "FlickrPublishingAuthenticator.c" + } else { +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = FALSE; +#line 523 "FlickrPublishingAuthenticator.c" + } +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp1_) { +#line 527 "FlickrPublishingAuthenticator.c" + const gchar* _tmp4_ = NULL; +#line 59 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = self->priv->username; +#line 59 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = _tmp4_ != NULL; +#line 533 "FlickrPublishingAuthenticator.c" + } else { +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = FALSE; +#line 537 "FlickrPublishingAuthenticator.c" + } +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp0_; +#line 58 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 543 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_authenticate_from_persistent_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret, const gchar* username) { + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 62 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 62 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 62 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (secret != NULL); +#line 62 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (username != NULL); +#line 64 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = token; +#line 64 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 64 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token); +#line 64 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token = _tmp1_; +#line 65 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = secret; +#line 65 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 65 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token_secret); +#line 65 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token_secret = _tmp3_; +#line 66 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = username; +#line 66 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 66 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->username); +#line 66 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->username = _tmp5_; +#line 68 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), "authenticated"); +#line 588 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_deauthenticate (PublishingAuthenticatorShotwellFlickrSession* self) { +#line 71 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 72 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token); +#line 72 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token = NULL; +#line 73 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token_secret); +#line 73 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token_secret = NULL; +#line 74 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->username); +#line 74 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->username = NULL; +#line 607 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_set_api_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* consumer_key, const gchar* consumer_secret) { + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 77 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 77 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (consumer_key != NULL); +#line 77 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (consumer_secret != NULL); +#line 78 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = consumer_key; +#line 78 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 78 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->consumer_key); +#line 78 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->consumer_key = _tmp1_; +#line 79 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = consumer_secret; +#line 79 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 79 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->consumer_secret); +#line 79 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->consumer_secret = _tmp3_; +#line 638 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_sign_transaction (PublishingAuthenticatorShotwellFlickrSession* self, PublishingRESTSupportTransaction* txn) { + gchar* http_method = NULL; + PublishingRESTSupportTransaction* _tmp0_ = NULL; + PublishingRESTSupportHttpMethod _tmp1_ = 0; + gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + PublishingRESTSupportArgument** base_string_arguments = NULL; + PublishingRESTSupportTransaction* _tmp6_ = NULL; + gint _tmp7_ = 0; + PublishingRESTSupportArgument** _tmp8_ = NULL; + gint base_string_arguments_length1 = 0; + gint _base_string_arguments_size_ = 0; + PublishingRESTSupportArgument** sorted_args = NULL; + PublishingRESTSupportArgument** _tmp9_ = NULL; + gint _tmp9__length1 = 0; + gint _tmp10_ = 0; + PublishingRESTSupportArgument** _tmp11_ = NULL; + gint sorted_args_length1 = 0; + gint _sorted_args_size_ = 0; + gchar* arguments_string = NULL; + gchar* _tmp12_ = NULL; + gchar* signing_key = NULL; + const gchar* _tmp35_ = NULL; + gchar* signature_base_string = NULL; + const gchar* _tmp49_ = NULL; + gchar* _tmp50_ = NULL; + gchar* _tmp51_ = NULL; + PublishingRESTSupportTransaction* _tmp52_ = NULL; + gchar* _tmp53_ = NULL; + gchar* _tmp54_ = NULL; + gchar* _tmp55_ = NULL; + gchar* _tmp56_ = NULL; + gchar* _tmp57_ = NULL; + gchar* _tmp58_ = NULL; + gchar* _tmp59_ = NULL; + gchar* _tmp60_ = NULL; + const gchar* _tmp61_ = NULL; + gchar* _tmp62_ = NULL; + gchar* _tmp63_ = NULL; + gchar* _tmp64_ = NULL; + gchar* _tmp65_ = NULL; + const gchar* _tmp66_ = NULL; + gchar* signature = NULL; + const gchar* _tmp67_ = NULL; + gchar* _tmp68_ = NULL; + const gchar* _tmp69_ = NULL; + gchar* _tmp70_ = NULL; + const gchar* _tmp71_ = NULL; + PublishingRESTSupportTransaction* _tmp72_ = NULL; + const gchar* _tmp73_ = NULL; +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = txn; +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = publishing_rest_support_transaction_get_method (_tmp0_); +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = publishing_rest_support_http_method_to_string (_tmp1_); +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + http_method = _tmp2_; +#line 85 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:85: signing transaction with parame" \ +"ters:"); +#line 86 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = http_method; +#line 86 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = g_strconcat ("HTTP method = ", _tmp3_, NULL); +#line 86 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _tmp4_; +#line 86 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:86: %s", _tmp5_); +#line 86 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp5_); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = txn; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = publishing_rest_support_transaction_get_arguments (_tmp6_, &_tmp7_); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + base_string_arguments = _tmp8_; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + base_string_arguments_length1 = _tmp7_; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _base_string_arguments_size_ = base_string_arguments_length1; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = base_string_arguments; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9__length1 = base_string_arguments_length1; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = publishing_rest_support_argument_sort (_tmp9_, _tmp9__length1, &_tmp10_); +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + sorted_args = _tmp11_; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + sorted_args_length1 = _tmp10_; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _sorted_args_size_ = sorted_args_length1; +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = g_strdup (""); +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + arguments_string = _tmp12_; +#line 744 "FlickrPublishingAuthenticator.c" + { + gint i = 0; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + i = 0; +#line 749 "FlickrPublishingAuthenticator.c" + { + gboolean _tmp13_ = FALSE; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = TRUE; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + while (TRUE) { +#line 756 "FlickrPublishingAuthenticator.c" + gint _tmp15_ = 0; + PublishingRESTSupportArgument** _tmp16_ = NULL; + gint _tmp16__length1 = 0; + const gchar* _tmp17_ = NULL; + PublishingRESTSupportArgument** _tmp18_ = NULL; + gint _tmp18__length1 = 0; + gint _tmp19_ = 0; + PublishingRESTSupportArgument* _tmp20_ = NULL; + const gchar* _tmp21_ = NULL; + gchar* _tmp22_ = NULL; + gchar* _tmp23_ = NULL; + PublishingRESTSupportArgument** _tmp24_ = NULL; + gint _tmp24__length1 = 0; + gint _tmp25_ = 0; + PublishingRESTSupportArgument* _tmp26_ = NULL; + const gchar* _tmp27_ = NULL; + gchar* _tmp28_ = NULL; + gchar* _tmp29_ = NULL; + gchar* _tmp30_ = NULL; + gint _tmp31_ = 0; + PublishingRESTSupportArgument** _tmp32_ = NULL; + gint _tmp32__length1 = 0; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (!_tmp13_) { +#line 781 "FlickrPublishingAuthenticator.c" + gint _tmp14_ = 0; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp14_ = i; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + i = _tmp14_ + 1; +#line 787 "FlickrPublishingAuthenticator.c" + } +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = FALSE; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = i; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = sorted_args; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16__length1 = sorted_args_length1; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (!(_tmp15_ < _tmp16__length1)) { +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + break; +#line 801 "FlickrPublishingAuthenticator.c" + } +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp17_ = arguments_string; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp18_ = sorted_args; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp18__length1 = sorted_args_length1; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp19_ = i; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp20_ = _tmp18_[_tmp19_]; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp21_ = _tmp20_->key; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp22_ = g_strconcat (_tmp21_, "=", NULL); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp23_ = _tmp22_; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp24_ = sorted_args; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp24__length1 = sorted_args_length1; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp25_ = i; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp26_ = _tmp24_[_tmp25_]; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp27_ = _tmp26_->value; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp28_ = g_strconcat (_tmp23_, _tmp27_, NULL); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp29_ = _tmp28_; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp30_ = g_strconcat (_tmp17_, _tmp29_, NULL); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (arguments_string); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + arguments_string = _tmp30_; +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp29_); +#line 95 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp23_); +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp31_ = i; +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp32_ = sorted_args; +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp32__length1 = sorted_args_length1; +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp31_ < (_tmp32__length1 - 1)) { +#line 851 "FlickrPublishingAuthenticator.c" + const gchar* _tmp33_ = NULL; + gchar* _tmp34_ = NULL; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp33_ = arguments_string; +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp34_ = g_strconcat (_tmp33_, "&", NULL); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (arguments_string); +#line 97 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + arguments_string = _tmp34_; +#line 862 "FlickrPublishingAuthenticator.c" + } + } + } + } +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signing_key = NULL; +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp35_ = self->priv->access_phase_token_secret; +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp35_ != NULL) { +#line 873 "FlickrPublishingAuthenticator.c" + const gchar* _tmp36_ = NULL; + gchar* _tmp37_ = NULL; + gchar* _tmp38_ = NULL; + const gchar* _tmp39_ = NULL; + gchar* _tmp40_ = NULL; +#line 102 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:102: access phase token secret avai" \ +"lable; using it as signing key"); +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp36_ = self->priv->consumer_secret; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp37_ = g_strconcat (_tmp36_, "&", NULL); +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp38_ = _tmp37_; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp39_ = self->priv->access_phase_token_secret; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp40_ = g_strconcat (_tmp38_, _tmp39_, NULL); +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signing_key); +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signing_key = _tmp40_; +#line 104 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp38_); +#line 897 "FlickrPublishingAuthenticator.c" + } else { + const gchar* _tmp41_ = NULL; +#line 105 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp41_ = self->priv->request_phase_token_secret; +#line 105 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp41_ != NULL) { +#line 904 "FlickrPublishingAuthenticator.c" + const gchar* _tmp42_ = NULL; + gchar* _tmp43_ = NULL; + gchar* _tmp44_ = NULL; + const gchar* _tmp45_ = NULL; + gchar* _tmp46_ = NULL; +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:106: request phase token secret ava" \ +"ilable; using it as signing key"); +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp42_ = self->priv->consumer_secret; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp43_ = g_strconcat (_tmp42_, "&", NULL); +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp44_ = _tmp43_; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp45_ = self->priv->request_phase_token_secret; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp46_ = g_strconcat (_tmp44_, _tmp45_, NULL); +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signing_key); +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signing_key = _tmp46_; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp44_); +#line 928 "FlickrPublishingAuthenticator.c" + } else { + const gchar* _tmp47_ = NULL; + gchar* _tmp48_ = NULL; +#line 110 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:110: %s", "neither access phase nor request phase token secrets available; using " \ +"API " "key as signing key"); +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp47_ = self->priv->consumer_secret; +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp48_ = g_strconcat (_tmp47_, "&", NULL); +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signing_key); +#line 113 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signing_key = _tmp48_; +#line 942 "FlickrPublishingAuthenticator.c" + } + } +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp49_ = http_method; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp50_ = g_strconcat (_tmp49_, "&", NULL); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp51_ = _tmp50_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp52_ = txn; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp53_ = publishing_rest_support_transaction_get_endpoint_url (_tmp52_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp54_ = _tmp53_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp55_ = soup_uri_encode (_tmp54_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ENCODE_RFC_3986_EXTRA); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp56_ = _tmp55_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp57_ = g_strconcat (_tmp51_, _tmp56_, NULL); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp58_ = _tmp57_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp59_ = g_strconcat (_tmp58_, "&", NULL); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp60_ = _tmp59_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp61_ = arguments_string; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp62_ = soup_uri_encode (_tmp61_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ENCODE_RFC_3986_EXTRA); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp63_ = _tmp62_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp64_ = g_strconcat (_tmp60_, _tmp63_, NULL); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp65_ = _tmp64_; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp63_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp60_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp58_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp56_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp54_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp51_); +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signature_base_string = _tmp65_; +#line 120 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:120: signature base string = '%s'", signature_base_string); +#line 122 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp66_ = signing_key; +#line 122 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:122: signing key = '%s'", _tmp66_); +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp67_ = signing_key; +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp68_ = publishing_rest_support_hmac_sha1 (_tmp67_, signature_base_string); +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signature = _tmp68_; +#line 126 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp69_ = signature; +#line 126 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp70_ = soup_uri_encode (_tmp69_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_ENCODE_RFC_3986_EXTRA); +#line 126 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signature); +#line 126 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + signature = _tmp70_; +#line 128 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp71_ = signature; +#line 128 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:128: signature = '%s'", _tmp71_); +#line 130 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp72_ = txn; +#line 130 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp73_ = signature; +#line 130 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (_tmp72_, "oauth_signature", _tmp73_); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signature); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signature_base_string); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (signing_key); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (arguments_string); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + sorted_args = (_vala_array_free (sorted_args, sorted_args_length1, (GDestroyNotify) publishing_rest_support_argument_unref), NULL); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + base_string_arguments = (_vala_array_free (base_string_arguments, base_string_arguments_length1, (GDestroyNotify) publishing_rest_support_argument_unref), NULL); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (http_method); +#line 1037 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_set_request_phase_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret) { + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 133 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 133 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 133 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (secret != NULL); +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = token; +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->request_phase_token); +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->request_phase_token = _tmp1_; +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = secret; +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->request_phase_token_secret); +#line 135 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->request_phase_token_secret = _tmp3_; +#line 1068 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_session_set_access_phase_credentials (PublishingAuthenticatorShotwellFlickrSession* self, const gchar* token, const gchar* secret, const gchar* username) { + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self)); +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (secret != NULL); +#line 138 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (username != NULL); +#line 139 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = token; +#line 139 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup (_tmp0_); +#line 139 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token); +#line 139 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token = _tmp1_; +#line 140 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = secret; +#line 140 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 140 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token_secret); +#line 140 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token_secret = _tmp3_; +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = username; +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->username); +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->username = _tmp5_; +#line 143 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), "authenticated"); +#line 1113 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_oauth_nonce (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + GTimeVal currtime = {0}; + GTimeVal _tmp0_ = {0}; + glong _tmp1_ = 0L; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + GTimeVal _tmp4_ = {0}; + glong _tmp5_ = 0L; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; + gchar* _tmp11_ = NULL; +#line 146 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 147 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_get_current_time (&currtime); +#line 148 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_get_current_time (&currtime); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = currtime; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _tmp0_.tv_sec; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup_printf ("%li", _tmp1_); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = currtime; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _tmp4_.tv_usec; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = g_strdup_printf ("%li", _tmp5_); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = g_strconcat (_tmp3_, _tmp7_, NULL); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = _tmp8_; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = g_compute_checksum_for_string (G_CHECKSUM_MD5, _tmp9_, (gsize) -1); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = _tmp10_; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp9_); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp7_); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp3_); +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp11_; +#line 150 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1172 "FlickrPublishingAuthenticator.c" +} + + +static glong string_strnlen (gchar* str, glong maxlen) { + glong result = 0L; + gchar* end = NULL; + gchar* _tmp0_ = NULL; + glong _tmp1_ = 0L; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = maxlen; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + end = _tmp2_; +#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = end; +#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp3_ == NULL) { +#line 1195 "FlickrPublishingAuthenticator.c" + glong _tmp4_ = 0L; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = maxlen; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 1203 "FlickrPublishingAuthenticator.c" + } else { + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = str; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = (glong) (_tmp5_ - _tmp6_); +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 1215 "FlickrPublishingAuthenticator.c" + } +} + + +static gchar* string_substring (const gchar* self, glong offset, glong len) { + gchar* result = NULL; + glong string_length = 0L; + gboolean _tmp0_ = FALSE; + glong _tmp1_ = 0L; + glong _tmp8_ = 0L; + glong _tmp14_ = 0L; + glong _tmp17_ = 0L; + glong _tmp18_ = 0L; + glong _tmp19_ = 0L; + glong _tmp20_ = 0L; + glong _tmp21_ = 0L; + gchar* _tmp22_ = NULL; +#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = offset; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp1_ >= ((glong) 0)) { +#line 1239 "FlickrPublishingAuthenticator.c" + glong _tmp2_ = 0L; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = len; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = _tmp2_ >= ((glong) 0); +#line 1245 "FlickrPublishingAuthenticator.c" + } else { +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = FALSE; +#line 1249 "FlickrPublishingAuthenticator.c" + } +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 1253 "FlickrPublishingAuthenticator.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; + glong _tmp5_ = 0L; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = offset; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = len; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_); +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + string_length = _tmp5_; +#line 1265 "FlickrPublishingAuthenticator.c" + } else { + gint _tmp6_ = 0; + gint _tmp7_ = 0; +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = strlen (self); +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp7_ = _tmp6_; +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + string_length = (glong) _tmp7_; +#line 1275 "FlickrPublishingAuthenticator.c" + } +#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp8_ = offset; +#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp8_ < ((glong) 0)) { +#line 1281 "FlickrPublishingAuthenticator.c" + glong _tmp9_ = 0L; + glong _tmp10_ = 0L; + glong _tmp11_ = 0L; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp9_ = string_length; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp10_ = offset; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + offset = _tmp9_ + _tmp10_; +#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp11_ = offset; +#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL); +#line 1295 "FlickrPublishingAuthenticator.c" + } else { + glong _tmp12_ = 0L; + glong _tmp13_ = 0L; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp12_ = offset; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp13_ = string_length; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL); +#line 1305 "FlickrPublishingAuthenticator.c" + } +#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp14_ = len; +#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp14_ < ((glong) 0)) { +#line 1311 "FlickrPublishingAuthenticator.c" + glong _tmp15_ = 0L; + glong _tmp16_ = 0L; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp16_ = offset; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + len = _tmp15_ - _tmp16_; +#line 1320 "FlickrPublishingAuthenticator.c" + } +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp17_ = offset; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp18_ = len; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp19_ = string_length; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL); +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp20_ = offset; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp21_ = len; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_); +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp22_; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 1340 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_oauth_timestamp (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + gint64 _tmp0_ = 0LL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; +#line 154 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = g_get_real_time (); +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup_printf ("%" G_GINT64_FORMAT, _tmp0_); +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = _tmp1_; +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = string_substring (_tmp2_, (glong) 0, (glong) 10); +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp2_); +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp4_; +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1369 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_consumer_key (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 158 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 159 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->consumer_key; +#line 159 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp0_ != NULL, "consumer_key != null"); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->consumer_key; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp2_; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1392 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_request_phase_token (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 163 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 164 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->request_phase_token; +#line 164 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp0_ != NULL, "request_phase_token != null"); +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->request_phase_token; +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp2_; +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1415 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_access_phase_token (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 168 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 169 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->access_phase_token; +#line 169 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp0_ != NULL, "access_phase_token != null"); +#line 170 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->access_phase_token; +#line 170 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 170 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp2_; +#line 170 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1438 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 174 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->access_phase_token_secret; +#line 174 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp0_ != NULL, "access_phase_token_secret != null"); +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->access_phase_token_secret; +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp2_; +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1461 "FlickrPublishingAuthenticator.c" +} + + +gchar* publishing_authenticator_shotwell_flickr_session_get_username (PublishingAuthenticatorShotwellFlickrSession* self) { + gchar* result = NULL; + gboolean _tmp0_ = FALSE; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (self), NULL); +#line 179 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession)); +#line 179 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp0_, "is_authenticated()"); +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->username; +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_strdup (_tmp1_); +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp2_; +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1484 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_session_class_init (PublishingAuthenticatorShotwellFlickrSessionClass * klass) { +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_parent_class = g_type_class_peek_parent (klass); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + ((PublishingRESTSupportSessionClass *) klass)->finalize = publishing_authenticator_shotwell_flickr_session_finalize; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_type_class_add_private (klass, sizeof (PublishingAuthenticatorShotwellFlickrSessionPrivate)); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + ((PublishingRESTSupportSessionClass *) klass)->is_authenticated = publishing_authenticator_shotwell_flickr_session_real_is_authenticated; +#line 1497 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_session_instance_init (PublishingAuthenticatorShotwellFlickrSession * self) { +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv = PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SESSION_GET_PRIVATE (self); +#line 45 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->request_phase_token = NULL; +#line 46 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->request_phase_token_secret = NULL; +#line 47 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token = NULL; +#line 48 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->access_phase_token_secret = NULL; +#line 49 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->username = NULL; +#line 50 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->consumer_key = NULL; +#line 51 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->consumer_secret = NULL; +#line 1518 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_session_finalize (PublishingRESTSupportSession* obj) { + PublishingAuthenticatorShotwellFlickrSession * self; +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_SESSION, PublishingAuthenticatorShotwellFlickrSession); +#line 45 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->request_phase_token); +#line 46 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->request_phase_token_secret); +#line 47 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token); +#line 48 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->access_phase_token_secret); +#line 49 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->username); +#line 50 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->consumer_key); +#line 51 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (self->priv->consumer_secret); +#line 44 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + PUBLISHING_REST_SUPPORT_SESSION_CLASS (publishing_authenticator_shotwell_flickr_session_parent_class)->finalize (obj); +#line 1542 "FlickrPublishingAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_flickr_session_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_session_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_session_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrSessionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_session_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrSession), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_session_instance_init, NULL }; + GType publishing_authenticator_shotwell_flickr_session_type_id; + publishing_authenticator_shotwell_flickr_session_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_SESSION, "PublishingAuthenticatorShotwellFlickrSession", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_session_type_id__volatile, publishing_authenticator_shotwell_flickr_session_type_id); + } + return publishing_authenticator_shotwell_flickr_session_type_id__volatile; +} + + +PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* publishing_authenticator_shotwell_flickr_authentication_request_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session) { + PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* self = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; +#line 190 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (session), NULL); +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = session; +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction*) publishing_authenticator_shotwell_flickr_transaction_construct_with_uri (object_type, _tmp0_, "https://www.flickr.com/services/oauth/request_token", PUBLISHING_REST_SUPPORT_HTTP_METHOD_GET); +#line 190 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 1569 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* publishing_authenticator_shotwell_flickr_authentication_request_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session) { +#line 190 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_authentication_request_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_AUTHENTICATION_REQUEST_TRANSACTION, session); +#line 1576 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_authentication_request_transaction_class_init (PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass * klass) { +#line 189 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_authentication_request_transaction_parent_class = g_type_class_peek_parent (klass); +#line 1583 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_authentication_request_transaction_instance_init (PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction * self) { +} + + +GType publishing_authenticator_shotwell_flickr_authentication_request_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_authentication_request_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_authentication_request_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id; + publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id = g_type_register_static (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id__volatile, publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id); + } + return publishing_authenticator_shotwell_flickr_authentication_request_transaction_type_id__volatile; +} + + +PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_construct (GType object_type, PublishingAuthenticatorShotwellFlickrSession* session, const gchar* user_verifier) { + PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* self = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_SESSION (session), NULL); +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (user_verifier != NULL, NULL); +#line 198 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = session; +#line 198 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction*) publishing_authenticator_shotwell_flickr_transaction_construct_with_uri (object_type, _tmp0_, "https://www.flickr.com/services/oauth/access_token", PUBLISHING_REST_SUPPORT_HTTP_METHOD_GET); +#line 200 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = user_verifier; +#line 200 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_verifier", _tmp1_); +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = session; +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_flickr_session_get_request_phase_token (_tmp2_); +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "oauth_token", _tmp4_); +#line 201 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp4_); +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 1634 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_new (PublishingAuthenticatorShotwellFlickrSession* session, const gchar* user_verifier) { +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_ACCESS_TOKEN_FETCH_TRANSACTION, session, user_verifier); +#line 1641 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_class_init (PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass * klass) { +#line 196 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_parent_class = g_type_class_peek_parent (klass); +#line 1648 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_instance_init (PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction * self) { +} + + +GType publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id; + publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id = g_type_register_static (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id__volatile, publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id); + } + return publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_type_id__volatile; +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 216 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self ? g_object_ref (self) : NULL; +#line 1671 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrPinEntryPane* publishing_authenticator_shotwell_flickr_pin_entry_pane_construct (GType object_type, GtkBuilder* builder) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self = NULL; + GtkBuilder* _tmp0_ = NULL; + GtkBuilder* _tmp1_ = NULL; + GtkBuilder* _tmp2_ = NULL; + GtkBuilder* _tmp3_ = NULL; + GSList* _tmp4_ = NULL; + GSList* _tmp5_ = NULL; + guint _tmp6_ = 0U; + GtkBuilder* _tmp7_ = NULL; + GObject* _tmp8_ = NULL; + GtkLabel* _tmp9_ = NULL; + GtkBuilder* _tmp10_ = NULL; + GObject* _tmp11_ = NULL; + GtkLabel* _tmp12_ = NULL; + GtkBuilder* _tmp13_ = NULL; + GObject* _tmp14_ = NULL; + GtkEntry* _tmp15_ = NULL; + GtkBuilder* _tmp16_ = NULL; + GObject* _tmp17_ = NULL; + GtkButton* _tmp18_ = NULL; + GtkBuilder* _tmp19_ = NULL; + GObject* _tmp20_ = NULL; + GtkBox* _tmp21_ = NULL; + GtkBox* _tmp22_ = NULL; +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (GTK_IS_BUILDER (builder), NULL); +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrPinEntryPane*) g_object_new (object_type, NULL); +#line 216 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = builder; +#line 216 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#line 216 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->builder); +#line 216 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->builder = _tmp1_; +#line 217 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = builder; +#line 217 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp2_ != NULL, "builder != null"); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = builder; +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = gtk_builder_get_objects (_tmp3_); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _tmp4_; +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = g_slist_length (_tmp5_); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _vala_assert (_tmp6_ > ((guint) 0), "builder.get_objects().length() > 0"); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_slist_free0 (_tmp5_); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = builder; +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = gtk_builder_get_object (_tmp7_, "explanatory_text"); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp8_) : NULL); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->explanatory_text); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->explanatory_text = _tmp9_; +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = builder; +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = gtk_builder_get_object (_tmp10_, "pin_entry_caption"); +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp11_, gtk_label_get_type ()) ? ((GtkLabel*) _tmp11_) : NULL); +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pin_entry_caption); +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pin_entry_caption = _tmp12_; +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = builder; +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp14_ = gtk_builder_get_object (_tmp13_, "pin_entry"); +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp14_) : NULL); +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pin_entry); +#line 222 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pin_entry = _tmp15_; +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = builder; +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp17_ = gtk_builder_get_object (_tmp16_, "continue_button"); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, gtk_button_get_type ()) ? ((GtkButton*) _tmp17_) : NULL); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->continue_button); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->continue_button = _tmp18_; +#line 225 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp19_ = builder; +#line 225 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp20_ = gtk_builder_get_object (_tmp19_, "pane_widget"); +#line 225 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, gtk_box_get_type ()) ? ((GtkBox*) _tmp20_) : NULL); +#line 225 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pane_widget); +#line 225 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pane_widget = _tmp21_; +#line 227 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp22_ = self->priv->pane_widget; +#line 227 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + gtk_widget_show_all (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, gtk_widget_get_type (), GtkWidget)); +#line 229 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed (self); +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 1786 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrPinEntryPane* publishing_authenticator_shotwell_flickr_pin_entry_pane_new (GtkBuilder* builder) { +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_pin_entry_pane_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, builder); +#line 1793 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked (PublishingAuthenticatorShotwellFlickrPinEntryPane* self) { + GtkEntry* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_PIN_ENTRY_PANE (self)); +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->pin_entry; +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = gtk_entry_get_text (_tmp0_); +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (self, "proceed", self, _tmp1_); +#line 1808 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed (PublishingAuthenticatorShotwellFlickrPinEntryPane* self) { + GtkButton* _tmp0_ = NULL; + GtkEntry* _tmp1_ = NULL; + guint _tmp2_ = 0U; + guint _tmp3_ = 0U; +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_PIN_ENTRY_PANE (self)); +#line 237 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->continue_button; +#line 237 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->pin_entry; +#line 237 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = gtk_entry_get_text_length (_tmp1_); +#line 237 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 237 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + gtk_widget_set_sensitive (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget), _tmp3_ > ((guint) 0)); +#line 1829 "FlickrPublishingAuthenticator.c" +} + + +static GtkWidget* publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_widget (SpitPublishingDialogPane* base) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self; + GtkWidget* result = NULL; + GtkBox* _tmp0_ = NULL; + GtkWidget* _tmp1_ = NULL; +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane); +#line 241 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->pane_widget; +#line 241 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_widget_get_type (), GtkWidget)); +#line 241 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp1_; +#line 241 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1848 "FlickrPublishingAuthenticator.c" +} + + +static SpitPublishingDialogPaneGeometryOptions publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_preferred_geometry (SpitPublishingDialogPane* base) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self; + SpitPublishingDialogPaneGeometryOptions result = 0; +#line 244 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane); +#line 245 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = SPIT_PUBLISHING_DIALOG_PANE_GEOMETRY_OPTIONS_NONE; +#line 245 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 1861 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked_gtk_button_clicked (GtkButton* _sender, gpointer self) { +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked ((PublishingAuthenticatorShotwellFlickrPinEntryPane*) self); +#line 1868 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed_gtk_editable_changed (GtkEditable* _sender, gpointer self) { +#line 250 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed ((PublishingAuthenticatorShotwellFlickrPinEntryPane*) self); +#line 1875 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_installed (SpitPublishingDialogPane* base) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self; + GtkButton* _tmp0_ = NULL; + GtkEntry* _tmp1_ = NULL; +#line 248 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->continue_button; +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (_tmp0_, "clicked", (GCallback) _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked_gtk_button_clicked, self, 0); +#line 250 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->pin_entry; +#line 250 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, GTK_TYPE_EDITABLE, GtkEditable), "changed", (GCallback) _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed_gtk_editable_changed, self, 0); +#line 1893 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_uninstalled (SpitPublishingDialogPane* base) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self; + GtkButton* _tmp0_ = NULL; + guint _tmp1_ = 0U; + GtkEntry* _tmp2_ = NULL; + guint _tmp3_ = 0U; +#line 253 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane); +#line 254 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->continue_button; +#line 254 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("clicked", gtk_button_get_type (), &_tmp1_, NULL, FALSE); +#line 254 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_continue_clicked_gtk_button_clicked, self); +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = self->priv->pin_entry; +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("changed", GTK_TYPE_EDITABLE, &_tmp3_, NULL, FALSE); +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GTK_TYPE_EDITABLE, GtkEditable), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_pin_entry_pane_on_pin_entry_contents_changed_gtk_editable_changed, self); +#line 1917 "FlickrPublishingAuthenticator.c" +} + + +static void g_cclosure_user_marshal_VOID__OBJECT_STRING (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) { + typedef void (*GMarshalFunc_VOID__OBJECT_STRING) (gpointer data1, gpointer arg_1, const char* arg_2, gpointer data2); + register GMarshalFunc_VOID__OBJECT_STRING callback; + register GCClosure * cc; + register gpointer data1; + register gpointer data2; + cc = (GCClosure *) closure; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (n_param_values == 3); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_CCLOSURE_SWAP_DATA (closure)) { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data1 = closure->data; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data2 = param_values->data[0].v_pointer; +#line 1936 "FlickrPublishingAuthenticator.c" + } else { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data1 = param_values->data[0].v_pointer; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data2 = closure->data; +#line 1942 "FlickrPublishingAuthenticator.c" + } +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + callback = (GMarshalFunc_VOID__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + callback (data1, g_value_get_object (param_values + 1), g_value_get_string (param_values + 2), data2); +#line 1948 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_class_init (PublishingAuthenticatorShotwellFlickrPinEntryPaneClass * klass) { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_pin_entry_pane_parent_class = g_type_class_peek_parent (klass); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_type_class_add_private (klass, sizeof (PublishingAuthenticatorShotwellFlickrPinEntryPanePrivate)); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_flickr_pin_entry_pane_finalize; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_new ("proceed", PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__OBJECT_STRING, G_TYPE_NONE, 2, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, G_TYPE_STRING); +#line 1961 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_spit_publishing_dialog_pane_interface_init (SpitPublishingDialogPaneIface * iface) { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_pin_entry_pane_spit_publishing_dialog_pane_parent_iface = g_type_interface_peek_parent (iface); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->get_widget = (GtkWidget* (*)(SpitPublishingDialogPane*)) publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_widget; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->get_preferred_geometry = (SpitPublishingDialogPaneGeometryOptions (*)(SpitPublishingDialogPane*)) publishing_authenticator_shotwell_flickr_pin_entry_pane_real_get_preferred_geometry; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->on_pane_installed = (void (*)(SpitPublishingDialogPane*)) publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_installed; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->on_pane_uninstalled = (void (*)(SpitPublishingDialogPane*)) publishing_authenticator_shotwell_flickr_pin_entry_pane_real_on_pane_uninstalled; +#line 1976 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_instance_init (PublishingAuthenticatorShotwellFlickrPinEntryPane * self) { +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv = PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_PIN_ENTRY_PANE_GET_PRIVATE (self); +#line 206 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pane_widget = NULL; +#line 207 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->continue_button = NULL; +#line 208 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pin_entry = NULL; +#line 209 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->pin_entry_caption = NULL; +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->explanatory_text = NULL; +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->builder = NULL; +#line 1995 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_pin_entry_pane_finalize (GObject* obj) { + PublishingAuthenticatorShotwellFlickrPinEntryPane * self; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, PublishingAuthenticatorShotwellFlickrPinEntryPane); +#line 206 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pane_widget); +#line 207 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->continue_button); +#line 208 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pin_entry); +#line 209 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->pin_entry_caption); +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->explanatory_text); +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->builder); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_flickr_pin_entry_pane_parent_class)->finalize (obj); +#line 2017 "FlickrPublishingAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_flickr_pin_entry_pane_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrPinEntryPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_pin_entry_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrPinEntryPane), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_pin_entry_pane_instance_init, NULL }; + static const GInterfaceInfo spit_publishing_dialog_pane_info = { (GInterfaceInitFunc) publishing_authenticator_shotwell_flickr_pin_entry_pane_spit_publishing_dialog_pane_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id; + publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingAuthenticatorShotwellFlickrPinEntryPane", &g_define_type_info, 0); + g_type_add_interface_static (publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id, SPIT_PUBLISHING_TYPE_DIALOG_PANE, &spit_publishing_dialog_pane_info); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id__volatile, publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id); + } + return publishing_authenticator_shotwell_flickr_pin_entry_pane_type_id__volatile; +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated_publishing_rest_support_session_authenticated (PublishingRESTSupportSession* _sender, gpointer self) { +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated ((PublishingAuthenticatorShotwellFlickrFlickr*) self); +#line 2038 "FlickrPublishingAuthenticator.c" +} + + +static void _g_free0_ (gpointer var) { +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + var = (g_free (var), NULL); +#line 2045 "FlickrPublishingAuthenticator.c" +} + + +static void _g_variant_unref0_ (gpointer var) { +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)); +#line 2052 "FlickrPublishingAuthenticator.c" +} + + +static GVariant* _variant_new1 (const gchar* value) { +#line 270 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return g_variant_ref_sink (g_variant_new_string (value)); +#line 2059 "FlickrPublishingAuthenticator.c" +} + + +static GVariant* _variant_new2 (const gchar* value) { +#line 271 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return g_variant_ref_sink (g_variant_new_string (value)); +#line 2066 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_construct (GType object_type, SpitPublishingPluginHost* host) { + PublishingAuthenticatorShotwellFlickrFlickr * self = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + GHashFunc _tmp2_ = NULL; + GEqualFunc _tmp3_ = NULL; + GHashTable* _tmp4_ = NULL; + GHashTable* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + GVariant* _tmp7_ = NULL; + GHashTable* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + GVariant* _tmp10_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp11_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp12_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp13_ = NULL; +#line 265 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (SPIT_PUBLISHING_IS_PLUGIN_HOST (host), NULL); +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = (PublishingAuthenticatorShotwellFlickrFlickr*) g_object_new (object_type, NULL); +#line 268 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = host; +#line 268 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#line 268 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 268 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->host = _tmp1_; +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = g_str_hash; +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_str_equal; +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, _g_variant_unref0_); +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->params = _tmp4_; +#line 270 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = self->priv->params; +#line 270 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = g_strdup ("ConsumerKey"); +#line 270 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = _variant_new1 (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_KEY); +#line 270 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_insert (_tmp5_, _tmp6_, _tmp7_); +#line 271 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = self->priv->params; +#line 271 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = g_strdup ("ConsumerSecret"); +#line 271 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = _variant_new2 (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_SECRET); +#line 271 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_insert (_tmp8_, _tmp9_, _tmp10_); +#line 273 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = publishing_authenticator_shotwell_flickr_session_new (); +#line 273 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_session_unref0 (self->priv->session); +#line 273 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv->session = _tmp11_; +#line 274 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = self->priv->session; +#line 274 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_set_api_credentials (_tmp12_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_KEY, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_API_SECRET); +#line 275 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = self->priv->session; +#line 275 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), "authenticated", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated_publishing_rest_support_session_authenticated, self, 0); +#line 265 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self; +#line 2140 "FlickrPublishingAuthenticator.c" +} + + +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_new (SpitPublishingPluginHost* host) { +#line 265 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return publishing_authenticator_shotwell_flickr_flickr_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, host); +#line 2147 "FlickrPublishingAuthenticator.c" +} + + +void publishing_authenticator_shotwell_flickr_flickr_invalidate_persistent_session (PublishingAuthenticatorShotwellFlickrFlickr* self) { +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 283 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token (self, ""); +#line 284 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token_secret (self, ""); +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_username (self, ""); +#line 2160 "FlickrPublishingAuthenticator.c" +} + + +static gboolean publishing_authenticator_shotwell_flickr_flickr_is_persistent_session_valid (PublishingAuthenticatorShotwellFlickrFlickr* self) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; + gboolean _tmp1_ = FALSE; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gboolean _tmp4_ = FALSE; +#line 288 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self), FALSE); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_username (self); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_ != NULL; +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp3_); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp4_) { +#line 2183 "FlickrPublishingAuthenticator.c" + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token (self); +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _tmp6_ != NULL; +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp6_); +#line 2194 "FlickrPublishingAuthenticator.c" + } else { +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = FALSE; +#line 2198 "FlickrPublishingAuthenticator.c" + } +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp1_) { +#line 2202 "FlickrPublishingAuthenticator.c" + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token_secret (self); +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = _tmp7_; +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = _tmp8_ != NULL; +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp8_); +#line 2213 "FlickrPublishingAuthenticator.c" + } else { +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = FALSE; +#line 2217 "FlickrPublishingAuthenticator.c" + } +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp0_; +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2223 "FlickrPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_username (PublishingAuthenticatorShotwellFlickrFlickr* self) { + gchar* result = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 294 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self), NULL); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_username", NULL); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp1_; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2241 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_username (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* username) { + SpitPublishingPluginHost* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 298 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 298 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (username != NULL); +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = username; +#line 299 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_username", _tmp1_); +#line 2258 "FlickrPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token (PublishingAuthenticatorShotwellFlickrFlickr* self) { + gchar* result = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 302 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self), NULL); +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_token", NULL); +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp1_; +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2276 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token) { + SpitPublishingPluginHost* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 306 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 307 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 307 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = token; +#line 307 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_token", _tmp1_); +#line 2293 "FlickrPublishingAuthenticator.c" +} + + +static gchar* publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrFlickr* self) { + gchar* result = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; +#line 310 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self), NULL); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_token_secret", NULL); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp1_; +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2311 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token_secret (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* secret) { + SpitPublishingPluginHost* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (secret != NULL); +#line 315 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 315 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = secret; +#line 315 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "access_phase_token_secret", _tmp1_); +#line 2328 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_real_authenticate (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFlickrFlickr * self; + gboolean _tmp0_ = FALSE; +#line 318 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 319 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_flickr_flickr_is_persistent_session_valid (self); +#line 319 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp0_) { +#line 2341 "FlickrPublishingAuthenticator.c" + PublishingAuthenticatorShotwellFlickrSession* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; +#line 320 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:320: attempt start: a persistent se" \ +"ssion is available; using it"); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->session; +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token (self); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_token_secret (self); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _tmp4_; +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = publishing_authenticator_shotwell_flickr_flickr_get_persistent_access_phase_username (self); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_authenticate_from_persistent_credentials (_tmp1_, _tmp3_, _tmp5_, _tmp7_); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp7_); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp5_); +#line 322 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp3_); +#line 2373 "FlickrPublishingAuthenticator.c" + } else { +#line 325 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:325: attempt start: no persistent s" \ +"ession available; showing login welcome pane"); +#line 326 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_show_login_welcome_pane (self); +#line 2379 "FlickrPublishingAuthenticator.c" + } +} + + +static gboolean publishing_authenticator_shotwell_flickr_flickr_real_can_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFlickrFlickr * self; + gboolean result = FALSE; +#line 330 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = TRUE; +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2393 "FlickrPublishingAuthenticator.c" +} + + +static gpointer _g_hash_table_ref0 (gpointer self) { +#line 335 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return self ? g_hash_table_ref (self) : NULL; +#line 2400 "FlickrPublishingAuthenticator.c" +} + + +static GHashTable* publishing_authenticator_shotwell_flickr_flickr_real_get_authentication_parameter (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFlickrFlickr * self; + GHashTable* result = NULL; + GHashTable* _tmp0_ = NULL; + GHashTable* _tmp1_ = NULL; +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 335 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->params; +#line 335 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = _g_hash_table_ref0 (_tmp0_); +#line 335 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + result = _tmp1_; +#line 335 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return result; +#line 2419 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_real_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFlickrFlickr * self; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; +#line 338 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 339 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->session; +#line 339 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_deauthenticate (_tmp0_); +#line 340 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_invalidate_persistent_session (self); +#line 2434 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_real_refresh (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellFlickrFlickr * self; +#line 343 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 2442 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked_spit_publishing_login_callback (gpointer self) { +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked ((PublishingAuthenticatorShotwellFlickrFlickr*) self); +#line 2449 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_show_login_welcome_pane (PublishingAuthenticatorShotwellFlickrFlickr* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; +#line 347 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 348 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:348: ACTION: installing login welco" \ +"me pane"); +#line 350 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 350 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp0_, FALSE); +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_welcome_pane (_tmp1_, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_SERVICE_WELCOME_MESSAGE, _publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked_spit_publishing_login_callback, self); +#line 2468 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_welcome_pane_login_clicked (PublishingAuthenticatorShotwellFlickrFlickr* self) { +#line 354 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 355 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:355: EVENT: user clicked 'Login' bu" \ +"tton in the welcome pane"); +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_run_authentication_request_transaction (self); +#line 2479 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self) { +#line 367 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed ((PublishingAuthenticatorShotwellFlickrFlickr*) self, _sender); +#line 2486 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self) { +#line 368 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error ((PublishingAuthenticatorShotwellFlickrFlickr*) self, _sender, err); +#line 2493 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_run_authentication_request_transaction (PublishingAuthenticatorShotwellFlickrFlickr* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* txn = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp3_ = NULL; + PublishingAuthenticatorShotwellFlickrAuthenticationRequestTransaction* _tmp4_ = NULL; + GError * _inner_error_ = NULL; +#line 360 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 361 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:361: ACTION: running authentication" \ +" request transaction"); +#line 363 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 363 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp0_, TRUE); +#line 364 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 364 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = _ ("Preparing for login…"); +#line 364 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_static_message_pane (_tmp1_, _tmp2_, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = self->priv->session; +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = publishing_authenticator_shotwell_flickr_authentication_request_transaction_new (_tmp3_); +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + txn = _tmp4_; +#line 367 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed_publishing_rest_support_transaction_completed, self, 0); +#line 368 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "network-error", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error_publishing_rest_support_transaction_network_error, self, 0); +#line 2529 "FlickrPublishingAuthenticator.c" + { +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_execute (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_inner_error_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) { +#line 2537 "FlickrPublishingAuthenticator.c" + goto __catch1_spit_publishing_publishing_error; + } +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 2548 "FlickrPublishingAuthenticator.c" + } + } + goto __finally1; + __catch1_spit_publishing_publishing_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp5_ = NULL; + GError* _tmp6_ = NULL; +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + err = _inner_error_; +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _inner_error_ = NULL; +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = self->priv->host; +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = err; +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp5_, _tmp6_); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (err); +#line 2569 "FlickrPublishingAuthenticator.c" + } + __finally1: +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 2582 "FlickrPublishingAuthenticator.c" + } +#line 360 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 2586 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingRESTSupportTransaction* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + PublishingRESTSupportTransaction* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; +#line 377 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 377 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = txn; +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed_publishing_rest_support_transaction_completed, self); +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = txn; +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error_publishing_rest_support_transaction_network_error, self); +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = txn; +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = publishing_rest_support_transaction_get_response (_tmp4_); +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:381: EVENT: OAuth authentication re" \ +"quest transaction completed; response = '%s'", _tmp6_); +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp6_); +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = txn; +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = publishing_rest_support_transaction_get_response (_tmp7_); +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = _tmp8_; +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_parse_token_info_from_auth_request (self, _tmp9_); +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp9_); +#line 2637 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn, GError* err) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + SpitPublishingPluginHost* _tmp4_ = NULL; + GError* _tmp5_ = NULL; +#line 387 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 387 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = txn; +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_completed_publishing_rest_support_transaction_completed, self); +#line 390 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = txn; +#line 390 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 390 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_auth_request_txn_error_publishing_rest_support_transaction_network_error, self); +#line 392 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:392: EVENT: OAuth authentication re" \ +"quest transaction caused a network error"); +#line 393 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 393 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = err; +#line 393 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp5_); +#line 395 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authentication-failed"); +#line 2674 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_parse_token_info_from_auth_request (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* response) { + const gchar* _tmp0_ = NULL; + gchar* oauth_token = NULL; + gchar* oauth_token_secret = NULL; + GHashTable* data = NULL; + const gchar* _tmp1_ = NULL; + GHashTable* _tmp2_ = NULL; + GHashTable* _tmp3_ = NULL; + gconstpointer _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + GHashTable* _tmp6_ = NULL; + gconstpointer _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + gboolean _tmp9_ = FALSE; + const gchar* _tmp10_ = NULL; + const gchar* _tmp16_ = NULL; + const gchar* _tmp17_ = NULL; +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (response != NULL); +#line 399 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = response; +#line 399 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:399: ACTION: parsing authorization " \ +"request response '%s' into token and secret", _tmp0_); +#line 401 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + oauth_token = NULL; +#line 402 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + oauth_token_secret = NULL; +#line 404 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = response; +#line 404 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = soup_form_decode (_tmp1_); +#line 404 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data = _tmp2_; +#line 405 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = data; +#line 405 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_lookup_extended (_tmp3_, "oauth_token", NULL, &_tmp4_); +#line 405 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (oauth_token); +#line 405 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 405 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + oauth_token = _tmp5_; +#line 406 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = data; +#line 406 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_lookup_extended (_tmp6_, "oauth_token_secret", NULL, &_tmp7_); +#line 406 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (oauth_token_secret); +#line 406 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = g_strdup (_tmp7_); +#line 406 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + oauth_token_secret = _tmp8_; +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = oauth_token; +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp10_ == NULL) { +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = TRUE; +#line 2739 "FlickrPublishingAuthenticator.c" + } else { + const gchar* _tmp11_ = NULL; +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = oauth_token_secret; +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = _tmp11_ == NULL; +#line 2746 "FlickrPublishingAuthenticator.c" + } +#line 408 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp9_) { +#line 2750 "FlickrPublishingAuthenticator.c" + SpitPublishingPluginHost* _tmp12_ = NULL; + const gchar* _tmp13_ = NULL; + GError* _tmp14_ = NULL; + GError* _tmp15_ = NULL; +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = self->priv->host; +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = response; +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp14_ = g_error_new (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "'%s' isn't a valid response to an OAuth authentication request", _tmp13_); +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = _tmp14_; +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp12_, _tmp15_); +#line 409 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (_tmp15_); +#line 2767 "FlickrPublishingAuthenticator.c" + } +#line 413 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = oauth_token; +#line 413 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp17_ = oauth_token_secret; +#line 413 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_authentication_token_available (self, _tmp16_, _tmp17_); +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_hash_table_unref0 (data); +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (oauth_token_secret); +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (oauth_token); +#line 2781 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_authentication_token_available (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token, const gchar* token_secret) { + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; +#line 416 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 416 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 416 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token_secret != NULL); +#line 417 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = token; +#line 417 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = token_secret; +#line 417 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:417: EVENT: OAuth authentication to" \ +"ken (%s) and token secret (%s) available", _tmp0_, _tmp1_); +#line 420 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = self->priv->session; +#line 420 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = token; +#line 420 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = token_secret; +#line 420 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_set_request_phase_credentials (_tmp2_, _tmp3_, _tmp4_); +#line 422 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = token; +#line 422 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_launch_system_browser (self, _tmp5_); +#line 2816 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_system_browser_launched (PublishingAuthenticatorShotwellFlickrFlickr* self) { +#line 425 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 426 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:426: EVENT: system browser launched" \ +"."); +#line 428 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_show_pin_entry_pane (self); +#line 2827 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed_publishing_authenticator_shotwell_flickr_pin_entry_pane_proceed (PublishingAuthenticatorShotwellFlickrPinEntryPane* _sender, PublishingAuthenticatorShotwellFlickrPinEntryPane* sender, const gchar* authorization_pin, gpointer self) { +#line 432 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed ((PublishingAuthenticatorShotwellFlickrFlickr*) self, sender, authorization_pin); +#line 2834 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingAuthenticatorShotwellFlickrPinEntryPane* sender, const gchar* pin) { + PublishingAuthenticatorShotwellFlickrPinEntryPane* _tmp0_ = NULL; + guint _tmp1_ = 0U; + const gchar* _tmp2_ = NULL; +#line 431 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 431 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_PIN_ENTRY_PANE (sender)); +#line 431 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (pin != NULL); +#line 432 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = sender; +#line 432 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("proceed", PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_PIN_ENTRY_PANE, &_tmp1_, NULL, FALSE); +#line 432 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed_publishing_authenticator_shotwell_flickr_pin_entry_pane_proceed, self); +#line 434 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:434: EVENT: user clicked 'Continue'" \ +" in PIN entry pane."); +#line 436 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = pin; +#line 436 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_verify_pin (self, _tmp2_); +#line 2860 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_launch_system_browser (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* token) { + gchar* login_uri = NULL; + const gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + GError * _inner_error_ = NULL; +#line 439 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 439 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = token; +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strconcat ("https://www.flickr.com/services/oauth/authorize?oauth_token=", _tmp0_, NULL); +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = _tmp1_; +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = g_strconcat (_tmp2_, "&perms=write", NULL); +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp2_); +#line 440 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + login_uri = _tmp4_; +#line 443 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = login_uri; +#line 443 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:443: ACTION: launching system brows" \ +"er with uri = '%s'", _tmp5_); +#line 2895 "FlickrPublishingAuthenticator.c" + { + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = login_uri; +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = g_strconcat ("xdg-open ", _tmp6_, NULL); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = _tmp7_; +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_spawn_command_line_async (_tmp8_, &_inner_error_); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp8_); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_inner_error_->domain == G_SPAWN_ERROR) { +#line 2914 "FlickrPublishingAuthenticator.c" + goto __catch2_g_spawn_error; + } +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (login_uri); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 446 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 2925 "FlickrPublishingAuthenticator.c" + } + } + goto __finally2; + __catch2_g_spawn_error: + { + GError* e = NULL; + SpitPublishingPluginHost* _tmp9_ = NULL; + GError* _tmp10_ = NULL; + GError* _tmp11_ = NULL; +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + e = _inner_error_; +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _inner_error_ = NULL; +#line 448 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = self->priv->host; +#line 448 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_LOCAL_FILE_ERROR, "couldn't launch system web browser to complete Flickr login"); +#line 448 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = _tmp10_; +#line 448 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp9_, _tmp11_); +#line 448 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (_tmp11_); +#line 450 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (e); +#line 450 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (login_uri); +#line 450 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 2955 "FlickrPublishingAuthenticator.c" + } + __finally2: +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (login_uri); +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 445 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 2968 "FlickrPublishingAuthenticator.c" + } +#line 453 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_system_browser_launched (self); +#line 439 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (login_uri); +#line 2974 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_show_pin_entry_pane (PublishingAuthenticatorShotwellFlickrFlickr* self) { + GtkBuilder* builder = NULL; + GtkBuilder* _tmp0_ = NULL; + PublishingAuthenticatorShotwellFlickrPinEntryPane* pin_entry_pane = NULL; + GtkBuilder* _tmp8_ = NULL; + PublishingAuthenticatorShotwellFlickrPinEntryPane* _tmp9_ = NULL; + PublishingAuthenticatorShotwellFlickrPinEntryPane* _tmp10_ = NULL; + SpitPublishingPluginHost* _tmp11_ = NULL; + PublishingAuthenticatorShotwellFlickrPinEntryPane* _tmp12_ = NULL; + GError * _inner_error_ = NULL; +#line 456 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 457 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:457: ACTION: showing PIN entry pane"); +#line 459 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = gtk_builder_new (); +#line 459 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + builder = _tmp0_; +#line 2996 "FlickrPublishingAuthenticator.c" + { + GtkBuilder* _tmp1_ = NULL; +#line 462 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = builder; +#line 462 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + gtk_builder_add_from_resource (_tmp1_, PLUGIN_RESOURCE_PATH "/" "flickr_pin_entry_pane.ui", &_inner_error_); +#line 462 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 3005 "FlickrPublishingAuthenticator.c" + goto __catch3_g_error; + } + } + goto __finally3; + __catch3_g_error: + { + GError* e = NULL; + GError* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + SpitPublishingPluginHost* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + GError* _tmp6_ = NULL; + GError* _tmp7_ = NULL; +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + e = _inner_error_; +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _inner_error_ = NULL; +#line 465 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = e; +#line 465 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _tmp2_->message; +#line 465 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_warning ("FlickrPublishingAuthenticator.vala:465: Could not parse UI file! Error" \ +": %s.", _tmp3_); +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _ ("A file required for publishing is unavailable. Publishing to Flickr ca" \ +"n’t continue."); +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_LOCAL_FILE_ERROR, _tmp5_); +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp7_); +#line 466 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (_tmp7_); +#line 469 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (e); +#line 469 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (builder); +#line 469 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 3047 "FlickrPublishingAuthenticator.c" + } + __finally3: +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (builder); +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 461 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 3060 "FlickrPublishingAuthenticator.c" + } +#line 472 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = builder; +#line 472 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = publishing_authenticator_shotwell_flickr_pin_entry_pane_new (_tmp8_); +#line 472 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + pin_entry_pane = _tmp9_; +#line 473 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = pin_entry_pane; +#line 473 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (_tmp10_, "proceed", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_pin_entry_proceed_publishing_authenticator_shotwell_flickr_pin_entry_pane_proceed, self, 0); +#line 474 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = self->priv->host; +#line 474 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = pin_entry_pane; +#line 474 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_dialog_pane (_tmp11_, G_TYPE_CHECK_INSTANCE_CAST (_tmp12_, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 456 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (pin_entry_pane); +#line 456 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (builder); +#line 3082 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self) { +#line 484 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed ((PublishingAuthenticatorShotwellFlickrFlickr*) self, _sender); +#line 3089 "FlickrPublishingAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self) { +#line 485 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error ((PublishingAuthenticatorShotwellFlickrFlickr*) self, _sender, err); +#line 3096 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_verify_pin (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* pin) { + const gchar* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + SpitPublishingPluginHost* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* txn = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + PublishingAuthenticatorShotwellFlickrAccessTokenFetchTransaction* _tmp6_ = NULL; + GError * _inner_error_ = NULL; +#line 477 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 477 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (pin != NULL); +#line 478 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = pin; +#line 478 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:478: ACTION: validating authorizati" \ +"on PIN %s", _tmp0_); +#line 480 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 480 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp1_, TRUE); +#line 481 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = self->priv->host; +#line 481 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = _ ("Verifying authorization…"); +#line 481 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_install_static_message_pane (_tmp2_, _tmp3_, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 483 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = self->priv->session; +#line 483 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = pin; +#line 483 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = publishing_authenticator_shotwell_flickr_access_token_fetch_transaction_new (_tmp4_, _tmp5_); +#line 483 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + txn = _tmp6_; +#line 484 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed_publishing_rest_support_transaction_completed, self, 0); +#line 485 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "network-error", (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error_publishing_rest_support_transaction_network_error, self, 0); +#line 3140 "FlickrPublishingAuthenticator.c" + { +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_rest_support_transaction_execute (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_inner_error_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) { +#line 3148 "FlickrPublishingAuthenticator.c" + goto __catch4_spit_publishing_publishing_error; + } +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 488 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 3159 "FlickrPublishingAuthenticator.c" + } + } + goto __finally4; + __catch4_spit_publishing_publishing_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp7_ = NULL; + GError* _tmp8_ = NULL; +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + err = _inner_error_; +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _inner_error_ = NULL; +#line 490 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = self->priv->host; +#line 490 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = err; +#line 490 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp7_, _tmp8_); +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (err); +#line 3180 "FlickrPublishingAuthenticator.c" + } + __finally4: +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 487 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return; +#line 3193 "FlickrPublishingAuthenticator.c" + } +#line 477 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 3197 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingRESTSupportTransaction* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 494 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 494 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 495 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = txn; +#line 495 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 495 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed_publishing_rest_support_transaction_completed, self); +#line 496 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = txn; +#line 496 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 496 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error_publishing_rest_support_transaction_network_error, self); +#line 498 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:498: EVENT: fetching OAuth access t" \ +"oken over the network succeeded"); +#line 500 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = txn; +#line 500 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = publishing_rest_support_transaction_get_response (_tmp4_); +#line 500 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 500 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_do_extract_access_phase_credentials_from_reponse (self, _tmp6_); +#line 500 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp6_); +#line 3237 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error (PublishingAuthenticatorShotwellFlickrFlickr* self, PublishingRESTSupportTransaction* txn, GError* err) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + SpitPublishingPluginHost* _tmp4_ = NULL; + GError* _tmp5_ = NULL; +#line 503 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 503 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 505 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = txn; +#line 505 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 505 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_txn_completed_publishing_rest_support_transaction_completed, self); +#line 506 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = txn; +#line 506 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 506 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_access_token_fetch_error_publishing_rest_support_transaction_network_error, self); +#line 508 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:508: EVENT: fetching OAuth access t" \ +"oken over the network caused an error."); +#line 510 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 510 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = err; +#line 510 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp5_); +#line 511 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authentication-failed"); +#line 3274 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_do_extract_access_phase_credentials_from_reponse (PublishingAuthenticatorShotwellFlickrFlickr* self, const gchar* response) { + const gchar* _tmp0_ = NULL; + gchar* token = NULL; + gchar* token_secret = NULL; + gchar* username = NULL; + GHashTable* data = NULL; + const gchar* _tmp1_ = NULL; + GHashTable* _tmp2_ = NULL; + GHashTable* _tmp3_ = NULL; + gconstpointer _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + GHashTable* _tmp6_ = NULL; + gconstpointer _tmp7_ = NULL; + gchar* _tmp8_ = NULL; + GHashTable* _tmp9_ = NULL; + gconstpointer _tmp10_ = NULL; + gchar* _tmp11_ = NULL; + const gchar* _tmp12_ = NULL; + const gchar* _tmp13_ = NULL; + const gchar* _tmp14_ = NULL; + gboolean _tmp15_ = FALSE; + gboolean _tmp16_ = FALSE; + const gchar* _tmp17_ = NULL; +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (response != NULL); +#line 515 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = response; +#line 515 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:515: ACTION: extracting access phas" \ +"e credentials from '%s'", _tmp0_); +#line 517 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + token = NULL; +#line 518 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + token_secret = NULL; +#line 519 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + username = NULL; +#line 521 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = response; +#line 521 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = soup_form_decode (_tmp1_); +#line 521 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + data = _tmp2_; +#line 522 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = data; +#line 522 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_lookup_extended (_tmp3_, "oauth_token", NULL, &_tmp4_); +#line 522 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (token); +#line 522 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = g_strdup (_tmp4_); +#line 522 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + token = _tmp5_; +#line 523 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = data; +#line 523 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_lookup_extended (_tmp6_, "oauth_token_secret", NULL, &_tmp7_); +#line 523 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (token_secret); +#line 523 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = g_strdup (_tmp7_); +#line 523 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + token_secret = _tmp8_; +#line 524 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = data; +#line 524 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_lookup_extended (_tmp9_, "username", NULL, &_tmp10_); +#line 524 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (username); +#line 524 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = g_strdup (_tmp10_); +#line 524 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + username = _tmp11_; +#line 526 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = token; +#line 526 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = token_secret; +#line 526 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp14_ = username; +#line 526 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_debug ("FlickrPublishingAuthenticator.vala:526: access phase credentials: { to" \ +"ken = '%s'; token_secret = '%s'; username = '%s' }", _tmp12_, _tmp13_, _tmp14_); +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp17_ = token; +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp17_ == NULL) { +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = TRUE; +#line 3365 "FlickrPublishingAuthenticator.c" + } else { + const gchar* _tmp18_ = NULL; +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp18_ = token_secret; +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = _tmp18_ == NULL; +#line 3372 "FlickrPublishingAuthenticator.c" + } +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp16_) { +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = TRUE; +#line 3378 "FlickrPublishingAuthenticator.c" + } else { + const gchar* _tmp19_ = NULL; +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp19_ = username; +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = _tmp19_ == NULL; +#line 3385 "FlickrPublishingAuthenticator.c" + } +#line 529 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + if (_tmp15_) { +#line 3389 "FlickrPublishingAuthenticator.c" + SpitPublishingPluginHost* _tmp20_ = NULL; + GError* _tmp21_ = NULL; + GError* _tmp22_ = NULL; +#line 530 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp20_ = self->priv->host; +#line 530 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp21_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "expected " "access phase credentials to contain token, token secret, and username " \ +"but at " "least one of these is absent"); +#line 530 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp22_ = _tmp21_; +#line 530 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp20_, _tmp22_); +#line 530 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_error_free0 (_tmp22_); +#line 533 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authentication-failed"); +#line 3405 "FlickrPublishingAuthenticator.c" + } else { + PublishingAuthenticatorShotwellFlickrSession* _tmp23_ = NULL; + const gchar* _tmp24_ = NULL; + const gchar* _tmp25_ = NULL; + const gchar* _tmp26_ = NULL; +#line 535 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp23_ = self->priv->session; +#line 535 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp24_ = token; +#line 535 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp25_ = token_secret; +#line 535 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp26_ = username; +#line 535 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_session_set_access_phase_credentials (_tmp23_, _tmp24_, _tmp25_, _tmp26_); +#line 3421 "FlickrPublishingAuthenticator.c" + } +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_hash_table_unref0 (data); +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (username); +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (token_secret); +#line 514 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (token); +#line 3431 "FlickrPublishingAuthenticator.c" +} + + +static GVariant* _variant_new3 (gchar* value) { +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return g_variant_ref_sink (g_variant_new_string (value)); +#line 3438 "FlickrPublishingAuthenticator.c" +} + + +static GVariant* _variant_new4 (gchar* value) { +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return g_variant_ref_sink (g_variant_new_string (value)); +#line 3445 "FlickrPublishingAuthenticator.c" +} + + +static GVariant* _variant_new5 (gchar* value) { +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + return g_variant_ref_sink (g_variant_new_string (value)); +#line 3452 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated (PublishingAuthenticatorShotwellFlickrFlickr* self) { + GHashTable* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + GVariant* _tmp5_ = NULL; + GHashTable* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; + GVariant* _tmp11_ = NULL; + GHashTable* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; + gchar* _tmp16_ = NULL; + GVariant* _tmp17_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp18_ = NULL; + gchar* _tmp19_ = NULL; + gchar* _tmp20_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp21_ = NULL; + gchar* _tmp22_ = NULL; + gchar* _tmp23_ = NULL; + PublishingAuthenticatorShotwellFlickrSession* _tmp24_ = NULL; + gchar* _tmp25_ = NULL; + gchar* _tmp26_ = NULL; +#line 539 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR (self)); +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->params; +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp1_ = g_strdup ("AuthToken"); +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp2_ = self->priv->session; +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_flickr_session_get_access_phase_token (_tmp2_); +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp5_ = _variant_new3 (_tmp4_); +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_insert (_tmp0_, _tmp1_, _tmp5_); +#line 540 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp4_); +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp6_ = self->priv->params; +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp7_ = g_strdup ("AuthTokenSecret"); +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp8_ = self->priv->session; +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp9_ = publishing_authenticator_shotwell_flickr_session_get_access_phase_token_secret (_tmp8_); +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp10_ = _tmp9_; +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp11_ = _variant_new4 (_tmp10_); +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_insert (_tmp6_, _tmp7_, _tmp11_); +#line 541 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp10_); +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp12_ = self->priv->params; +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp13_ = g_strdup ("Username"); +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp14_ = self->priv->session; +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp15_ = publishing_authenticator_shotwell_flickr_session_get_username (_tmp14_); +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp16_ = _tmp15_; +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp17_ = _variant_new5 (_tmp16_); +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_hash_table_insert (_tmp12_, _tmp13_, _tmp17_); +#line 542 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp16_); +#line 544 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp18_ = self->priv->session; +#line 544 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp19_ = publishing_authenticator_shotwell_flickr_session_get_access_phase_token (_tmp18_); +#line 544 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp20_ = _tmp19_; +#line 544 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token (self, _tmp20_); +#line 544 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp20_); +#line 545 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp21_ = self->priv->session; +#line 545 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp22_ = publishing_authenticator_shotwell_flickr_session_get_access_phase_token_secret (_tmp21_); +#line 545 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp23_ = _tmp22_; +#line 545 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_token_secret (self, _tmp23_); +#line 545 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp23_); +#line 546 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp24_ = self->priv->session; +#line 546 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp25_ = publishing_authenticator_shotwell_flickr_session_get_username (_tmp24_); +#line 546 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp26_ = _tmp25_; +#line 546 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_set_persistent_access_phase_username (self, _tmp26_); +#line 546 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_free0 (_tmp26_); +#line 549 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authenticated"); +#line 3566 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_class_init (PublishingAuthenticatorShotwellFlickrFlickrClass * klass) { +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_parent_class = g_type_class_peek_parent (klass); +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_type_class_add_private (klass, sizeof (PublishingAuthenticatorShotwellFlickrFlickrPrivate)); +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_flickr_flickr_finalize; +#line 3577 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_spit_publishing_authenticator_interface_init (SpitPublishingAuthenticatorIface * iface) { +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + publishing_authenticator_shotwell_flickr_flickr_spit_publishing_authenticator_parent_iface = g_type_interface_peek_parent (iface); +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->authenticate = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_flickr_flickr_real_authenticate; +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->can_logout = (gboolean (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_flickr_flickr_real_can_logout; +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->get_authentication_parameter = (GHashTable* (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_flickr_flickr_real_get_authentication_parameter; +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->logout = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_flickr_flickr_real_logout; +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + iface->refresh = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_flickr_flickr_real_refresh; +#line 3594 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_instance_init (PublishingAuthenticatorShotwellFlickrFlickr * self) { +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self->priv = PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_GET_PRIVATE (self); +#line 3601 "FlickrPublishingAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_flickr_flickr_finalize (GObject* obj) { + PublishingAuthenticatorShotwellFlickrFlickr * self; + PublishingAuthenticatorShotwellFlickrSession* _tmp0_ = NULL; + guint _tmp1_ = 0U; +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr); +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _tmp0_ = self->priv->session; +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_parse_name ("authenticated", PUBLISHING_REST_SUPPORT_TYPE_SESSION, &_tmp1_, NULL, FALSE); +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + g_signal_handlers_disconnect_matched (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_flickr_flickr_on_session_authenticated_publishing_rest_support_session_authenticated, self); +#line 261 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 262 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _publishing_rest_support_session_unref0 (self->priv->session); +#line 263 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 260 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_flickr_flickr_parent_class)->finalize (obj); +#line 3625 "FlickrPublishingAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_flickr_flickr_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_flickr_flickr_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_flickr_flickr_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellFlickrFlickrClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_flickr_flickr_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellFlickrFlickr), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_flickr_flickr_instance_init, NULL }; + static const GInterfaceInfo spit_publishing_authenticator_info = { (GInterfaceInitFunc) publishing_authenticator_shotwell_flickr_flickr_spit_publishing_authenticator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType publishing_authenticator_shotwell_flickr_flickr_type_id; + publishing_authenticator_shotwell_flickr_flickr_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingAuthenticatorShotwellFlickrFlickr", &g_define_type_info, 0); + g_type_add_interface_static (publishing_authenticator_shotwell_flickr_flickr_type_id, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, &spit_publishing_authenticator_info); + g_once_init_leave (&publishing_authenticator_shotwell_flickr_flickr_type_id__volatile, publishing_authenticator_shotwell_flickr_flickr_type_id); + } + return publishing_authenticator_shotwell_flickr_flickr_type_id__volatile; +} + + +static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) { + if ((array != NULL) && (destroy_func != NULL)) { + int i; + for (i = 0; i < array_length; i = i + 1) { + if (((gpointer*) array)[i] != NULL) { + destroy_func (((gpointer*) array)[i]); + } + } + } +} + + +static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) { + _vala_array_destroy (array, array_length, destroy_func); + g_free (array); +} + + + diff --git a/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala new file mode 100644 index 0000000..e389908 --- /dev/null +++ b/plugins/authenticator/shotwell/FlickrPublishingAuthenticator.vala @@ -0,0 +1,552 @@ +/* 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.Authenticator.Shotwell.Flickr { + internal const string ENDPOINT_URL = "https://api.flickr.com/services/rest"; + internal const string EXPIRED_SESSION_ERROR_CODE = "98"; + internal const string ENCODE_RFC_3986_EXTRA = "!*'();:@&=+$,/?%#[] \\"; + + internal class Transaction : Publishing.RESTSupport.Transaction { + public Transaction(Session session, Publishing.RESTSupport.HttpMethod method = + Publishing.RESTSupport.HttpMethod.POST) { + base(session, method); + setup_arguments(); + } + + public Transaction.with_uri(Session session, string uri, + Publishing.RESTSupport.HttpMethod method = Publishing.RESTSupport.HttpMethod.POST) { + base.with_endpoint_url(session, uri, method); + setup_arguments(); + } + + private void setup_arguments() { + var session = (Session) get_parent_session(); + + add_argument("oauth_nonce", session.get_oauth_nonce()); + add_argument("oauth_signature_method", "HMAC-SHA1"); + add_argument("oauth_version", "1.0"); + add_argument("oauth_callback", "oob"); + add_argument("oauth_timestamp", session.get_oauth_timestamp()); + add_argument("oauth_consumer_key", session.get_consumer_key()); + } + + + public override void execute() throws Spit.Publishing.PublishingError { + ((Session) get_parent_session()).sign_transaction(this); + + base.execute(); + } + } + + internal class Session : Publishing.RESTSupport.Session { + private string? request_phase_token = null; + private string? request_phase_token_secret = null; + private string? access_phase_token = null; + private string? access_phase_token_secret = null; + private string? username = null; + private string? consumer_key = null; + private string? consumer_secret = null; + + public Session() { + base(); + } + + public override bool is_authenticated() { + return (access_phase_token != null && access_phase_token_secret != null && + username != null); + } + + public void authenticate_from_persistent_credentials(string token, string secret, + string username) { + this.access_phase_token = token; + this.access_phase_token_secret = secret; + this.username = username; + + this.authenticated(); + } + + public void deauthenticate() { + access_phase_token = null; + access_phase_token_secret = null; + username = null; + } + + public void set_api_credentials(string consumer_key, string consumer_secret) { + this.consumer_key = consumer_key; + this.consumer_secret = consumer_secret; + } + + public void sign_transaction(Publishing.RESTSupport.Transaction txn) { + string http_method = txn.get_method().to_string(); + + debug("signing transaction with parameters:"); + debug("HTTP method = " + http_method); + + Publishing.RESTSupport.Argument[] base_string_arguments = txn.get_arguments(); + + Publishing.RESTSupport.Argument[] sorted_args = + Publishing.RESTSupport.Argument.sort(base_string_arguments); + + string arguments_string = ""; + for (int i = 0; i < sorted_args.length; i++) { + arguments_string += (sorted_args[i].key + "=" + sorted_args[i].value); + if (i < sorted_args.length - 1) + arguments_string += "&"; + } + + string? signing_key = null; + if (access_phase_token_secret != null) { + debug("access phase token secret available; using it as signing key"); + + signing_key = consumer_secret + "&" + access_phase_token_secret; + } else if (request_phase_token_secret != null) { + debug("request phase token secret available; using it as signing key"); + + signing_key = consumer_secret + "&" + request_phase_token_secret; + } else { + debug("neither access phase nor request phase token secrets available; using API " + + "key as signing key"); + + signing_key = consumer_secret + "&"; + } + + string signature_base_string = http_method + "&" + Soup.URI.encode( + txn.get_endpoint_url(), ENCODE_RFC_3986_EXTRA) + "&" + + Soup.URI.encode(arguments_string, ENCODE_RFC_3986_EXTRA); + + debug("signature base string = '%s'", signature_base_string); + + debug("signing key = '%s'", signing_key); + + // compute the signature + string signature = RESTSupport.hmac_sha1(signing_key, signature_base_string); + signature = Soup.URI.encode(signature, ENCODE_RFC_3986_EXTRA); + + debug("signature = '%s'", signature); + + txn.add_argument("oauth_signature", signature); + } + + public void set_request_phase_credentials(string token, string secret) { + this.request_phase_token = token; + this.request_phase_token_secret = secret; + } + + public void set_access_phase_credentials(string token, string secret, string username) { + this.access_phase_token = token; + this.access_phase_token_secret = secret; + this.username = username; + + authenticated(); + } + + public string get_oauth_nonce() { + TimeVal currtime = TimeVal(); + currtime.get_current_time(); + + return Checksum.compute_for_string(ChecksumType.MD5, currtime.tv_sec.to_string() + + currtime.tv_usec.to_string()); + } + + public string get_oauth_timestamp() { + return GLib.get_real_time().to_string().substring(0, 10); + } + + public string get_consumer_key() { + assert(consumer_key != null); + return consumer_key; + } + + public string get_request_phase_token() { + assert(request_phase_token != null); + return request_phase_token; + } + + public string get_access_phase_token() { + assert(access_phase_token != null); + return access_phase_token; + } + + public string get_access_phase_token_secret() { + assert(access_phase_token_secret != null); + return access_phase_token_secret; + } + + public string get_username() { + assert(is_authenticated()); + return username; + } + } + internal const string API_KEY = "60dd96d4a2ad04888b09c9e18d82c26f"; + internal const string API_SECRET = "d0960565e03547c1"; + + internal const string SERVICE_WELCOME_MESSAGE = + _("You are not currently logged into Flickr.\n\nClick Log in to log into Flickr in your Web browser. You will have to authorize Shotwell Connect to link to your Flickr account."); + + internal class AuthenticationRequestTransaction : Transaction { + public AuthenticationRequestTransaction(Session session) { + base.with_uri(session, "https://www.flickr.com/services/oauth/request_token", + Publishing.RESTSupport.HttpMethod.GET); + } + } + + internal class AccessTokenFetchTransaction : Transaction { + public AccessTokenFetchTransaction(Session session, string user_verifier) { + base.with_uri(session, "https://www.flickr.com/services/oauth/access_token", + Publishing.RESTSupport.HttpMethod.GET); + add_argument("oauth_verifier", user_verifier); + add_argument("oauth_token", session.get_request_phase_token()); + } + } + + internal class PinEntryPane : Spit.Publishing.DialogPane, GLib.Object { + private Gtk.Box pane_widget = null; + private Gtk.Button continue_button = null; + private Gtk.Entry pin_entry = null; + private Gtk.Label pin_entry_caption = null; + private Gtk.Label explanatory_text = null; + private Gtk.Builder builder = null; + + public signal void proceed(PinEntryPane sender, string authorization_pin); + + public PinEntryPane(Gtk.Builder builder) { + this.builder = builder; + assert(builder != null); + assert(builder.get_objects().length() > 0); + + explanatory_text = builder.get_object("explanatory_text") as Gtk.Label; + pin_entry_caption = builder.get_object("pin_entry_caption") as Gtk.Label; + pin_entry = builder.get_object("pin_entry") as Gtk.Entry; + continue_button = builder.get_object("continue_button") as Gtk.Button; + + pane_widget = builder.get_object("pane_widget") as Gtk.Box; + + pane_widget.show_all(); + + on_pin_entry_contents_changed(); + } + + private void on_continue_clicked() { + proceed(this, pin_entry.get_text()); + } + + private void on_pin_entry_contents_changed() { + continue_button.set_sensitive(pin_entry.text_length > 0); + } + + public Gtk.Widget get_widget() { + return pane_widget; + } + + public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() { + return Spit.Publishing.DialogPane.GeometryOptions.NONE; + } + + public void on_pane_installed() { + continue_button.clicked.connect(on_continue_clicked); + pin_entry.changed.connect(on_pin_entry_contents_changed); + } + + public void on_pane_uninstalled() { + continue_button.clicked.disconnect(on_continue_clicked); + pin_entry.changed.disconnect(on_pin_entry_contents_changed); + } + } + + + internal class Flickr : GLib.Object, Spit.Publishing.Authenticator { + private GLib.HashTable params; + private Session session; + private Spit.Publishing.PluginHost host; + + public Flickr(Spit.Publishing.PluginHost host) { + base(); + + this.host = host; + params = new GLib.HashTable(str_hash, str_equal); + params.insert("ConsumerKey", API_KEY); + params.insert("ConsumerSecret", API_SECRET); + + session = new Session(); + session.set_api_credentials(API_KEY, API_SECRET); + session.authenticated.connect(on_session_authenticated); + } + + ~Flickr() { + session.authenticated.disconnect(on_session_authenticated); + } + + public void invalidate_persistent_session() { + set_persistent_access_phase_token(""); + set_persistent_access_phase_token_secret(""); + set_persistent_access_phase_username(""); + } + + private bool is_persistent_session_valid() { + return (get_persistent_access_phase_username() != null && + get_persistent_access_phase_token() != null && + get_persistent_access_phase_token_secret() != null); + } + + private string? get_persistent_access_phase_username() { + return host.get_config_string("access_phase_username", null); + } + + private void set_persistent_access_phase_username(string username) { + host.set_config_string("access_phase_username", username); + } + + private string? get_persistent_access_phase_token() { + return host.get_config_string("access_phase_token", null); + } + + private void set_persistent_access_phase_token(string token) { + host.set_config_string("access_phase_token", token); + } + + private string? get_persistent_access_phase_token_secret() { + return host.get_config_string("access_phase_token_secret", null); + } + + private void set_persistent_access_phase_token_secret(string secret) { + host.set_config_string("access_phase_token_secret", secret); + } + + public void authenticate() { + if (is_persistent_session_valid()) { + debug("attempt start: a persistent session is available; using it"); + + session.authenticate_from_persistent_credentials(get_persistent_access_phase_token(), + get_persistent_access_phase_token_secret(), get_persistent_access_phase_username()); + } else { + debug("attempt start: no persistent session available; showing login welcome pane"); + do_show_login_welcome_pane(); + } + } + + public bool can_logout() { + return true; + } + + public GLib.HashTable get_authentication_parameter() { + return this.params; + } + + public void logout () { + session.deauthenticate(); + invalidate_persistent_session(); + } + + public void refresh() { + // No-Op with flickr + } + + private void do_show_login_welcome_pane() { + debug("ACTION: installing login welcome pane"); + + host.set_service_locked(false); + host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_welcome_pane_login_clicked); + } + + private void on_welcome_pane_login_clicked() { + debug("EVENT: user clicked 'Login' button in the welcome pane"); + + do_run_authentication_request_transaction(); + } + + private void do_run_authentication_request_transaction() { + debug("ACTION: running authentication request transaction"); + + host.set_service_locked(true); + host.install_static_message_pane(_("Preparing for login…")); + + AuthenticationRequestTransaction txn = new AuthenticationRequestTransaction(session); + txn.completed.connect(on_auth_request_txn_completed); + txn.network_error.connect(on_auth_request_txn_error); + + try { + txn.execute(); + } catch (Spit.Publishing.PublishingError err) { + host.post_error(err); + } + } + + private void on_auth_request_txn_completed(Publishing.RESTSupport.Transaction txn) { + txn.completed.disconnect(on_auth_request_txn_completed); + txn.network_error.disconnect(on_auth_request_txn_error); + + debug("EVENT: OAuth authentication request transaction completed; response = '%s'", + txn.get_response()); + + do_parse_token_info_from_auth_request(txn.get_response()); + } + + private void on_auth_request_txn_error(Publishing.RESTSupport.Transaction txn, + Spit.Publishing.PublishingError err) { + txn.completed.disconnect(on_auth_request_txn_completed); + txn.network_error.disconnect(on_auth_request_txn_error); + + debug("EVENT: OAuth authentication request transaction caused a network error"); + host.post_error(err); + + this.authentication_failed(); + } + + private void do_parse_token_info_from_auth_request(string response) { + debug("ACTION: parsing authorization request response '%s' into token and secret", response); + + string? oauth_token = null; + string? oauth_token_secret = null; + + var data = Soup.Form.decode(response); + data.lookup_extended("oauth_token", null, out oauth_token); + data.lookup_extended("oauth_token_secret", null, out oauth_token_secret); + + if (oauth_token == null || oauth_token_secret == null) + host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( + "'%s' isn't a valid response to an OAuth authentication request", response)); + + + on_authentication_token_available(oauth_token, oauth_token_secret); + } + + private void on_authentication_token_available(string token, string token_secret) { + debug("EVENT: OAuth authentication token (%s) and token secret (%s) available", + token, token_secret); + + session.set_request_phase_credentials(token, token_secret); + + do_launch_system_browser(token); + } + + private void on_system_browser_launched() { + debug("EVENT: system browser launched."); + + do_show_pin_entry_pane(); + } + + private void on_pin_entry_proceed(PinEntryPane sender, string pin) { + sender.proceed.disconnect(on_pin_entry_proceed); + + debug("EVENT: user clicked 'Continue' in PIN entry pane."); + + do_verify_pin(pin); + } + + private void do_launch_system_browser(string token) { + string login_uri = "https://www.flickr.com/services/oauth/authorize?oauth_token=" + token + + "&perms=write"; + + debug("ACTION: launching system browser with uri = '%s'", login_uri); + + try { + Process.spawn_command_line_async("xdg-open " + login_uri); + } catch (SpawnError e) { + host.post_error(new Spit.Publishing.PublishingError.LOCAL_FILE_ERROR( + "couldn't launch system web browser to complete Flickr login")); + return; + } + + on_system_browser_launched(); + } + + private void do_show_pin_entry_pane() { + debug("ACTION: showing PIN entry pane"); + + Gtk.Builder builder = new Gtk.Builder(); + + try { + builder.add_from_resource (Resources.RESOURCE_PATH + "/" + + "flickr_pin_entry_pane.ui"); + } catch (Error e) { + warning("Could not parse UI file! Error: %s.", e.message); + host.post_error( + new Spit.Publishing.PublishingError.LOCAL_FILE_ERROR( + _("A file required for publishing is unavailable. Publishing to Flickr can’t continue."))); + return; + } + + PinEntryPane pin_entry_pane = new PinEntryPane(builder); + pin_entry_pane.proceed.connect(on_pin_entry_proceed); + host.install_dialog_pane(pin_entry_pane); + } + + private void do_verify_pin(string pin) { + debug("ACTION: validating authorization PIN %s", pin); + + host.set_service_locked(true); + host.install_static_message_pane(_("Verifying authorization…")); + + AccessTokenFetchTransaction txn = new AccessTokenFetchTransaction(session, pin); + txn.completed.connect(on_access_token_fetch_txn_completed); + txn.network_error.connect(on_access_token_fetch_error); + + try { + txn.execute(); + } catch (Spit.Publishing.PublishingError err) { + host.post_error(err); + } + } + + private void on_access_token_fetch_txn_completed(Publishing.RESTSupport.Transaction txn) { + txn.completed.disconnect(on_access_token_fetch_txn_completed); + txn.network_error.disconnect(on_access_token_fetch_error); + + debug("EVENT: fetching OAuth access token over the network succeeded"); + + do_extract_access_phase_credentials_from_reponse(txn.get_response()); + } + + private void on_access_token_fetch_error(Publishing.RESTSupport.Transaction txn, + Spit.Publishing.PublishingError err) { + txn.completed.disconnect(on_access_token_fetch_txn_completed); + txn.network_error.disconnect(on_access_token_fetch_error); + + debug("EVENT: fetching OAuth access token over the network caused an error."); + + host.post_error(err); + this.authentication_failed(); + } + + private void do_extract_access_phase_credentials_from_reponse(string response) { + debug("ACTION: extracting access phase credentials from '%s'", response); + + string? token = null; + string? token_secret = null; + string? username = null; + + var data = Soup.Form.decode(response); + data.lookup_extended("oauth_token", null, out token); + data.lookup_extended("oauth_token_secret", null, out token_secret); + data.lookup_extended("username", null, out username); + + debug("access phase credentials: { token = '%s'; token_secret = '%s'; username = '%s' }", + token, token_secret, username); + + if (token == null || token_secret == null || username == null) { + host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE("expected " + + "access phase credentials to contain token, token secret, and username but at " + + "least one of these is absent")); + this.authentication_failed(); + } else { + session.set_access_phase_credentials(token, token_secret, username); + } + } + + private void on_session_authenticated() { + params.insert("AuthToken", session.get_access_phase_token()); + params.insert("AuthTokenSecret", session.get_access_phase_token_secret()); + params.insert("Username", session.get_username()); + + set_persistent_access_phase_token(session.get_access_phase_token()); + set_persistent_access_phase_token_secret(session.get_access_phase_token_secret()); + set_persistent_access_phase_username(session.get_username()); + + + this.authenticated(); + } + } +} diff --git a/plugins/authenticator/shotwell/GoogleAuthenticator.c b/plugins/authenticator/shotwell/GoogleAuthenticator.c new file mode 100644 index 0000000..938d8c4 --- /dev/null +++ b/plugins/authenticator/shotwell/GoogleAuthenticator.c @@ -0,0 +1,2690 @@ +/* GoogleAuthenticator.c generated by valac 0.34.4, the Vala compiler + * generated from GoogleAuthenticator.vala, do not modify */ + + +#include +#include +#include +#include +#include "shotwell-plugin-common.h" +#include +#include "shotwell-plugin-dev-1.0.h" +#include +#include +#include + + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE (publishing_authenticator_shotwell_google_web_authentication_pane_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_WEB_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellGoogleWebAuthenticationPane)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_WEB_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_WEB_AUTHENTICATION_PANE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_WEB_AUTHENTICATION_PANE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_WEB_AUTHENTICATION_PANE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleWebAuthenticationPane PublishingAuthenticatorShotwellGoogleWebAuthenticationPane; +typedef struct _PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass; +typedef struct _PublishingAuthenticatorShotwellGoogleWebAuthenticationPanePrivate PublishingAuthenticatorShotwellGoogleWebAuthenticationPanePrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) +#define _g_free0(var) (var = (g_free (var), NULL)) + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION (publishing_authenticator_shotwell_google_session_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION, PublishingAuthenticatorShotwellGoogleSession)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION, PublishingAuthenticatorShotwellGoogleSessionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION, PublishingAuthenticatorShotwellGoogleSessionClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleSession PublishingAuthenticatorShotwellGoogleSession; +typedef struct _PublishingAuthenticatorShotwellGoogleSessionClass PublishingAuthenticatorShotwellGoogleSessionClass; +typedef struct _PublishingAuthenticatorShotwellGoogleSessionPrivate PublishingAuthenticatorShotwellGoogleSessionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION (publishing_authenticator_shotwell_google_get_access_tokens_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION, PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION, PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GET_ACCESS_TOKENS_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GET_ACCESS_TOKENS_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION, PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction; +typedef struct _PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass; +typedef struct _PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionPrivate PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION (publishing_authenticator_shotwell_google_refresh_access_token_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION, PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION, PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_REFRESH_ACCESS_TOKEN_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_REFRESH_ACCESS_TOKEN_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION, PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction; +typedef struct _PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass; +typedef struct _PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionPrivate PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION (publishing_authenticator_shotwell_google_username_fetch_transaction_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION, PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION, PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_USERNAME_FETCH_TRANSACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_USERNAME_FETCH_TRANSACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION, PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction; +typedef struct _PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass; +typedef struct _PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionPrivate PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionPrivate; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE (publishing_authenticator_shotwell_google_google_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogleClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogleClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleGoogle PublishingAuthenticatorShotwellGoogleGoogle; +typedef struct _PublishingAuthenticatorShotwellGoogleGoogleClass PublishingAuthenticatorShotwellGoogleGoogleClass; +typedef struct _PublishingAuthenticatorShotwellGoogleGooglePrivate PublishingAuthenticatorShotwellGoogleGooglePrivate; +#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL))) +#define _publishing_rest_support_session_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_session_unref (var), NULL))) +#define _publishing_rest_support_transaction_unref0(var) ((var == NULL) ? NULL : (var = (publishing_rest_support_transaction_unref (var), NULL))) +#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL))) +#define _json_object_unref0(var) ((var == NULL) ? NULL : (var = (json_object_unref (var), NULL))) +#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); +#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; } +#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; } +#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg); + +struct _PublishingAuthenticatorShotwellGoogleWebAuthenticationPane { + ShotwellPluginsCommonWebAuthenticationPane parent_instance; + PublishingAuthenticatorShotwellGoogleWebAuthenticationPanePrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass { + ShotwellPluginsCommonWebAuthenticationPaneClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleSession { + PublishingRESTSupportSession parent_instance; + PublishingAuthenticatorShotwellGoogleSessionPrivate * priv; + gchar* access_token; + gchar* refresh_token; + gint64 expires_at; +}; + +struct _PublishingAuthenticatorShotwellGoogleSessionClass { + PublishingRESTSupportSessionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction { + PublishingRESTSupportTransaction parent_instance; + PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass { + PublishingRESTSupportTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction { + PublishingRESTSupportTransaction parent_instance; + PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass { + PublishingRESTSupportTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction { + PublishingRESTSupportTransaction parent_instance; + PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionPrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass { + PublishingRESTSupportTransactionClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleGoogle { + GObject parent_instance; + PublishingAuthenticatorShotwellGoogleGooglePrivate * priv; +}; + +struct _PublishingAuthenticatorShotwellGoogleGoogleClass { + GObjectClass parent_class; +}; + +struct _PublishingAuthenticatorShotwellGoogleGooglePrivate { + gchar* scope; + SpitPublishingPluginHost* host; + GHashTable* params; + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* web_auth_pane; + PublishingAuthenticatorShotwellGoogleSession* session; + gchar* welcome_message; +}; + + +static gpointer publishing_authenticator_shotwell_google_web_authentication_pane_parent_class = NULL; +extern gboolean publishing_authenticator_shotwell_google_web_authentication_pane_cache_dirty; +gboolean publishing_authenticator_shotwell_google_web_authentication_pane_cache_dirty = FALSE; +static gpointer publishing_authenticator_shotwell_google_session_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_google_get_access_tokens_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_google_refresh_access_token_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_google_username_fetch_transaction_parent_class = NULL; +static gpointer publishing_authenticator_shotwell_google_google_parent_class = NULL; +static SpitPublishingAuthenticatorIface* publishing_authenticator_shotwell_google_google_spit_publishing_authenticator_parent_iface = NULL; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_ID "534227538559-hvj2e8bj0vfv2f49r7gvjoq6jibfav67.apps.googleusercontent.c" \ +"om" +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_SECRET "pwpzZ7W1TCcD5uIfYCu8sM7x" +GType publishing_authenticator_shotwell_google_web_authentication_pane_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_WEB_AUTHENTICATION_PANE_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* publishing_authenticator_shotwell_google_web_authentication_pane_new (const gchar* auth_sequence_start_url); +PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* publishing_authenticator_shotwell_google_web_authentication_pane_construct (GType object_type, const gchar* auth_sequence_start_url); +gboolean publishing_authenticator_shotwell_google_web_authentication_pane_is_cache_dirty (void); +static void publishing_authenticator_shotwell_google_web_authentication_pane_real_on_page_load (ShotwellPluginsCommonWebAuthenticationPane* base); +static void publishing_authenticator_shotwell_google_web_authentication_pane_finalize (GObject* obj); +GType publishing_authenticator_shotwell_google_session_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_SESSION_DUMMY_PROPERTY +}; +static gboolean publishing_authenticator_shotwell_google_session_real_is_authenticated (PublishingRESTSupportSession* base); +void publishing_authenticator_shotwell_google_session_deauthenticate (PublishingAuthenticatorShotwellGoogleSession* self); +PublishingAuthenticatorShotwellGoogleSession* publishing_authenticator_shotwell_google_session_new (void); +PublishingAuthenticatorShotwellGoogleSession* publishing_authenticator_shotwell_google_session_construct (GType object_type); +static void publishing_authenticator_shotwell_google_session_finalize (PublishingRESTSupportSession* obj); +GType publishing_authenticator_shotwell_google_get_access_tokens_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION_DUMMY_PROPERTY +}; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION_ENDPOINT_URL "https://accounts.google.com/o/oauth2/token" +PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* publishing_authenticator_shotwell_google_get_access_tokens_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session, const gchar* auth_code); +PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* publishing_authenticator_shotwell_google_get_access_tokens_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session, const gchar* auth_code); +GType publishing_authenticator_shotwell_google_refresh_access_token_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION_DUMMY_PROPERTY +}; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION_ENDPOINT_URL "https://accounts.google.com/o/oauth2/token" +PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* publishing_authenticator_shotwell_google_refresh_access_token_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session); +PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* publishing_authenticator_shotwell_google_refresh_access_token_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session); +GType publishing_authenticator_shotwell_google_username_fetch_transaction_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION_DUMMY_PROPERTY +}; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION_ENDPOINT_URL "https://www.googleapis.com/oauth2/v1/userinfo" +PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* publishing_authenticator_shotwell_google_username_fetch_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session); +PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* publishing_authenticator_shotwell_google_username_fetch_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session); +GType publishing_authenticator_shotwell_google_google_get_type (void) G_GNUC_CONST; +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGooglePrivate)) +enum { + PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_DUMMY_PROPERTY +}; +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_new (const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_construct (GType object_type, const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host); +static void _g_free0_ (gpointer var); +static void _g_variant_unref0_ (gpointer var); +static void publishing_authenticator_shotwell_google_google_real_authenticate (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_google_google_on_refresh_token_available (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* token); +static void publishing_authenticator_shotwell_google_google_do_exchange_refresh_token_for_access_token (PublishingAuthenticatorShotwellGoogleGoogle* self); +static void publishing_authenticator_shotwell_google_google_do_show_service_welcome_pane (PublishingAuthenticatorShotwellGoogleGoogle* self); +static gboolean publishing_authenticator_shotwell_google_google_real_can_logout (SpitPublishingAuthenticator* base); +static GHashTable* publishing_authenticator_shotwell_google_google_real_get_authentication_parameter (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_google_google_real_logout (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_google_google_real_refresh (SpitPublishingAuthenticator* base); +static void publishing_authenticator_shotwell_google_google_do_hosted_web_authentication (PublishingAuthenticatorShotwellGoogleGoogle* self); +static void publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* auth_code); +static void _publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized_publishing_authenticator_shotwell_google_web_authentication_pane_authorized (PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _sender, const gchar* auth_code, gpointer self); +static void publishing_authenticator_shotwell_google_google_do_get_access_tokens (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* auth_code); +static void publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn); +static void _publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self); +static void publishing_authenticator_shotwell_google_google_on_get_access_tokens_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err); +static void _publishing_authenticator_shotwell_google_google_on_get_access_tokens_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self); +static void publishing_authenticator_shotwell_google_google_do_extract_tokens (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* response_body); +static void publishing_authenticator_shotwell_google_google_on_expiry_time_avilable (PublishingAuthenticatorShotwellGoogleGoogle* self, gint64 abs_time); +static void publishing_authenticator_shotwell_google_google_on_access_token_available (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* token); +static void publishing_authenticator_shotwell_google_google_do_fetch_username (PublishingAuthenticatorShotwellGoogleGoogle* self); +static void publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn); +static void _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self); +static void publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err); +static void _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self); +static void publishing_authenticator_shotwell_google_google_do_extract_username (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* response_body); +static void publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn); +static void _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self); +static void publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err); +static void _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self); +static gboolean ___lambda4_ (PublishingAuthenticatorShotwellGoogleGoogle* self); +static gboolean ____lambda4__gsource_func (gpointer self); +static void publishing_authenticator_shotwell_google_google_on_service_welcome_login (PublishingAuthenticatorShotwellGoogleGoogle* self); +static void _publishing_authenticator_shotwell_google_google_on_service_welcome_login_spit_publishing_login_callback (gpointer self); +static void publishing_authenticator_shotwell_google_google_finalize (GObject* obj); + + +PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* publishing_authenticator_shotwell_google_web_authentication_pane_construct (GType object_type, const gchar* auth_sequence_start_url) { + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane * self = NULL; + const gchar* _tmp0_ = NULL; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (auth_sequence_start_url != NULL, NULL); +#line 14 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = auth_sequence_start_url; +#line 14 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleWebAuthenticationPane*) g_object_new (object_type, "login-uri", _tmp0_, NULL); +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 269 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* publishing_authenticator_shotwell_google_web_authentication_pane_new (const gchar* auth_sequence_start_url) { +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_web_authentication_pane_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, auth_sequence_start_url); +#line 276 "GoogleAuthenticator.c" +} + + +gboolean publishing_authenticator_shotwell_google_web_authentication_pane_is_cache_dirty (void) { + gboolean result = FALSE; + gboolean _tmp0_ = FALSE; +#line 18 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = publishing_authenticator_shotwell_google_web_authentication_pane_cache_dirty; +#line 18 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + result = _tmp0_; +#line 18 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 289 "GoogleAuthenticator.c" +} + + +static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) { + gint result = 0; + gchar* _result_ = NULL; + gint _tmp0_ = 0; + const gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 987 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, 0); +#line 987 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (needle != NULL, 0); +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = start_index; +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = needle; +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_); +#line 988 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _result_ = _tmp2_; +#line 990 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = _result_; +#line 990 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp3_ != NULL) { +#line 316 "GoogleAuthenticator.c" + gchar* _tmp4_ = NULL; +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = _result_; +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = (gint) (_tmp4_ - ((gchar*) self)); +#line 991 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 324 "GoogleAuthenticator.c" + } else { +#line 993 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = -1; +#line 993 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 330 "GoogleAuthenticator.c" + } +} + + +static glong string_strnlen (gchar* str, glong maxlen) { + glong result = 0L; + gchar* end = NULL; + gchar* _tmp0_ = NULL; + glong _tmp1_ = 0L; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = str; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = maxlen; +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_); +#line 1295 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + end = _tmp2_; +#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = end; +#line 1296 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp3_ == NULL) { +#line 354 "GoogleAuthenticator.c" + glong _tmp4_ = 0L; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = maxlen; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp4_; +#line 1297 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 362 "GoogleAuthenticator.c" + } else { + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = end; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = str; +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = (glong) (_tmp5_ - _tmp6_); +#line 1299 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 374 "GoogleAuthenticator.c" + } +} + + +static gchar* string_substring (const gchar* self, glong offset, glong len) { + gchar* result = NULL; + glong string_length = 0L; + gboolean _tmp0_ = FALSE; + glong _tmp1_ = 0L; + glong _tmp8_ = 0L; + glong _tmp14_ = 0L; + glong _tmp17_ = 0L; + glong _tmp18_ = 0L; + glong _tmp19_ = 0L; + glong _tmp20_ = 0L; + glong _tmp21_ = 0L; + gchar* _tmp22_ = NULL; +#line 1306 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (self != NULL, NULL); +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp1_ = offset; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp1_ >= ((glong) 0)) { +#line 398 "GoogleAuthenticator.c" + glong _tmp2_ = 0L; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp2_ = len; +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = _tmp2_ >= ((glong) 0); +#line 404 "GoogleAuthenticator.c" + } else { +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp0_ = FALSE; +#line 408 "GoogleAuthenticator.c" + } +#line 1308 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp0_) { +#line 412 "GoogleAuthenticator.c" + glong _tmp3_ = 0L; + glong _tmp4_ = 0L; + glong _tmp5_ = 0L; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp3_ = offset; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp4_ = len; +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp5_ = string_strnlen ((gchar*) self, _tmp3_ + _tmp4_); +#line 1310 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + string_length = _tmp5_; +#line 424 "GoogleAuthenticator.c" + } else { + gint _tmp6_ = 0; + gint _tmp7_ = 0; +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp6_ = strlen (self); +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp7_ = _tmp6_; +#line 1312 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + string_length = (glong) _tmp7_; +#line 434 "GoogleAuthenticator.c" + } +#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp8_ = offset; +#line 1315 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp8_ < ((glong) 0)) { +#line 440 "GoogleAuthenticator.c" + glong _tmp9_ = 0L; + glong _tmp10_ = 0L; + glong _tmp11_ = 0L; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp9_ = string_length; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp10_ = offset; +#line 1316 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + offset = _tmp9_ + _tmp10_; +#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp11_ = offset; +#line 1317 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp11_ >= ((glong) 0), NULL); +#line 454 "GoogleAuthenticator.c" + } else { + glong _tmp12_ = 0L; + glong _tmp13_ = 0L; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp12_ = offset; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp13_ = string_length; +#line 1319 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail (_tmp12_ <= _tmp13_, NULL); +#line 464 "GoogleAuthenticator.c" + } +#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp14_ = len; +#line 1321 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + if (_tmp14_ < ((glong) 0)) { +#line 470 "GoogleAuthenticator.c" + glong _tmp15_ = 0L; + glong _tmp16_ = 0L; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp15_ = string_length; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp16_ = offset; +#line 1322 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + len = _tmp15_ - _tmp16_; +#line 479 "GoogleAuthenticator.c" + } +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp17_ = offset; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp18_ = len; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp19_ = string_length; +#line 1324 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + g_return_val_if_fail ((_tmp17_ + _tmp18_) <= _tmp19_, NULL); +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp20_ = offset; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp21_ = len; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + _tmp22_ = g_strndup (((gchar*) self) + _tmp20_, (gsize) _tmp21_); +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + result = _tmp22_; +#line 1325 "/usr/share/vala-0.34/vapi/glib-2.0.vapi" + return result; +#line 499 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_web_authentication_pane_real_on_page_load (ShotwellPluginsCommonWebAuthenticationPane* base) { + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane * self; + gchar* page_title = NULL; + WebKitWebView* _tmp0_ = NULL; + WebKitWebView* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gint _tmp6_ = 0; +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellGoogleWebAuthenticationPane); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = shotwell_plugins_common_web_authentication_pane_get_view (G_TYPE_CHECK_INSTANCE_CAST (self, SHOTWELL_PLUGINS_COMMON_TYPE_WEB_AUTHENTICATION_PANE, ShotwellPluginsCommonWebAuthenticationPane)); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = _tmp0_; +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = webkit_web_view_get_title (_tmp1_); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (_tmp1_); +#line 22 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + page_title = _tmp4_; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = page_title; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = string_index_of (_tmp5_, "state=connect", 0); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp6_ > 0) { +#line 535 "GoogleAuthenticator.c" + gint auth_code_field_start = 0; + const gchar* _tmp7_ = NULL; + gint _tmp8_ = 0; + gint _tmp9_ = 0; + gchar* auth_code = NULL; + const gchar* _tmp10_ = NULL; + gint _tmp11_ = 0; + gchar* _tmp12_ = NULL; + const gchar* _tmp13_ = NULL; +#line 24 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = page_title; +#line 24 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = string_index_of (_tmp7_, "code=", 0); +#line 24 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + auth_code_field_start = _tmp8_; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = auth_code_field_start; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp9_ < 0) { +#line 26 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (page_title); +#line 26 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 559 "GoogleAuthenticator.c" + } +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp10_ = page_title; +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp11_ = auth_code_field_start; +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp12_ = string_substring (_tmp10_, (glong) (_tmp11_ + 5), (glong) -1); +#line 28 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + auth_code = _tmp12_; +#line 30 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_web_authentication_pane_cache_dirty = TRUE; +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp13_ = auth_code; +#line 32 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_emit_by_name (self, "authorized", _tmp13_); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (auth_code); +#line 577 "GoogleAuthenticator.c" + } +#line 21 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (page_title); +#line 581 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_web_authentication_pane_class_init (PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass * klass) { +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_web_authentication_pane_parent_class = g_type_class_peek_parent (klass); +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + ((ShotwellPluginsCommonWebAuthenticationPaneClass *) klass)->on_page_load = publishing_authenticator_shotwell_google_web_authentication_pane_real_on_page_load; +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_google_web_authentication_pane_finalize; +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_new ("authorized", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); +#line 594 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_web_authentication_pane_instance_init (PublishingAuthenticatorShotwellGoogleWebAuthenticationPane * self) { +} + + +static void publishing_authenticator_shotwell_google_web_authentication_pane_finalize (GObject* obj) { + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane * self; +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, PublishingAuthenticatorShotwellGoogleWebAuthenticationPane); +#line 8 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_google_web_authentication_pane_parent_class)->finalize (obj); +#line 608 "GoogleAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_google_web_authentication_pane_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_web_authentication_pane_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_web_authentication_pane_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleWebAuthenticationPaneClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_web_authentication_pane_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleWebAuthenticationPane), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_web_authentication_pane_instance_init, NULL }; + GType publishing_authenticator_shotwell_google_web_authentication_pane_type_id; + publishing_authenticator_shotwell_google_web_authentication_pane_type_id = g_type_register_static (SHOTWELL_PLUGINS_COMMON_TYPE_WEB_AUTHENTICATION_PANE, "PublishingAuthenticatorShotwellGoogleWebAuthenticationPane", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_google_web_authentication_pane_type_id__volatile, publishing_authenticator_shotwell_google_web_authentication_pane_type_id); + } + return publishing_authenticator_shotwell_google_web_authentication_pane_type_id__volatile; +} + + +static gboolean publishing_authenticator_shotwell_google_session_real_is_authenticated (PublishingRESTSupportSession* base) { + PublishingAuthenticatorShotwellGoogleSession * self; + gboolean result = FALSE; + const gchar* _tmp0_ = NULL; +#line 42 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION, PublishingAuthenticatorShotwellGoogleSession); +#line 43 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->access_token; +#line 43 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + result = _tmp0_ != NULL; +#line 43 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 636 "GoogleAuthenticator.c" +} + + +void publishing_authenticator_shotwell_google_session_deauthenticate (PublishingAuthenticatorShotwellGoogleSession* self) { +#line 46 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION (self)); +#line 47 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->access_token); +#line 47 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->access_token = NULL; +#line 48 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->refresh_token); +#line 48 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->refresh_token = NULL; +#line 49 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->expires_at = (gint64) -1; +#line 653 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleSession* publishing_authenticator_shotwell_google_session_construct (GType object_type) { + PublishingAuthenticatorShotwellGoogleSession* self = NULL; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleSession*) publishing_rest_support_session_construct (object_type, NULL); +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 663 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleSession* publishing_authenticator_shotwell_google_session_new (void) { +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_session_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION); +#line 670 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_session_class_init (PublishingAuthenticatorShotwellGoogleSessionClass * klass) { +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_session_parent_class = g_type_class_peek_parent (klass); +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + ((PublishingRESTSupportSessionClass *) klass)->finalize = publishing_authenticator_shotwell_google_session_finalize; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + ((PublishingRESTSupportSessionClass *) klass)->is_authenticated = publishing_authenticator_shotwell_google_session_real_is_authenticated; +#line 681 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_session_instance_init (PublishingAuthenticatorShotwellGoogleSession * self) { +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->access_token = NULL; +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->refresh_token = NULL; +#line 40 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->expires_at = (gint64) -1; +#line 692 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_session_finalize (PublishingRESTSupportSession* obj) { + PublishingAuthenticatorShotwellGoogleSession * self; +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_SESSION, PublishingAuthenticatorShotwellGoogleSession); +#line 38 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->access_token); +#line 39 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->refresh_token); +#line 37 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + PUBLISHING_REST_SUPPORT_SESSION_CLASS (publishing_authenticator_shotwell_google_session_parent_class)->finalize (obj); +#line 706 "GoogleAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_google_session_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_session_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_session_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleSessionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_session_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleSession), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_session_instance_init, NULL }; + GType publishing_authenticator_shotwell_google_session_type_id; + publishing_authenticator_shotwell_google_session_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_SESSION, "PublishingAuthenticatorShotwellGoogleSession", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_google_session_type_id__volatile, publishing_authenticator_shotwell_google_session_type_id); + } + return publishing_authenticator_shotwell_google_session_type_id__volatile; +} + + +PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* publishing_authenticator_shotwell_google_get_access_tokens_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session, const gchar* auth_code) { + PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* self = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 56 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION (session), NULL); +#line 56 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (auth_code != NULL, NULL); +#line 57 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = session; +#line 57 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GET_ACCESS_TOKENS_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST); +#line 59 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = auth_code; +#line 59 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "code", _tmp1_); +#line 60 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "client_id", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_ID); +#line 61 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "client_secret", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_SECRET); +#line 62 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "redirect_uri", "urn:ietf:wg:oauth:2.0:oob"); +#line 63 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "grant_type", "authorization_code"); +#line 56 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 748 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* publishing_authenticator_shotwell_google_get_access_tokens_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session, const gchar* auth_code) { +#line 56 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_get_access_tokens_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GET_ACCESS_TOKENS_TRANSACTION, session, auth_code); +#line 755 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_get_access_tokens_transaction_class_init (PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass * klass) { +#line 53 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_get_access_tokens_transaction_parent_class = g_type_class_peek_parent (klass); +#line 762 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_get_access_tokens_transaction_instance_init (PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction * self) { +} + + +GType publishing_authenticator_shotwell_google_get_access_tokens_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleGetAccessTokensTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_get_access_tokens_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_get_access_tokens_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id; + publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id__volatile, publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id); + } + return publishing_authenticator_shotwell_google_get_access_tokens_transaction_type_id__volatile; +} + + +PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* publishing_authenticator_shotwell_google_refresh_access_token_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session) { + PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* self = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp0_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; +#line 70 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION (session), NULL); +#line 71 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = session; +#line 71 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_REFRESH_ACCESS_TOKEN_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_POST); +#line 73 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "client_id", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_ID); +#line 74 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "client_secret", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_SECRET); +#line 75 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = session; +#line 75 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = _tmp1_->refresh_token; +#line 75 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "refresh_token", _tmp2_); +#line 76 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_argument (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "grant_type", "refresh_token"); +#line 70 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 807 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* publishing_authenticator_shotwell_google_refresh_access_token_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session) { +#line 70 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_refresh_access_token_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_REFRESH_ACCESS_TOKEN_TRANSACTION, session); +#line 814 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_refresh_access_token_transaction_class_init (PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass * klass) { +#line 67 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_refresh_access_token_transaction_parent_class = g_type_class_peek_parent (klass); +#line 821 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_refresh_access_token_transaction_instance_init (PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction * self) { +} + + +GType publishing_authenticator_shotwell_google_refresh_access_token_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_refresh_access_token_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_refresh_access_token_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id; + publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id__volatile, publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id); + } + return publishing_authenticator_shotwell_google_refresh_access_token_transaction_type_id__volatile; +} + + +PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* publishing_authenticator_shotwell_google_username_fetch_transaction_construct (GType object_type, PublishingAuthenticatorShotwellGoogleSession* session) { + PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* self = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp0_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_SESSION (session), NULL); +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = session; +#line 83 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction*) publishing_rest_support_transaction_construct_with_endpoint_url (object_type, G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_USERNAME_FETCH_TRANSACTION_ENDPOINT_URL, PUBLISHING_REST_SUPPORT_HTTP_METHOD_GET); +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = session; +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = _tmp1_->access_token; +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = g_strconcat ("Bearer ", _tmp2_, NULL); +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = _tmp3_; +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_add_header (G_TYPE_CHECK_INSTANCE_CAST (self, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "Authorization", _tmp4_); +#line 84 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp4_); +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 868 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* publishing_authenticator_shotwell_google_username_fetch_transaction_new (PublishingAuthenticatorShotwellGoogleSession* session) { +#line 82 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_username_fetch_transaction_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_USERNAME_FETCH_TRANSACTION, session); +#line 875 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_username_fetch_transaction_class_init (PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass * klass) { +#line 80 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_username_fetch_transaction_parent_class = g_type_class_peek_parent (klass); +#line 882 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_username_fetch_transaction_instance_init (PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction * self) { +} + + +GType publishing_authenticator_shotwell_google_username_fetch_transaction_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_username_fetch_transaction_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_username_fetch_transaction_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleUsernameFetchTransactionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_username_fetch_transaction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_username_fetch_transaction_instance_init, NULL }; + GType publishing_authenticator_shotwell_google_username_fetch_transaction_type_id; + publishing_authenticator_shotwell_google_username_fetch_transaction_type_id = g_type_register_static (PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, "PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction", &g_define_type_info, 0); + g_once_init_leave (&publishing_authenticator_shotwell_google_username_fetch_transaction_type_id__volatile, publishing_authenticator_shotwell_google_username_fetch_transaction_type_id); + } + return publishing_authenticator_shotwell_google_username_fetch_transaction_type_id__volatile; +} + + +static gpointer _g_object_ref0 (gpointer self) { +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self ? g_object_ref (self) : NULL; +#line 905 "GoogleAuthenticator.c" +} + + +static void _g_free0_ (gpointer var) { +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + var = (g_free (var), NULL); +#line 912 "GoogleAuthenticator.c" +} + + +static void _g_variant_unref0_ (gpointer var) { +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)); +#line 919 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_construct (GType object_type, const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host) { + PublishingAuthenticatorShotwellGoogleGoogle * self = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + GHashFunc _tmp2_ = NULL; + GEqualFunc _tmp3_ = NULL; + GHashTable* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (scope != NULL, NULL); +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (welcome_message != NULL, NULL); +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_val_if_fail (SPIT_PUBLISHING_IS_PLUGIN_HOST (host), NULL); +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = (PublishingAuthenticatorShotwellGoogleGoogle*) g_object_new (object_type, NULL); +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = host; +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = _g_object_ref0 (_tmp0_); +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 99 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->host = _tmp1_; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = g_str_hash; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = g_str_equal; +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, _g_variant_unref0_); +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 100 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->params = _tmp4_; +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = scope; +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = g_strdup (_tmp5_); +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->priv->scope); +#line 101 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->scope = _tmp6_; +#line 102 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = publishing_authenticator_shotwell_google_session_new (); +#line 102 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_session_unref0 (self->priv->session); +#line 102 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->session = _tmp7_; +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = welcome_message; +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = g_strdup (_tmp8_); +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->priv->welcome_message); +#line 103 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->welcome_message = _tmp9_; +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self; +#line 985 "GoogleAuthenticator.c" +} + + +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_new (const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host) { +#line 96 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return publishing_authenticator_shotwell_google_google_construct (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, scope, welcome_message, host); +#line 992 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_real_authenticate (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellGoogleGoogle * self; + gchar* refresh_token = NULL; + SpitPublishingPluginHost* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gboolean _tmp2_ = FALSE; + const gchar* _tmp3_ = NULL; + gboolean _tmp6_ = FALSE; +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = spit_host_interface_get_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "refresh_token", NULL); +#line 107 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + refresh_token = _tmp1_; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = refresh_token; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp3_ != NULL) { +#line 1016 "GoogleAuthenticator.c" + const gchar* _tmp4_ = NULL; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = refresh_token; +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = g_strcmp0 (_tmp4_, "") != 0; +#line 1022 "GoogleAuthenticator.c" + } else { +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = FALSE; +#line 1026 "GoogleAuthenticator.c" + } +#line 108 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp2_) { +#line 1030 "GoogleAuthenticator.c" + const gchar* _tmp5_ = NULL; +#line 109 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = refresh_token; +#line 109 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_refresh_token_available (self, _tmp5_); +#line 110 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_exchange_refresh_token_for_access_token (self); +#line 111 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (refresh_token); +#line 111 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1042 "GoogleAuthenticator.c" + } +#line 115 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = publishing_authenticator_shotwell_google_web_authentication_pane_is_cache_dirty (); +#line 115 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp6_) { +#line 1048 "GoogleAuthenticator.c" + SpitPublishingPluginHost* _tmp7_ = NULL; + SpitPublishingPluginHost* _tmp8_ = NULL; + const gchar* _tmp9_ = NULL; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = self->priv->host; +#line 116 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp7_, FALSE); +#line 118 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = self->priv->host; +#line 118 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = _ ("You have already logged in and out of a Google service during this Sho" \ +"twell session.\n" \ +"\n" \ +"To continue publishing to Google services, quit and restart Shotwell, " \ +"then try publishing again."); +#line 118 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_static_message_pane (_tmp8_, _tmp9_, SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 1062 "GoogleAuthenticator.c" + } else { +#line 120 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_show_service_welcome_pane (self); +#line 1066 "GoogleAuthenticator.c" + } +#line 106 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (refresh_token); +#line 1070 "GoogleAuthenticator.c" +} + + +static gboolean publishing_authenticator_shotwell_google_google_real_can_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellGoogleGoogle * self; + gboolean result = FALSE; +#line 124 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + result = TRUE; +#line 125 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 1083 "GoogleAuthenticator.c" +} + + +static gpointer _g_hash_table_ref0 (gpointer self) { +#line 129 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self ? g_hash_table_ref (self) : NULL; +#line 1090 "GoogleAuthenticator.c" +} + + +static GHashTable* publishing_authenticator_shotwell_google_google_real_get_authentication_parameter (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellGoogleGoogle * self; + GHashTable* result = NULL; + GHashTable* _tmp0_ = NULL; + GHashTable* _tmp1_ = NULL; +#line 128 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 129 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->params; +#line 129 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = _g_hash_table_ref0 (_tmp0_); +#line 129 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + result = _tmp1_; +#line 129 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 1109 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_real_logout (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellGoogleGoogle * self; + PublishingAuthenticatorShotwellGoogleSession* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; +#line 132 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 133 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->session; +#line 133 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_session_deauthenticate (_tmp0_); +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 134 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "refresh_token", ""); +#line 1127 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_real_refresh (SpitPublishingAuthenticator* base) { + PublishingAuthenticatorShotwellGoogleGoogle * self; +#line 137 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 1135 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized_publishing_authenticator_shotwell_google_web_authentication_pane_authorized (PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _sender, const gchar* auth_code, gpointer self) { +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized ((PublishingAuthenticatorShotwellGoogleGoogle*) self, auth_code); +#line 1142 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_hosted_web_authentication (PublishingAuthenticatorShotwellGoogleGoogle* self) { + gchar* user_authorization_url = NULL; + gchar* _tmp0_ = NULL; + gchar* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + const gchar* _tmp8_ = NULL; + gchar* _tmp9_ = NULL; + gchar* _tmp10_ = NULL; + gchar* _tmp11_ = NULL; + gchar* _tmp12_ = NULL; + gchar* _tmp13_ = NULL; + gchar* _tmp14_ = NULL; + gchar* _tmp15_ = NULL; + gchar* _tmp16_ = NULL; + gchar* _tmp17_ = NULL; + gchar* _tmp18_ = NULL; + gchar* _tmp19_ = NULL; + gchar* _tmp20_ = NULL; + gchar* _tmp21_ = NULL; + gchar* _tmp22_ = NULL; + gchar* _tmp23_ = NULL; + gchar* _tmp24_ = NULL; + gchar* _tmp25_ = NULL; + gchar* _tmp26_ = NULL; + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _tmp27_ = NULL; + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _tmp28_ = NULL; + SpitPublishingPluginHost* _tmp29_ = NULL; + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _tmp30_ = NULL; +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 142 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:142: ACTION: running OAuth authentication flo" \ +"w in hosted web pane."); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = soup_uri_encode ("urn:ietf:wg:oauth:2.0:oob", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = _tmp0_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = g_strconcat ("https://accounts.google.com/o/oauth2/auth?" "response_type=code&" "client_id=" PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_OAUTH_CLIENT_ID "&" "redirect_uri=", _tmp1_, NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = _tmp2_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = g_strconcat (_tmp3_, "&", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = _tmp4_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = g_strconcat (_tmp5_, "scope=", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = self->priv->scope; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = soup_uri_encode (_tmp8_, NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp10_ = _tmp9_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp11_ = g_strconcat (_tmp7_, _tmp10_, NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp12_ = _tmp11_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp13_ = g_strconcat (_tmp12_, "+", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp14_ = _tmp13_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp15_ = soup_uri_encode ("https://www.googleapis.com/auth/userinfo.profile", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp16_ = _tmp15_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp17_ = g_strconcat (_tmp14_, _tmp16_, NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp18_ = _tmp17_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp19_ = g_strconcat (_tmp18_, "&", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp20_ = _tmp19_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp21_ = g_strconcat (_tmp20_, "state=connect&", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp22_ = _tmp21_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp23_ = g_strconcat (_tmp22_, "access_type=offline&", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp24_ = _tmp23_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp25_ = g_strconcat (_tmp24_, "approval_prompt=force", NULL); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp26_ = _tmp25_; +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp24_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp22_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp20_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp18_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp16_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp14_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp12_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp10_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp7_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp5_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp3_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp1_); +#line 144 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + user_authorization_url = _tmp26_; +#line 154 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp27_ = publishing_authenticator_shotwell_google_web_authentication_pane_new (user_authorization_url); +#line 154 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (self->priv->web_auth_pane); +#line 154 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->web_auth_pane = _tmp27_; +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp28_ = self->priv->web_auth_pane; +#line 155 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (_tmp28_, "authorized", (GCallback) _publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized_publishing_authenticator_shotwell_google_web_authentication_pane_authorized, self, 0); +#line 157 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp29_ = self->priv->host; +#line 157 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp30_ = self->priv->web_auth_pane; +#line 157 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_dialog_pane (_tmp29_, G_TYPE_CHECK_INSTANCE_CAST (_tmp30_, SPIT_PUBLISHING_TYPE_DIALOG_PANE, SpitPublishingDialogPane), SPIT_PUBLISHING_PLUGIN_HOST_BUTTON_MODE_CANCEL); +#line 141 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (user_authorization_url); +#line 1281 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* auth_code) { + PublishingAuthenticatorShotwellGoogleWebAuthenticationPane* _tmp0_ = NULL; + guint _tmp1_ = 0U; + const gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + const gchar* _tmp4_ = NULL; +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 160 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (auth_code != NULL); +#line 161 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->web_auth_pane; +#line 161 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("authorized", PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_WEB_AUTHENTICATION_PANE, &_tmp1_, NULL, FALSE); +#line 161 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_web_auth_pane_authorized_publishing_authenticator_shotwell_google_web_authentication_pane_authorized, self); +#line 163 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = self->priv->scope; +#line 163 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = auth_code; +#line 163 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:163: EVENT: user authorized scope %s with aut" \ +"h_code %s", _tmp2_, _tmp3_); +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = auth_code; +#line 165 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_get_access_tokens (self, _tmp4_); +#line 1311 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self) { +#line 174 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender); +#line 1318 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_get_access_tokens_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self) { +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_get_access_tokens_error ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender, err); +#line 1325 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_get_access_tokens (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* auth_code) { + SpitPublishingPluginHost* _tmp0_ = NULL; + PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* tokens_txn = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + PublishingAuthenticatorShotwellGoogleGetAccessTokensTransaction* _tmp3_ = NULL; + GError * _inner_error_ = NULL; +#line 168 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 168 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (auth_code != NULL); +#line 169 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:169: ACTION: exchanging authorization code fo" \ +"r access & refresh tokens"); +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 171 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_login_wait_pane (_tmp0_); +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->session; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = auth_code; +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_google_get_access_tokens_transaction_new (_tmp1_, _tmp2_); +#line 173 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + tokens_txn = _tmp3_; +#line 174 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (tokens_txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete_publishing_rest_support_transaction_completed, self, 0); +#line 175 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (tokens_txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "network-error", (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_error_publishing_rest_support_transaction_network_error, self, 0); +#line 1358 "GoogleAuthenticator.c" + { +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_execute (G_TYPE_CHECK_INSTANCE_CAST (tokens_txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_inner_error_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) { +#line 1366 "GoogleAuthenticator.c" + goto __catch5_spit_publishing_publishing_error; + } +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (tokens_txn); +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 178 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1377 "GoogleAuthenticator.c" + } + } + goto __finally5; + __catch5_spit_publishing_publishing_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp4_ = NULL; + GError* _tmp5_ = NULL; +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + err = _inner_error_; +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _inner_error_ = NULL; +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = err; +#line 180 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp5_); +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (err); +#line 1398 "GoogleAuthenticator.c" + } + __finally5: +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (tokens_txn); +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 177 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1411 "GoogleAuthenticator.c" + } +#line 168 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (tokens_txn); +#line 1415 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingRESTSupportTransaction* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 184 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 184 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 185 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 185 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 185 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete_publishing_rest_support_transaction_completed, self); +#line 186 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 186 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 186 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_error_publishing_rest_support_transaction_network_error, self); +#line 188 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:188: %s", "EVENT: network transaction to exchange authorization code for access t" \ +"okens " "completed successfully."); +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = txn; +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = publishing_rest_support_transaction_get_response (_tmp4_); +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_extract_tokens (self, _tmp6_); +#line 191 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp6_); +#line 1455 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_get_access_tokens_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingRESTSupportTransaction* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + SpitPublishingPluginHost* _tmp7_ = NULL; + GError* _tmp8_ = NULL; +#line 194 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 194 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 196 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 196 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 196 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_complete_publishing_rest_support_transaction_completed, self); +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 197 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_get_access_tokens_error_publishing_rest_support_transaction_network_error, self); +#line 199 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = txn; +#line 199 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = publishing_rest_support_transaction_get_response (_tmp4_); +#line 199 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 199 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("EVENT: network transaction to exchange authorization code for access t" \ +"okens " "failed; response = '%s'", _tmp6_); +#line 199 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp6_); +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = self->priv->host; +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = err; +#line 202 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp7_, _tmp8_); +#line 1501 "GoogleAuthenticator.c" +} + + +static gpointer _json_object_ref0 (gpointer self) { +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return self ? json_object_ref (self) : NULL; +#line 1508 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_extract_tokens (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* response_body) { + JsonParser* parser = NULL; + JsonParser* _tmp0_ = NULL; + JsonObject* response_obj = NULL; + JsonParser* _tmp10_ = NULL; + JsonNode* _tmp11_ = NULL; + JsonObject* _tmp12_ = NULL; + JsonObject* _tmp13_ = NULL; + gboolean _tmp14_ = FALSE; + JsonObject* _tmp15_ = NULL; + gboolean _tmp16_ = FALSE; + JsonObject* _tmp22_ = NULL; + gboolean _tmp23_ = FALSE; + JsonObject* _tmp29_ = NULL; + gboolean _tmp30_ = FALSE; + JsonObject* _tmp36_ = NULL; + gboolean _tmp37_ = FALSE; + GError * _inner_error_ = NULL; +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (response_body != NULL); +#line 206 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:206: ACTION: extracting OAuth tokens from bod" \ +"y of server response"); +#line 208 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = json_parser_new (); +#line 208 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + parser = _tmp0_; +#line 1540 "GoogleAuthenticator.c" + { + JsonParser* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = parser; +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = response_body; +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + json_parser_load_from_data (_tmp1_, _tmp2_, (gssize) -1, &_inner_error_); +#line 211 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1552 "GoogleAuthenticator.c" + goto __catch6_g_error; + } + } + goto __finally6; + __catch6_g_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp3_ = NULL; + GError* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + GError* _tmp8_ = NULL; + GError* _tmp9_ = NULL; +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + err = _inner_error_; +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _inner_error_ = NULL; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = self->priv->host; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = err; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = _tmp4_->message; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = g_strconcat ("Couldn't parse JSON response: ", _tmp5_, NULL); +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, _tmp7_); +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = _tmp8_; +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp3_, _tmp9_); +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (_tmp9_); +#line 213 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp7_); +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (err); +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 215 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1597 "GoogleAuthenticator.c" + } + __finally6: +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 210 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1610 "GoogleAuthenticator.c" + } +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp10_ = parser; +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp11_ = json_parser_get_root (_tmp10_); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp12_ = json_node_get_object (_tmp11_); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp13_ = _json_object_ref0 (_tmp12_); +#line 218 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + response_obj = _tmp13_; +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp15_ = response_obj; +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp16_ = json_object_has_member (_tmp15_, "access_token"); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (!_tmp16_) { +#line 1628 "GoogleAuthenticator.c" + JsonObject* _tmp17_ = NULL; + gboolean _tmp18_ = FALSE; +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp17_ = response_obj; +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp18_ = json_object_has_member (_tmp17_, "refresh_token"); +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp14_ = !_tmp18_; +#line 1637 "GoogleAuthenticator.c" + } else { +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp14_ = FALSE; +#line 1641 "GoogleAuthenticator.c" + } +#line 220 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp14_) { +#line 1645 "GoogleAuthenticator.c" + SpitPublishingPluginHost* _tmp19_ = NULL; + GError* _tmp20_ = NULL; + GError* _tmp21_ = NULL; +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp19_ = self->priv->host; +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp20_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, "neither access_token nor refresh_token not present in server response"); +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp21_ = _tmp20_; +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp19_, _tmp21_); +#line 221 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (_tmp21_); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _json_object_unref0 (response_obj); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 223 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1665 "GoogleAuthenticator.c" + } +#line 226 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp22_ = response_obj; +#line 226 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp23_ = json_object_has_member (_tmp22_, "expires_in"); +#line 226 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp23_) { +#line 1673 "GoogleAuthenticator.c" + gint64 duration = 0LL; + JsonObject* _tmp24_ = NULL; + gint64 _tmp25_ = 0LL; + gint64 abs_time = 0LL; + gint64 _tmp26_ = 0LL; + gint64 _tmp27_ = 0LL; + gint64 _tmp28_ = 0LL; +#line 227 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp24_ = response_obj; +#line 227 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp25_ = json_object_get_int_member (_tmp24_, "expires_in"); +#line 227 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + duration = _tmp25_; +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp26_ = g_get_real_time (); +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp27_ = duration; +#line 228 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + abs_time = _tmp26_ + ((_tmp27_ * 1000L) * 1000L); +#line 229 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp28_ = abs_time; +#line 229 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_expiry_time_avilable (self, _tmp28_); +#line 1697 "GoogleAuthenticator.c" + } +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp29_ = response_obj; +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp30_ = json_object_has_member (_tmp29_, "refresh_token"); +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp30_) { +#line 1705 "GoogleAuthenticator.c" + gchar* refresh_token = NULL; + JsonObject* _tmp31_ = NULL; + const gchar* _tmp32_ = NULL; + gchar* _tmp33_ = NULL; + const gchar* _tmp34_ = NULL; +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp31_ = response_obj; +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp32_ = json_object_get_string_member (_tmp31_, "refresh_token"); +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp33_ = g_strdup (_tmp32_); +#line 233 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + refresh_token = _tmp33_; +#line 235 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp34_ = refresh_token; +#line 235 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (g_strcmp0 (_tmp34_, "") != 0) { +#line 1723 "GoogleAuthenticator.c" + const gchar* _tmp35_ = NULL; +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp35_ = refresh_token; +#line 236 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_refresh_token_available (self, _tmp35_); +#line 1729 "GoogleAuthenticator.c" + } +#line 232 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (refresh_token); +#line 1733 "GoogleAuthenticator.c" + } +#line 239 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp36_ = response_obj; +#line 239 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp37_ = json_object_has_member (_tmp36_, "access_token"); +#line 239 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp37_) { +#line 1741 "GoogleAuthenticator.c" + gchar* access_token = NULL; + JsonObject* _tmp38_ = NULL; + const gchar* _tmp39_ = NULL; + gchar* _tmp40_ = NULL; + const gchar* _tmp41_ = NULL; +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp38_ = response_obj; +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp39_ = json_object_get_string_member (_tmp38_, "access_token"); +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp40_ = g_strdup (_tmp39_); +#line 240 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + access_token = _tmp40_; +#line 242 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp41_ = access_token; +#line 242 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (g_strcmp0 (_tmp41_, "") != 0) { +#line 1759 "GoogleAuthenticator.c" + const gchar* _tmp42_ = NULL; +#line 243 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp42_ = access_token; +#line 243 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_access_token_available (self, _tmp42_); +#line 1765 "GoogleAuthenticator.c" + } +#line 239 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (access_token); +#line 1769 "GoogleAuthenticator.c" + } +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _json_object_unref0 (response_obj); +#line 205 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 1775 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_refresh_token_available (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* token) { + const gchar* _tmp0_ = NULL; + GHashTable* _tmp1_ = NULL; + gchar* _tmp2_ = NULL; + const gchar* _tmp3_ = NULL; + GVariant* _tmp4_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; +#line 247 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 247 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 248 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = token; +#line 248 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:248: EVENT: an OAuth refresh token has become" \ +" available; token = '%s'.", _tmp0_); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->params; +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = g_strdup ("RefreshToken"); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = token; +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = g_variant_new_string (_tmp3_); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_variant_ref_sink (_tmp4_); +#line 249 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_hash_table_insert (_tmp1_, _tmp2_, _tmp4_); +#line 251 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = self->priv->session; +#line 251 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = token; +#line 251 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = g_strdup (_tmp6_); +#line 251 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp5_->refresh_token); +#line 251 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_->refresh_token = _tmp7_; +#line 1818 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_expiry_time_avilable (PublishingAuthenticatorShotwellGoogleGoogle* self, gint64 abs_time) { + gint64 _tmp0_ = 0LL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + gint64 _tmp2_ = 0LL; + GHashTable* _tmp3_ = NULL; + gchar* _tmp4_ = NULL; + gint64 _tmp5_ = 0LL; + GVariant* _tmp6_ = NULL; +#line 254 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = abs_time; +#line 255 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("EVENT: an OAuth access token expiry time became available; time = %'" G_GINT64_FORMAT "'.", _tmp0_); +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->session; +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = abs_time; +#line 258 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_->expires_at = _tmp2_; +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = self->priv->params; +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = g_strdup ("ExpiryTime"); +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = abs_time; +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = g_variant_new_int64 (_tmp5_); +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_variant_ref_sink (_tmp6_); +#line 259 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_hash_table_insert (_tmp3_, _tmp4_, _tmp6_); +#line 1854 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_access_token_available (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* token) { + const gchar* _tmp0_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; + gchar* _tmp3_ = NULL; + GHashTable* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + const gchar* _tmp6_ = NULL; + GVariant* _tmp7_ = NULL; +#line 263 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 263 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (token != NULL); +#line 264 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = token; +#line 264 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:264: EVENT: an OAuth access token has become " \ +"available; token = '%s'.", _tmp0_); +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->session; +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = token; +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = g_strdup (_tmp2_); +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp1_->access_token); +#line 266 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_->access_token = _tmp3_; +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->params; +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = g_strdup ("AccessToken"); +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = token; +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = g_variant_new_string (_tmp6_); +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_variant_ref_sink (_tmp7_); +#line 267 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_hash_table_insert (_tmp4_, _tmp5_, _tmp7_); +#line 269 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_fetch_username (self); +#line 1899 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self) { +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender); +#line 1906 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self) { +#line 280 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender, err); +#line 1913 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_fetch_username (PublishingAuthenticatorShotwellGoogleGoogle* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + SpitPublishingPluginHost* _tmp1_ = NULL; + PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* txn = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp2_ = NULL; + PublishingAuthenticatorShotwellGoogleUsernameFetchTransaction* _tmp3_ = NULL; + GError * _inner_error_ = NULL; +#line 272 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 273 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:273: ACTION: running network transaction to f" \ +"etch username."); +#line 275 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 275 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_login_wait_pane (_tmp0_); +#line 276 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->host; +#line 276 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_set_service_locked (_tmp1_, TRUE); +#line 278 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = self->priv->session; +#line 278 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = publishing_authenticator_shotwell_google_username_fetch_transaction_new (_tmp2_); +#line 278 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + txn = _tmp3_; +#line 279 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed_publishing_rest_support_transaction_completed, self, 0); +#line 280 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "network-error", (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error_publishing_rest_support_transaction_network_error, self, 0); +#line 1946 "GoogleAuthenticator.c" + { +#line 283 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_execute (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 283 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 1952 "GoogleAuthenticator.c" + goto __catch7_g_error; + } + } + goto __finally7; + __catch7_g_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp4_ = NULL; + GError* _tmp5_ = NULL; +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + err = _inner_error_; +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _inner_error_ = NULL; +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = err; +#line 285 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp5_); +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (err); +#line 1974 "GoogleAuthenticator.c" + } + __finally7: +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 282 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 1987 "GoogleAuthenticator.c" + } +#line 272 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 1991 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingRESTSupportTransaction* _tmp4_ = NULL; + gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 289 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 290 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed_publishing_rest_support_transaction_completed, self); +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 291 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error_publishing_rest_support_transaction_network_error, self); +#line 293 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:293: EVENT: username fetch transaction comple" \ +"ted successfully."); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = txn; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = publishing_rest_support_transaction_get_response (_tmp4_); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = _tmp5_; +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_extract_username (self, _tmp6_); +#line 295 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp6_); +#line 2031 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + SpitPublishingPluginHost* _tmp4_ = NULL; + GError* _tmp5_ = NULL; +#line 298 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 298 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 300 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 300 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 300 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_completed_publishing_rest_support_transaction_completed, self); +#line 301 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 301 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 301 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_fetch_username_transaction_error_publishing_rest_support_transaction_network_error, self); +#line 303 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:303: EVENT: username fetch transaction caused" \ +" a network error"); +#line 305 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->host; +#line 305 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = err; +#line 305 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp4_, _tmp5_); +#line 2066 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_extract_username (PublishingAuthenticatorShotwellGoogleGoogle* self, const gchar* response_body) { + JsonParser* parser = NULL; + JsonParser* _tmp0_ = NULL; + JsonObject* response_obj = NULL; + JsonParser* _tmp10_ = NULL; + JsonNode* _tmp11_ = NULL; + JsonObject* _tmp12_ = NULL; + JsonObject* _tmp13_ = NULL; + JsonObject* _tmp14_ = NULL; + gboolean _tmp15_ = FALSE; + JsonObject* _tmp24_ = NULL; + gboolean _tmp25_ = FALSE; + PublishingAuthenticatorShotwellGoogleSession* _tmp34_ = NULL; + gboolean _tmp35_ = FALSE; + SpitPublishingPluginHost* _tmp36_ = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp37_ = NULL; + const gchar* _tmp38_ = NULL; + GError * _inner_error_ = NULL; +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (response_body != NULL); +#line 309 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:309: ACTION: extracting username from body of" \ +" server response"); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = json_parser_new (); +#line 311 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + parser = _tmp0_; +#line 2098 "GoogleAuthenticator.c" + { + JsonParser* _tmp1_ = NULL; + const gchar* _tmp2_ = NULL; +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = parser; +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = response_body; +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + json_parser_load_from_data (_tmp1_, _tmp2_, (gssize) -1, &_inner_error_); +#line 314 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 2110 "GoogleAuthenticator.c" + goto __catch8_g_error; + } + } + goto __finally8; + __catch8_g_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp3_ = NULL; + GError* _tmp4_ = NULL; + const gchar* _tmp5_ = NULL; + gchar* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + GError* _tmp8_ = NULL; + GError* _tmp9_ = NULL; +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + err = _inner_error_; +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _inner_error_ = NULL; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = self->priv->host; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = err; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = _tmp4_->message; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = g_strconcat ("Couldn't parse JSON response: ", _tmp5_, NULL); +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = _tmp6_; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = g_error_new_literal (SPIT_PUBLISHING_PUBLISHING_ERROR, SPIT_PUBLISHING_PUBLISHING_ERROR_MALFORMED_RESPONSE, _tmp7_); +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = _tmp8_; +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp3_, _tmp9_); +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (_tmp9_); +#line 316 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp7_); +#line 318 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (err); +#line 318 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 318 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2155 "GoogleAuthenticator.c" + } + __finally8: +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 313 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2168 "GoogleAuthenticator.c" + } +#line 321 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp10_ = parser; +#line 321 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp11_ = json_parser_get_root (_tmp10_); +#line 321 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp12_ = json_node_get_object (_tmp11_); +#line 321 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp13_ = _json_object_ref0 (_tmp12_); +#line 321 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + response_obj = _tmp13_; +#line 323 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp14_ = response_obj; +#line 323 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp15_ = json_object_has_member (_tmp14_, "name"); +#line 323 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp15_) { +#line 2186 "GoogleAuthenticator.c" + gchar* username = NULL; + JsonObject* _tmp16_ = NULL; + const gchar* _tmp17_ = NULL; + gchar* _tmp18_ = NULL; + const gchar* _tmp19_ = NULL; +#line 324 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp16_ = response_obj; +#line 324 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp17_ = json_object_get_string_member (_tmp16_, "name"); +#line 324 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp18_ = g_strdup (_tmp17_); +#line 324 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + username = _tmp18_; +#line 326 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp19_ = username; +#line 326 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (g_strcmp0 (_tmp19_, "") != 0) { +#line 2204 "GoogleAuthenticator.c" + GHashTable* _tmp20_ = NULL; + gchar* _tmp21_ = NULL; + const gchar* _tmp22_ = NULL; + GVariant* _tmp23_ = NULL; +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp20_ = self->priv->params; +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp21_ = g_strdup ("UserName"); +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp22_ = username; +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp23_ = g_variant_new_string (_tmp22_); +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_variant_ref_sink (_tmp23_); +#line 327 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_hash_table_insert (_tmp20_, _tmp21_, _tmp23_); +#line 2221 "GoogleAuthenticator.c" + } +#line 323 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (username); +#line 2225 "GoogleAuthenticator.c" + } +#line 330 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp24_ = response_obj; +#line 330 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp25_ = json_object_has_member (_tmp24_, "access_token"); +#line 330 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp25_) { +#line 2233 "GoogleAuthenticator.c" + gchar* access_token = NULL; + JsonObject* _tmp26_ = NULL; + const gchar* _tmp27_ = NULL; + gchar* _tmp28_ = NULL; + const gchar* _tmp29_ = NULL; +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp26_ = response_obj; +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp27_ = json_object_get_string_member (_tmp26_, "access_token"); +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp28_ = g_strdup (_tmp27_); +#line 331 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + access_token = _tmp28_; +#line 333 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp29_ = access_token; +#line 333 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (g_strcmp0 (_tmp29_, "") != 0) { +#line 2251 "GoogleAuthenticator.c" + GHashTable* _tmp30_ = NULL; + gchar* _tmp31_ = NULL; + const gchar* _tmp32_ = NULL; + GVariant* _tmp33_ = NULL; +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp30_ = self->priv->params; +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp31_ = g_strdup ("AccessToken"); +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp32_ = access_token; +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp33_ = g_variant_new_string (_tmp32_); +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_variant_ref_sink (_tmp33_); +#line 334 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_hash_table_insert (_tmp30_, _tmp31_, _tmp33_); +#line 2268 "GoogleAuthenticator.c" + } +#line 330 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (access_token); +#line 2272 "GoogleAuthenticator.c" + } +#line 339 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp34_ = self->priv->session; +#line 339 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp35_ = publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_tmp34_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession)); +#line 339 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _vala_assert (_tmp35_, "session.is_authenticated()"); +#line 340 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp36_ = self->priv->host; +#line 340 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp37_ = self->priv->session; +#line 340 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp38_ = _tmp37_->refresh_token; +#line 340 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp36_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "refresh_token", _tmp38_); +#line 342 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_emit_by_name (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator), "authenticated"); +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _json_object_unref0 (response_obj); +#line 308 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (parser); +#line 2294 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed_publishing_rest_support_transaction_completed (PublishingRESTSupportTransaction* _sender, gpointer self) { +#line 353 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender); +#line 2301 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error_publishing_rest_support_transaction_network_error (PublishingRESTSupportTransaction* _sender, GError* err, gpointer self) { +#line 354 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error ((PublishingAuthenticatorShotwellGoogleGoogle*) self, _sender, err); +#line 2308 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_exchange_refresh_token_for_access_token (PublishingAuthenticatorShotwellGoogleGoogle* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* txn = NULL; + PublishingAuthenticatorShotwellGoogleSession* _tmp1_ = NULL; + PublishingAuthenticatorShotwellGoogleRefreshAccessTokenTransaction* _tmp2_ = NULL; + GError * _inner_error_ = NULL; +#line 346 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 347 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:347: ACTION: exchanging OAuth refresh token f" \ +"or OAuth access token."); +#line 349 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 349 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_login_wait_pane (_tmp0_); +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->session; +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = publishing_authenticator_shotwell_google_refresh_access_token_transaction_new (_tmp1_); +#line 351 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + txn = _tmp2_; +#line 353 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "completed", (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed_publishing_rest_support_transaction_completed, self, 0); +#line 354 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_connect_object (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), "network-error", (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error_publishing_rest_support_transaction_network_error, self, 0); +#line 2336 "GoogleAuthenticator.c" + { +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_rest_support_transaction_execute (G_TYPE_CHECK_INSTANCE_CAST (txn, PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, PublishingRESTSupportTransaction), &_inner_error_); +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_inner_error_->domain == SPIT_PUBLISHING_PUBLISHING_ERROR) { +#line 2344 "GoogleAuthenticator.c" + goto __catch9_spit_publishing_publishing_error; + } +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 357 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2355 "GoogleAuthenticator.c" + } + } + goto __finally9; + __catch9_spit_publishing_publishing_error: + { + GError* err = NULL; + SpitPublishingPluginHost* _tmp3_ = NULL; + GError* _tmp4_ = NULL; +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + err = _inner_error_; +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _inner_error_ = NULL; +#line 359 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp3_ = self->priv->host; +#line 359 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = err; +#line 359 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp3_, _tmp4_); +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_error_free0 (err); +#line 2376 "GoogleAuthenticator.c" + } + __finally9: +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (G_UNLIKELY (_inner_error_ != NULL)) { +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_clear_error (&_inner_error_); +#line 356 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2389 "GoogleAuthenticator.c" + } +#line 346 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_transaction_unref0 (txn); +#line 2393 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingAuthenticatorShotwellGoogleSession* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + PublishingRESTSupportTransaction* _tmp6_ = NULL; + gchar* _tmp7_ = NULL; + gchar* _tmp8_ = NULL; +#line 363 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 363 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 365 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 365 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 365 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed_publishing_rest_support_transaction_completed, self); +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 366 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error_publishing_rest_support_transaction_network_error, self); +#line 368 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:368: EVENT: refresh access token transaction " \ +"completed successfully."); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->session; +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession)); +#line 370 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp5_) { +#line 371 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2433 "GoogleAuthenticator.c" + } +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = txn; +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = publishing_rest_support_transaction_get_response (_tmp6_); +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = _tmp7_; +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_extract_tokens (self, _tmp8_); +#line 373 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (_tmp8_); +#line 2445 "GoogleAuthenticator.c" +} + + +static gboolean ___lambda4_ (PublishingAuthenticatorShotwellGoogleGoogle* self) { + gboolean result = FALSE; +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_authenticator_authenticate (G_TYPE_CHECK_INSTANCE_CAST (self, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator)); +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + result = FALSE; +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 2457 "GoogleAuthenticator.c" +} + + +static gboolean ____lambda4__gsource_func (gpointer self) { + gboolean result; + result = ___lambda4_ ((PublishingAuthenticatorShotwellGoogleGoogle*) self); +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return result; +#line 2466 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error (PublishingAuthenticatorShotwellGoogleGoogle* self, PublishingRESTSupportTransaction* txn, GError* err) { + PublishingRESTSupportTransaction* _tmp0_ = NULL; + guint _tmp1_ = 0U; + PublishingRESTSupportTransaction* _tmp2_ = NULL; + guint _tmp3_ = 0U; + PublishingAuthenticatorShotwellGoogleSession* _tmp4_ = NULL; + gboolean _tmp5_ = FALSE; + gboolean _tmp6_ = FALSE; + PublishingRESTSupportTransaction* _tmp7_ = NULL; + guint _tmp8_ = 0U; + SpitPublishingPluginHost* _tmp12_ = NULL; + GError* _tmp13_ = NULL; +#line 376 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 376 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_REST_SUPPORT_IS_TRANSACTION (txn)); +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = txn; +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("completed", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp1_, NULL, FALSE); +#line 378 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp0_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp1_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_completed_publishing_rest_support_transaction_completed, self); +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp2_ = txn; +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_parse_name ("network-error", PUBLISHING_REST_SUPPORT_TYPE_TRANSACTION, &_tmp3_, NULL, FALSE); +#line 379 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_signal_handlers_disconnect_matched (_tmp2_, G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, _tmp3_, 0, NULL, (GCallback) _publishing_authenticator_shotwell_google_google_on_refresh_access_token_transaction_error_publishing_rest_support_transaction_network_error, self); +#line 381 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:381: EVENT: refresh access token transaction " \ +"caused a network error."); +#line 383 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp4_ = self->priv->session; +#line 383 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp5_ = publishing_rest_support_session_is_authenticated (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, PUBLISHING_REST_SUPPORT_TYPE_SESSION, PublishingRESTSupportSession)); +#line 383 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp5_) { +#line 384 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + return; +#line 2508 "GoogleAuthenticator.c" + } +#line 385 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp7_ = txn; +#line 385 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp8_ = publishing_rest_support_transaction_get_status_code (_tmp7_); +#line 385 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp8_ == ((guint) SOUP_STATUS_BAD_REQUEST)) { +#line 385 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = TRUE; +#line 2518 "GoogleAuthenticator.c" + } else { + PublishingRESTSupportTransaction* _tmp9_ = NULL; + guint _tmp10_ = 0U; +#line 386 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp9_ = txn; +#line 386 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp10_ = publishing_rest_support_transaction_get_status_code (_tmp9_); +#line 386 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp6_ = _tmp10_ == ((guint) SOUP_STATUS_UNAUTHORIZED); +#line 2528 "GoogleAuthenticator.c" + } +#line 385 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + if (_tmp6_) { +#line 2532 "GoogleAuthenticator.c" + SpitPublishingPluginHost* _tmp11_ = NULL; +#line 388 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp11_ = self->priv->host; +#line 388 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_host_interface_set_config_string (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, SPIT_TYPE_HOST_INTERFACE, SpitHostInterface), "refresh_token", ""); +#line 389 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda4__gsource_func, g_object_ref (self), g_object_unref); +#line 2540 "GoogleAuthenticator.c" + } +#line 392 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp12_ = self->priv->host; +#line 392 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp13_ = err; +#line 392 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_post_error (_tmp12_, _tmp13_); +#line 2548 "GoogleAuthenticator.c" +} + + +static void _publishing_authenticator_shotwell_google_google_on_service_welcome_login_spit_publishing_login_callback (gpointer self) { +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_on_service_welcome_login ((PublishingAuthenticatorShotwellGoogleGoogle*) self); +#line 2555 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_do_show_service_welcome_pane (PublishingAuthenticatorShotwellGoogleGoogle* self) { + SpitPublishingPluginHost* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; +#line 395 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 396 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:396: ACTION: showing service welcome pane."); +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp0_ = self->priv->host; +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _tmp1_ = self->priv->welcome_message; +#line 398 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + spit_publishing_plugin_host_install_welcome_pane (_tmp0_, _tmp1_, _publishing_authenticator_shotwell_google_google_on_service_welcome_login_spit_publishing_login_callback, self); +#line 2572 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_on_service_welcome_login (PublishingAuthenticatorShotwellGoogleGoogle* self) { +#line 401 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_return_if_fail (PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE (self)); +#line 402 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_debug ("GoogleAuthenticator.vala:402: EVENT: user clicked 'Login' in welcome p" \ +"ane."); +#line 404 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_do_hosted_web_authentication (self); +#line 2583 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_class_init (PublishingAuthenticatorShotwellGoogleGoogleClass * klass) { +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_parent_class = g_type_class_peek_parent (klass); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + g_type_class_add_private (klass, sizeof (PublishingAuthenticatorShotwellGoogleGooglePrivate)); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_shotwell_google_google_finalize; +#line 2594 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_spit_publishing_authenticator_interface_init (SpitPublishingAuthenticatorIface * iface) { +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + publishing_authenticator_shotwell_google_google_spit_publishing_authenticator_parent_iface = g_type_interface_peek_parent (iface); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + iface->authenticate = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_google_google_real_authenticate; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + iface->can_logout = (gboolean (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_google_google_real_can_logout; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + iface->get_authentication_parameter = (GHashTable* (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_google_google_real_get_authentication_parameter; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + iface->logout = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_google_google_real_logout; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + iface->refresh = (void (*)(SpitPublishingAuthenticator*)) publishing_authenticator_shotwell_google_google_real_refresh; +#line 2611 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_instance_init (PublishingAuthenticatorShotwellGoogleGoogle * self) { +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv = PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_GET_PRIVATE (self); +#line 89 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->scope = NULL; +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->host = NULL; +#line 91 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->params = NULL; +#line 92 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->web_auth_pane = NULL; +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->session = NULL; +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self->priv->welcome_message = NULL; +#line 2630 "GoogleAuthenticator.c" +} + + +static void publishing_authenticator_shotwell_google_google_finalize (GObject* obj) { + PublishingAuthenticatorShotwellGoogleGoogle * self; +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle); +#line 89 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->priv->scope); +#line 90 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (self->priv->host); +#line 91 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_hash_table_unref0 (self->priv->params); +#line 92 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_object_unref0 (self->priv->web_auth_pane); +#line 93 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _publishing_rest_support_session_unref0 (self->priv->session); +#line 94 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + _g_free0 (self->priv->welcome_message); +#line 88 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/GoogleAuthenticator.vala" + G_OBJECT_CLASS (publishing_authenticator_shotwell_google_google_parent_class)->finalize (obj); +#line 2652 "GoogleAuthenticator.c" +} + + +GType publishing_authenticator_shotwell_google_google_get_type (void) { + static volatile gsize publishing_authenticator_shotwell_google_google_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_shotwell_google_google_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorShotwellGoogleGoogleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_shotwell_google_google_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorShotwellGoogleGoogle), 0, (GInstanceInitFunc) publishing_authenticator_shotwell_google_google_instance_init, NULL }; + static const GInterfaceInfo spit_publishing_authenticator_info = { (GInterfaceInitFunc) publishing_authenticator_shotwell_google_google_spit_publishing_authenticator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType publishing_authenticator_shotwell_google_google_type_id; + publishing_authenticator_shotwell_google_google_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingAuthenticatorShotwellGoogleGoogle", &g_define_type_info, 0); + g_type_add_interface_static (publishing_authenticator_shotwell_google_google_type_id, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, &spit_publishing_authenticator_info); + g_once_init_leave (&publishing_authenticator_shotwell_google_google_type_id__volatile, publishing_authenticator_shotwell_google_google_type_id); + } + return publishing_authenticator_shotwell_google_google_type_id__volatile; +} + + + diff --git a/plugins/authenticator/shotwell/GoogleAuthenticator.vala b/plugins/authenticator/shotwell/GoogleAuthenticator.vala new file mode 100644 index 0000000..9271b57 --- /dev/null +++ b/plugins/authenticator/shotwell/GoogleAuthenticator.vala @@ -0,0 +1,409 @@ +using Shotwell; +using Shotwell.Plugins; + +namespace Publishing.Authenticator.Shotwell.Google { + private const string OAUTH_CLIENT_ID = "534227538559-hvj2e8bj0vfv2f49r7gvjoq6jibfav67.apps.googleusercontent.com"; + private const string OAUTH_CLIENT_SECRET = "pwpzZ7W1TCcD5uIfYCu8sM7x"; + + private class WebAuthenticationPane : Common.WebAuthenticationPane { + public static bool cache_dirty = false; + + public signal void authorized(string auth_code); + + public WebAuthenticationPane(string auth_sequence_start_url) { + Object (login_uri : auth_sequence_start_url); + } + + public static bool is_cache_dirty() { + return cache_dirty; + } + + public override void on_page_load() { + string page_title = get_view ().get_title(); + if (page_title.index_of("state=connect") > 0) { + int auth_code_field_start = page_title.index_of("code="); + if (auth_code_field_start < 0) + return; + + string auth_code = page_title.substring(auth_code_field_start + 5); // 5 = "code=".length + + cache_dirty = true; + + authorized(auth_code); + } + } + } + + private class Session : Publishing.RESTSupport.Session { + public string access_token = null; + public string refresh_token = null; + public int64 expires_at = -1; + + public override bool is_authenticated() { + return (access_token != null); + } + + public void deauthenticate() { + access_token = null; + refresh_token = null; + expires_at = -1; + } + } + + private class GetAccessTokensTransaction : Publishing.RESTSupport.Transaction { + private const string ENDPOINT_URL = "https://accounts.google.com/o/oauth2/token"; + + public GetAccessTokensTransaction(Session session, string auth_code) { + base.with_endpoint_url(session, ENDPOINT_URL); + + add_argument("code", auth_code); + add_argument("client_id", OAUTH_CLIENT_ID); + add_argument("client_secret", OAUTH_CLIENT_SECRET); + add_argument("redirect_uri", "urn:ietf:wg:oauth:2.0:oob"); + add_argument("grant_type", "authorization_code"); + } + } + + private class RefreshAccessTokenTransaction : Publishing.RESTSupport.Transaction { + private const string ENDPOINT_URL = "https://accounts.google.com/o/oauth2/token"; + + public RefreshAccessTokenTransaction(Session session) { + base.with_endpoint_url(session, ENDPOINT_URL); + + add_argument("client_id", OAUTH_CLIENT_ID); + add_argument("client_secret", OAUTH_CLIENT_SECRET); + add_argument("refresh_token", session.refresh_token); + add_argument("grant_type", "refresh_token"); + } + } + + private class UsernameFetchTransaction : Publishing.RESTSupport.Transaction { + private const string ENDPOINT_URL = "https://www.googleapis.com/oauth2/v1/userinfo"; + public UsernameFetchTransaction(Session session) { + base.with_endpoint_url(session, ENDPOINT_URL, Publishing.RESTSupport.HttpMethod.GET); + add_header("Authorization", "Bearer " + session.access_token); + } + } + + internal class Google : Spit.Publishing.Authenticator, Object { + private string scope = null; + private Spit.Publishing.PluginHost host = null; + private GLib.HashTable params = null; + private WebAuthenticationPane web_auth_pane = null; + private Session session = null; + private string welcome_message = null; + + public Google(string scope, + string welcome_message, + Spit.Publishing.PluginHost host) { + this.host = host; + this.params = new GLib.HashTable(str_hash, str_equal); + this.scope = scope; + this.session = new Session(); + this.welcome_message = welcome_message; + } + + public void authenticate() { + var refresh_token = host.get_config_string("refresh_token", null); + if (refresh_token != null && refresh_token != "") { + on_refresh_token_available(refresh_token); + do_exchange_refresh_token_for_access_token(); + return; + } + + // FIXME: Find a way for a proper logout + if (WebAuthenticationPane.is_cache_dirty()) { + host.set_service_locked(false); + + host.install_static_message_pane(_("You have already logged in and out of a Google service during this Shotwell session.\n\nTo continue publishing to Google services, quit and restart Shotwell, then try publishing again.")); + } else { + this.do_show_service_welcome_pane(); + } + } + + public bool can_logout() { + return true; + } + + public GLib.HashTable get_authentication_parameter() { + return this.params; + } + + public void logout() { + session.deauthenticate(); + host.set_config_string("refresh_token", ""); + } + + public void refresh() { + // TODO: Needs to re-auth + } + + private void do_hosted_web_authentication() { + debug("ACTION: running OAuth authentication flow in hosted web pane."); + + string user_authorization_url = "https://accounts.google.com/o/oauth2/auth?" + + "response_type=code&" + + "client_id=" + OAUTH_CLIENT_ID + "&" + + "redirect_uri=" + Soup.URI.encode("urn:ietf:wg:oauth:2.0:oob", null) + "&" + + "scope=" + Soup.URI.encode(this.scope, null) + "+" + + Soup.URI.encode("https://www.googleapis.com/auth/userinfo.profile", null) + "&" + + "state=connect&" + + "access_type=offline&" + + "approval_prompt=force"; + + web_auth_pane = new WebAuthenticationPane(user_authorization_url); + web_auth_pane.authorized.connect(on_web_auth_pane_authorized); + + host.install_dialog_pane(web_auth_pane); + } + + private void on_web_auth_pane_authorized(string auth_code) { + web_auth_pane.authorized.disconnect(on_web_auth_pane_authorized); + + debug("EVENT: user authorized scope %s with auth_code %s", scope, auth_code); + + do_get_access_tokens(auth_code); + } + + private void do_get_access_tokens(string auth_code) { + debug("ACTION: exchanging authorization code for access & refresh tokens"); + + host.install_login_wait_pane(); + + GetAccessTokensTransaction tokens_txn = new GetAccessTokensTransaction(session, auth_code); + tokens_txn.completed.connect(on_get_access_tokens_complete); + tokens_txn.network_error.connect(on_get_access_tokens_error); + + try { + tokens_txn.execute(); + } catch (Spit.Publishing.PublishingError err) { + host.post_error(err); + } + } + + private void on_get_access_tokens_complete(Publishing.RESTSupport.Transaction txn) { + txn.completed.disconnect(on_get_access_tokens_complete); + txn.network_error.disconnect(on_get_access_tokens_error); + + debug("EVENT: network transaction to exchange authorization code for access tokens " + + "completed successfully."); + + do_extract_tokens(txn.get_response()); + } + + private void on_get_access_tokens_error(Publishing.RESTSupport.Transaction txn, + Spit.Publishing.PublishingError err) { + txn.completed.disconnect(on_get_access_tokens_complete); + txn.network_error.disconnect(on_get_access_tokens_error); + + debug("EVENT: network transaction to exchange authorization code for access tokens " + + "failed; response = '%s'", txn.get_response()); + + host.post_error(err); + } + + private void do_extract_tokens(string response_body) { + debug("ACTION: extracting OAuth tokens from body of server response"); + + Json.Parser parser = new Json.Parser(); + + try { + parser.load_from_data(response_body); + } catch (Error err) { + host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( + "Couldn't parse JSON response: " + err.message)); + return; + } + + Json.Object response_obj = parser.get_root().get_object(); + + if ((!response_obj.has_member("access_token")) && (!response_obj.has_member("refresh_token"))) { + host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( + "neither access_token nor refresh_token not present in server response")); + return; + } + + if (response_obj.has_member("expires_in")) { + var duration = response_obj.get_int_member("expires_in"); + var abs_time = GLib.get_real_time() + duration * 1000L * 1000L; + on_expiry_time_avilable(abs_time); + } + + if (response_obj.has_member("refresh_token")) { + string refresh_token = response_obj.get_string_member("refresh_token"); + + if (refresh_token != "") + on_refresh_token_available(refresh_token); + } + + if (response_obj.has_member("access_token")) { + string access_token = response_obj.get_string_member("access_token"); + + if (access_token != "") + on_access_token_available(access_token); + } + } + + private void on_refresh_token_available(string token) { + debug("EVENT: an OAuth refresh token has become available; token = '%s'.", token); + this.params.insert("RefreshToken", new Variant.string(token)); + + session.refresh_token = token; + } + + private void on_expiry_time_avilable(int64 abs_time) { + debug("EVENT: an OAuth access token expiry time became available; time = %'" + int64.FORMAT + + "'.", abs_time); + + session.expires_at = abs_time; + this.params.insert("ExpiryTime", new Variant.int64(abs_time)); + } + + + private void on_access_token_available(string token) { + debug("EVENT: an OAuth access token has become available; token = '%s'.", token); + + session.access_token = token; + this.params.insert("AccessToken", new Variant.string(token)); + + do_fetch_username(); + } + + private void do_fetch_username() { + debug("ACTION: running network transaction to fetch username."); + + host.install_login_wait_pane(); + host.set_service_locked(true); + + UsernameFetchTransaction txn = new UsernameFetchTransaction(session); + txn.completed.connect(on_fetch_username_transaction_completed); + txn.network_error.connect(on_fetch_username_transaction_error); + + try { + txn.execute(); + } catch (Error err) { + host.post_error(err); + } + } + + private void on_fetch_username_transaction_completed(Publishing.RESTSupport.Transaction txn) { + txn.completed.disconnect(on_fetch_username_transaction_completed); + txn.network_error.disconnect(on_fetch_username_transaction_error); + + debug("EVENT: username fetch transaction completed successfully."); + + do_extract_username(txn.get_response()); + } + + private void on_fetch_username_transaction_error(Publishing.RESTSupport.Transaction txn, + Spit.Publishing.PublishingError err) { + txn.completed.disconnect(on_fetch_username_transaction_completed); + txn.network_error.disconnect(on_fetch_username_transaction_error); + + debug("EVENT: username fetch transaction caused a network error"); + + host.post_error(err); + } + + private void do_extract_username(string response_body) { + debug("ACTION: extracting username from body of server response"); + + Json.Parser parser = new Json.Parser(); + + try { + parser.load_from_data(response_body); + } catch (Error err) { + host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( + "Couldn't parse JSON response: " + err.message)); + return; + } + + Json.Object response_obj = parser.get_root().get_object(); + + if (response_obj.has_member("name")) { + string username = response_obj.get_string_member("name"); + + if (username != "") + this.params.insert("UserName", new Variant.string(username)); + } + + if (response_obj.has_member("access_token")) { + string access_token = response_obj.get_string_member("access_token"); + + if (access_token != "") + this.params.insert("AccessToken", new Variant.string(access_token)); + } + + // by the time we get a username, the session should be authenticated, or else something + // really tragic has happened + assert(session.is_authenticated()); + host.set_config_string("refresh_token", session.refresh_token); + + this.authenticated(); + } + + + private void do_exchange_refresh_token_for_access_token() { + debug("ACTION: exchanging OAuth refresh token for OAuth access token."); + + host.install_login_wait_pane(); + + RefreshAccessTokenTransaction txn = new RefreshAccessTokenTransaction(session); + + txn.completed.connect(on_refresh_access_token_transaction_completed); + txn.network_error.connect(on_refresh_access_token_transaction_error); + + try { + txn.execute(); + } catch (Spit.Publishing.PublishingError err) { + host.post_error(err); + } + } + + private void on_refresh_access_token_transaction_completed(Publishing.RESTSupport.Transaction + txn) { + txn.completed.disconnect(on_refresh_access_token_transaction_completed); + txn.network_error.disconnect(on_refresh_access_token_transaction_error); + + debug("EVENT: refresh access token transaction completed successfully."); + + if (session.is_authenticated()) // ignore these events if the session is already auth'd + return; + + do_extract_tokens(txn.get_response()); + } + + private void on_refresh_access_token_transaction_error(Publishing.RESTSupport.Transaction txn, + Spit.Publishing.PublishingError err) { + txn.completed.disconnect(on_refresh_access_token_transaction_completed); + txn.network_error.disconnect(on_refresh_access_token_transaction_error); + + debug("EVENT: refresh access token transaction caused a network error."); + + if (session.is_authenticated()) // ignore these events if the session is already auth'd + return; + if (txn.get_status_code() == Soup.Status.BAD_REQUEST || + txn.get_status_code() == Soup.Status.UNAUTHORIZED) { + // Refresh token invalid, starting over + host.set_config_string("refresh_token", ""); + Idle.add (() => { this.authenticate(); return false; }); + } + + host.post_error(err); + } + + private void do_show_service_welcome_pane() { + debug("ACTION: showing service welcome pane."); + + this.host.install_welcome_pane(this.welcome_message, on_service_welcome_login); + } + + private void on_service_welcome_login() { + debug("EVENT: user clicked 'Login' in welcome pane."); + + this.do_hosted_web_authentication(); + } + + + } +} diff --git a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.c b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.c new file mode 100644 index 0000000..fe03b0e --- /dev/null +++ b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.c @@ -0,0 +1,356 @@ +/* ShotwellAuthenticatorFactory.c generated by valac 0.34.4, the Vala compiler + * generated from ShotwellAuthenticatorFactory.vala, do not modify */ + + +#include +#include +#include "shotwell-plugin-dev-1.0.h" +#include +#include +#include +#include + + +#define PUBLISHING_AUTHENTICATOR_TYPE_FACTORY (publishing_authenticator_factory_get_type ()) +#define PUBLISHING_AUTHENTICATOR_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactory)) +#define PUBLISHING_AUTHENTICATOR_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactoryClass)) +#define PUBLISHING_AUTHENTICATOR_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_TYPE_FACTORY)) +#define PUBLISHING_AUTHENTICATOR_IS_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_TYPE_FACTORY)) +#define PUBLISHING_AUTHENTICATOR_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactoryClass)) + +typedef struct _PublishingAuthenticatorFactory PublishingAuthenticatorFactory; +typedef struct _PublishingAuthenticatorFactoryClass PublishingAuthenticatorFactoryClass; +typedef struct _PublishingAuthenticatorFactoryPrivate PublishingAuthenticatorFactoryPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR (publishing_authenticator_shotwell_flickr_flickr_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickr)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickrClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_IS_FLICKR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_FLICKR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FLICKR_TYPE_FLICKR, PublishingAuthenticatorShotwellFlickrFlickrClass)) + +typedef struct _PublishingAuthenticatorShotwellFlickrFlickr PublishingAuthenticatorShotwellFlickrFlickr; +typedef struct _PublishingAuthenticatorShotwellFlickrFlickrClass PublishingAuthenticatorShotwellFlickrFlickrClass; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK (publishing_authenticator_shotwell_facebook_facebook_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebook)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebookClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_IS_FACEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_FACEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_FACEBOOK_TYPE_FACEBOOK, PublishingAuthenticatorShotwellFacebookFacebookClass)) + +typedef struct _PublishingAuthenticatorShotwellFacebookFacebook PublishingAuthenticatorShotwellFacebookFacebook; +typedef struct _PublishingAuthenticatorShotwellFacebookFacebookClass PublishingAuthenticatorShotwellFacebookFacebookClass; + +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE (publishing_authenticator_shotwell_google_google_get_type ()) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogle)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogleClass)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_IS_GOOGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE)) +#define PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_GOOGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PUBLISHING_AUTHENTICATOR_SHOTWELL_GOOGLE_TYPE_GOOGLE, PublishingAuthenticatorShotwellGoogleGoogleClass)) + +typedef struct _PublishingAuthenticatorShotwellGoogleGoogle PublishingAuthenticatorShotwellGoogleGoogle; +typedef struct _PublishingAuthenticatorShotwellGoogleGoogleClass PublishingAuthenticatorShotwellGoogleGoogleClass; + +struct _PublishingAuthenticatorFactory { + GObject parent_instance; + PublishingAuthenticatorFactoryPrivate * priv; +}; + +struct _PublishingAuthenticatorFactoryClass { + GObjectClass parent_class; +}; + + +static gpointer publishing_authenticator_factory_parent_class = NULL; +static PublishingAuthenticatorFactory* publishing_authenticator_factory_instance; +static PublishingAuthenticatorFactory* publishing_authenticator_factory_instance = NULL; +static SpitPublishingAuthenticatorFactoryIface* publishing_authenticator_factory_spit_publishing_authenticator_factory_parent_iface = NULL; + +GType publishing_authenticator_factory_get_type (void) G_GNUC_CONST; +enum { + PUBLISHING_AUTHENTICATOR_FACTORY_DUMMY_PROPERTY +}; +PublishingAuthenticatorFactory* publishing_authenticator_factory_get_instance (void); +PublishingAuthenticatorFactory* publishing_authenticator_factory_new (void); +PublishingAuthenticatorFactory* publishing_authenticator_factory_construct (GType object_type); +static GeeList* publishing_authenticator_factory_real_get_available_authenticators (SpitPublishingAuthenticatorFactory* base); +static SpitPublishingAuthenticator* publishing_authenticator_factory_real_create (SpitPublishingAuthenticatorFactory* base, const gchar* provider, SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_new (SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellFlickrFlickr* publishing_authenticator_shotwell_flickr_flickr_construct (GType object_type, SpitPublishingPluginHost* host); +GType publishing_authenticator_shotwell_flickr_flickr_get_type (void) G_GNUC_CONST; +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_new (SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellFacebookFacebook* publishing_authenticator_shotwell_facebook_facebook_construct (GType object_type, SpitPublishingPluginHost* host); +GType publishing_authenticator_shotwell_facebook_facebook_get_type (void) G_GNUC_CONST; +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_new (const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host); +PublishingAuthenticatorShotwellGoogleGoogle* publishing_authenticator_shotwell_google_google_construct (GType object_type, const gchar* scope, const gchar* welcome_message, SpitPublishingPluginHost* host); +GType publishing_authenticator_shotwell_google_google_get_type (void) G_GNUC_CONST; +static void publishing_authenticator_factory_finalize (GObject* obj); + + +static gpointer _g_object_ref0 (gpointer self) { +#line 10 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return self ? g_object_ref (self) : NULL; +#line 96 "ShotwellAuthenticatorFactory.c" +} + + +PublishingAuthenticatorFactory* publishing_authenticator_factory_get_instance (void) { + PublishingAuthenticatorFactory* result = NULL; + PublishingAuthenticatorFactory* _tmp0_ = NULL; + PublishingAuthenticatorFactory* _tmp2_ = NULL; + PublishingAuthenticatorFactory* _tmp3_ = NULL; +#line 6 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp0_ = publishing_authenticator_factory_instance; +#line 6 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + if (_tmp0_ == NULL) { +#line 109 "ShotwellAuthenticatorFactory.c" + PublishingAuthenticatorFactory* _tmp1_ = NULL; +#line 7 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp1_ = publishing_authenticator_factory_new (); +#line 7 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _g_object_unref0 (publishing_authenticator_factory_instance); +#line 7 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + publishing_authenticator_factory_instance = _tmp1_; +#line 117 "ShotwellAuthenticatorFactory.c" + } +#line 10 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp2_ = publishing_authenticator_factory_instance; +#line 10 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp3_ = _g_object_ref0 (_tmp2_); +#line 10 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = _tmp3_; +#line 10 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 127 "ShotwellAuthenticatorFactory.c" +} + + +static GeeList* publishing_authenticator_factory_real_get_available_authenticators (SpitPublishingAuthenticatorFactory* base) { + PublishingAuthenticatorFactory * self; + GeeList* result = NULL; + GeeArrayList* list = NULL; + GeeArrayList* _tmp0_ = NULL; +#line 13 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactory); +#line 14 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL, NULL); +#line 14 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + list = _tmp0_; +#line 15 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), "flickr"); +#line 16 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), "facebook"); +#line 17 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), "picasa"); +#line 18 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + gee_abstract_collection_add (G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_ABSTRACT_COLLECTION, GeeAbstractCollection), "youtube"); +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (list, GEE_TYPE_LIST, GeeList); +#line 20 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 154 "ShotwellAuthenticatorFactory.c" +} + + +static SpitPublishingAuthenticator* publishing_authenticator_factory_real_create (SpitPublishingAuthenticatorFactory* base, const gchar* provider, SpitPublishingPluginHost* host) { + PublishingAuthenticatorFactory * self; + SpitPublishingAuthenticator* result = NULL; + const gchar* _tmp0_ = NULL; + const gchar* _tmp1_ = NULL; + GQuark _tmp3_ = 0U; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + static GQuark _tmp2_label0 = 0; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + static GQuark _tmp2_label1 = 0; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + static GQuark _tmp2_label2 = 0; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + static GQuark _tmp2_label3 = 0; +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (base, PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactory); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + g_return_val_if_fail (provider != NULL, NULL); +#line 23 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + g_return_val_if_fail (SPIT_PUBLISHING_IS_PLUGIN_HOST (host), NULL); +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp0_ = provider; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp1_ = _tmp0_; +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_); +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("flickr")))) { +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + switch (0) { +#line 188 "ShotwellAuthenticatorFactory.c" + default: + { + SpitPublishingPluginHost* _tmp4_ = NULL; + PublishingAuthenticatorShotwellFlickrFlickr* _tmp5_ = NULL; +#line 27 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp4_ = host; +#line 27 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp5_ = publishing_authenticator_shotwell_flickr_flickr_new (_tmp4_); +#line 27 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator); +#line 27 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 201 "ShotwellAuthenticatorFactory.c" + } + } + } else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("facebook")))) { +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + switch (0) { +#line 207 "ShotwellAuthenticatorFactory.c" + default: + { + SpitPublishingPluginHost* _tmp6_ = NULL; + PublishingAuthenticatorShotwellFacebookFacebook* _tmp7_ = NULL; +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp6_ = host; +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp7_ = publishing_authenticator_shotwell_facebook_facebook_new (_tmp6_); +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp7_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator); +#line 29 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 220 "ShotwellAuthenticatorFactory.c" + } + } + } else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("picasa")))) { +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + switch (0) { +#line 226 "ShotwellAuthenticatorFactory.c" + default: + { + const gchar* _tmp8_ = NULL; + SpitPublishingPluginHost* _tmp9_ = NULL; + PublishingAuthenticatorShotwellGoogleGoogle* _tmp10_ = NULL; +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp8_ = _ ("You are not currently logged into Picasa Web Albums.\n" \ +"\n" \ +"Click Log in to log into Picasa Web Albums in your Web browser. You wi" \ +"ll have to authorize Shotwell Connect to link to your Picasa Web Album" \ +"s account."); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp9_ = host; +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp10_ = publishing_authenticator_shotwell_google_google_new ("https://picasaweb.google.com/data/", _tmp8_, _tmp9_); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator); +#line 31 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 242 "ShotwellAuthenticatorFactory.c" + } + } + } else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("youtube")))) { +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + switch (0) { +#line 248 "ShotwellAuthenticatorFactory.c" + default: + { + const gchar* _tmp11_ = NULL; + SpitPublishingPluginHost* _tmp12_ = NULL; + PublishingAuthenticatorShotwellGoogleGoogle* _tmp13_ = NULL; +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp11_ = _ ("You are not currently logged into YouTube.\n" \ +"\n" \ +"You must have already signed up for a Google account and set it up for" \ +" use with YouTube to continue. You can set up most accounts by using y" \ +"our browser to log into the YouTube site at least once."); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp12_ = host; +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + _tmp13_ = publishing_authenticator_shotwell_google_google_new ("https://gdata.youtube.com/", _tmp11_, _tmp12_); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = G_TYPE_CHECK_INSTANCE_CAST (_tmp13_, SPIT_PUBLISHING_TYPE_AUTHENTICATOR, SpitPublishingAuthenticator); +#line 34 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 264 "ShotwellAuthenticatorFactory.c" + } + } + } else { +#line 25 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + switch (0) { +#line 270 "ShotwellAuthenticatorFactory.c" + default: + { +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + result = NULL; +#line 36 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return result; +#line 277 "ShotwellAuthenticatorFactory.c" + } + } + } +} + + +PublishingAuthenticatorFactory* publishing_authenticator_factory_construct (GType object_type) { + PublishingAuthenticatorFactory * self = NULL; +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + self = (PublishingAuthenticatorFactory*) g_object_new (object_type, NULL); +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return self; +#line 290 "ShotwellAuthenticatorFactory.c" +} + + +PublishingAuthenticatorFactory* publishing_authenticator_factory_new (void) { +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + return publishing_authenticator_factory_construct (PUBLISHING_AUTHENTICATOR_TYPE_FACTORY); +#line 297 "ShotwellAuthenticatorFactory.c" +} + + +static void publishing_authenticator_factory_class_init (PublishingAuthenticatorFactoryClass * klass) { +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + publishing_authenticator_factory_parent_class = g_type_class_peek_parent (klass); +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + G_OBJECT_CLASS (klass)->finalize = publishing_authenticator_factory_finalize; +#line 306 "ShotwellAuthenticatorFactory.c" +} + + +static void publishing_authenticator_factory_spit_publishing_authenticator_factory_interface_init (SpitPublishingAuthenticatorFactoryIface * iface) { +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + publishing_authenticator_factory_spit_publishing_authenticator_factory_parent_iface = g_type_interface_peek_parent (iface); +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + iface->get_available_authenticators = (GeeList* (*)(SpitPublishingAuthenticatorFactory*)) publishing_authenticator_factory_real_get_available_authenticators; +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + iface->create = (SpitPublishingAuthenticator* (*)(SpitPublishingAuthenticatorFactory*, const gchar*, SpitPublishingPluginHost*)) publishing_authenticator_factory_real_create; +#line 317 "ShotwellAuthenticatorFactory.c" +} + + +static void publishing_authenticator_factory_instance_init (PublishingAuthenticatorFactory * self) { +} + + +static void publishing_authenticator_factory_finalize (GObject* obj) { + PublishingAuthenticatorFactory * self; +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + self = G_TYPE_CHECK_INSTANCE_CAST (obj, PUBLISHING_AUTHENTICATOR_TYPE_FACTORY, PublishingAuthenticatorFactory); +#line 2 "/home/jens/Source/shotwell/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala" + G_OBJECT_CLASS (publishing_authenticator_factory_parent_class)->finalize (obj); +#line 331 "ShotwellAuthenticatorFactory.c" +} + + +GType publishing_authenticator_factory_get_type (void) { + static volatile gsize publishing_authenticator_factory_type_id__volatile = 0; + if (g_once_init_enter (&publishing_authenticator_factory_type_id__volatile)) { + static const GTypeInfo g_define_type_info = { sizeof (PublishingAuthenticatorFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) publishing_authenticator_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PublishingAuthenticatorFactory), 0, (GInstanceInitFunc) publishing_authenticator_factory_instance_init, NULL }; + static const GInterfaceInfo spit_publishing_authenticator_factory_info = { (GInterfaceInitFunc) publishing_authenticator_factory_spit_publishing_authenticator_factory_interface_init, (GInterfaceFinalizeFunc) NULL, NULL}; + GType publishing_authenticator_factory_type_id; + publishing_authenticator_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "PublishingAuthenticatorFactory", &g_define_type_info, 0); + g_type_add_interface_static (publishing_authenticator_factory_type_id, SPIT_PUBLISHING_TYPE_AUTHENTICATOR_FACTORY, &spit_publishing_authenticator_factory_info); + g_once_init_leave (&publishing_authenticator_factory_type_id__volatile, publishing_authenticator_factory_type_id); + } + return publishing_authenticator_factory_type_id__volatile; +} + + + diff --git a/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala new file mode 100644 index 0000000..17980e6 --- /dev/null +++ b/plugins/authenticator/shotwell/ShotwellAuthenticatorFactory.vala @@ -0,0 +1,40 @@ +namespace Publishing.Authenticator { + public class Factory : Spit.Publishing.AuthenticatorFactory, Object { + private static Factory instance = null; + + public static Factory get_instance() { + if (Factory.instance == null) { + Factory.instance = new Factory(); + } + + return Factory.instance; + } + + public Gee.List get_available_authenticators() { + var list = new Gee.ArrayList(); + list.add("flickr"); + list.add("facebook"); + list.add("picasa"); + list.add("youtube"); + + return list; + } + + public Spit.Publishing.Authenticator? create(string provider, + Spit.Publishing.PluginHost host) { + switch (provider) { + case "flickr": + return new Shotwell.Flickr.Flickr(host); + case "facebook": + return new Shotwell.Facebook.Facebook(host); + case "picasa": + return new Shotwell.Google.Google("https://picasaweb.google.com/data/", _("You are not currently logged into Picasa Web Albums.\n\nClick Log in to log into Picasa Web Albums in your Web browser. You will have to authorize Shotwell Connect to link to your Picasa Web Albums account."), host); + + case "youtube": + return new Shotwell.Google.Google("https://gdata.youtube.com/", _("You are not currently logged into YouTube.\n\nYou must have already signed up for a Google account and set it up for use with YouTube to continue. You can set up most accounts by using your browser to log into the YouTube site at least once."), host); + default: + return null; + } + } + } +} diff --git a/plugins/authenticator/shotwell/flickr_pin_entry_pane.ui b/plugins/authenticator/shotwell/flickr_pin_entry_pane.ui new file mode 100644 index 0000000..dd4c35c --- /dev/null +++ b/plugins/authenticator/shotwell/flickr_pin_entry_pane.ui @@ -0,0 +1,90 @@ + + + + + + True + False + vertical + + + True + False + 16 + 16 + 48 + 16 + Enter the confirmation number which appears after you log into Flickr in your Web browser. + 0.0099999997764825821 + + + False + True + 0 + + + + + True + False + center + 80 + + + True + False + end + Authorization _Number: + True + right + pin_entry + + + False + False + 0 + + + + + True + True + 8 + + + + False + True + 1 + + + + + False + False + 1 + + + + + Con_tinue + True + True + True + 240 + 240 + 160 + True + + + False + False + end + 2 + + + + + + + diff --git a/plugins/authenticator/shotwell/org.gnome.Shotwell.Authenticator.gresource.xml b/plugins/authenticator/shotwell/org.gnome.Shotwell.Authenticator.gresource.xml new file mode 100644 index 0000000..c40e700 --- /dev/null +++ b/plugins/authenticator/shotwell/org.gnome.Shotwell.Authenticator.gresource.xml @@ -0,0 +1,6 @@ + + + + flickr_pin_entry_pane.ui + + -- cgit v1.2.3