Merge lp:~mardy/shotwell/update-uoa into lp:~robert-ancell/shotwell/update-0.12.90
- update-uoa
- Merge into update-0.12.90
Proposed by
Alberto Mardegan
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Robert Ancell | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~mardy/shotwell/update-uoa | ||||
Merge into: | lp:~robert-ancell/shotwell/update-0.12.90 | ||||
Diff against target: |
1438 lines (+489/-601) 1 file modified
debian/patches/06_uoa.patch (+489/-601) |
||||
To merge this branch: | bzr merge lp:~mardy/shotwell/update-uoa | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Ancell | Pending | ||
Review via email: mp+121556@code.launchpad.net |
Commit message
Description of the change
Updated UOA patch.
To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/patches/06_uoa.patch' | |||
2 | --- debian/patches/06_uoa.patch 2012-08-24 03:46:31 +0000 | |||
3 | +++ debian/patches/06_uoa.patch 2012-08-28 08:16:23 +0000 | |||
4 | @@ -1,8 +1,11 @@ | |||
5 | 1 | Description: use Ubuntu Online Accounts for Picasa, Facebook and Flickr export plugins | ||
6 | 2 | Author: Alberto Mardegan <alberto.mardegan@canonical.com> | ||
7 | 3 | |||
8 | 1 | === modified file 'Makefile' | 4 | === modified file 'Makefile' |
9 | 2 | Index: shotwell-0.12.90/Makefile | 5 | Index: shotwell-0.12.90/Makefile |
10 | 3 | =================================================================== | 6 | =================================================================== |
13 | 4 | --- shotwell-0.12.90.orig/Makefile 2012-08-24 15:04:46.000000000 +1200 | 7 | --- shotwell-0.12.90.orig/Makefile 2012-08-28 10:25:15.248034132 +0300 |
14 | 5 | +++ shotwell-0.12.90/Makefile 2012-08-24 15:15:23.963988123 +1200 | 8 | +++ shotwell-0.12.90/Makefile 2012-08-28 10:25:15.288033628 +0300 |
15 | 6 | @@ -151,6 +151,7 @@ | 9 | @@ -151,6 +151,7 @@ |
16 | 7 | trash.ui | 10 | trash.ui |
17 | 8 | 11 | ||
18 | @@ -22,8 +25,8 @@ | |||
19 | 22 | mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps | 25 | mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps |
20 | 23 | Index: shotwell-0.12.90/misc/org.yorba.shotwell.gschema.xml | 26 | Index: shotwell-0.12.90/misc/org.yorba.shotwell.gschema.xml |
21 | 24 | =================================================================== | 27 | =================================================================== |
24 | 25 | --- shotwell-0.12.90.orig/misc/org.yorba.shotwell.gschema.xml 2012-08-24 09:03:04.000000000 +1200 | 28 | --- shotwell-0.12.90.orig/misc/org.yorba.shotwell.gschema.xml 2012-08-24 00:03:04.000000000 +0300 |
25 | 26 | +++ shotwell-0.12.90/misc/org.yorba.shotwell.gschema.xml 2012-08-24 15:15:23.963988123 +1200 | 29 | +++ shotwell-0.12.90/misc/org.yorba.shotwell.gschema.xml 2012-08-28 10:25:15.288033628 +0300 |
26 | 27 | @@ -304,6 +304,12 @@ | 30 | @@ -304,6 +304,12 @@ |
27 | 28 | <description>Facebook user i.d. for the currently logged in user, if any</description> | 31 | <description>Facebook user i.d. for the currently logged in user, if any</description> |
28 | 29 | </key> | 32 | </key> |
29 | @@ -40,7 +43,7 @@ | |||
30 | 40 | Index: shotwell-0.12.90/misc/shotwell.application | 43 | Index: shotwell-0.12.90/misc/shotwell.application |
31 | 41 | =================================================================== | 44 | =================================================================== |
32 | 42 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 45 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
34 | 43 | +++ shotwell-0.12.90/misc/shotwell.application 2012-08-24 15:15:23.967988123 +1200 | 46 | +++ shotwell-0.12.90/misc/shotwell.application 2012-08-28 10:25:15.292033578 +0300 |
35 | 44 | @@ -0,0 +1,18 @@ | 47 | @@ -0,0 +1,18 @@ |
36 | 45 | +<?xml version="1.0" encoding="UTF-8" ?> | 48 | +<?xml version="1.0" encoding="UTF-8" ?> |
37 | 46 | +<application id="shotwell"> | 49 | +<application id="shotwell"> |
38 | @@ -62,8 +65,8 @@ | |||
39 | 62 | +</application> | 65 | +</application> |
40 | 63 | Index: shotwell-0.12.90/plugins/Makefile | 66 | Index: shotwell-0.12.90/plugins/Makefile |
41 | 64 | =================================================================== | 67 | =================================================================== |
44 | 65 | --- shotwell-0.12.90.orig/plugins/Makefile 2012-08-24 09:03:04.000000000 +1200 | 68 | --- shotwell-0.12.90.orig/plugins/Makefile 2012-08-24 00:03:04.000000000 +0300 |
45 | 66 | +++ shotwell-0.12.90/plugins/Makefile 2012-08-24 15:15:23.967988123 +1200 | 69 | +++ shotwell-0.12.90/plugins/Makefile 2012-08-28 10:25:15.292033578 +0300 |
46 | 67 | @@ -4,7 +4,10 @@ | 70 | @@ -4,7 +4,10 @@ |
47 | 68 | DIST_FILES := \ | 71 | DIST_FILES := \ |
48 | 69 | Makefile \ | 72 | Makefile \ |
49 | @@ -78,8 +81,8 @@ | |||
50 | 78 | all: $(ALL_PLUGINS) | 81 | all: $(ALL_PLUGINS) |
51 | 79 | Index: shotwell-0.12.90/plugins/Makefile.plugin.mk | 82 | Index: shotwell-0.12.90/plugins/Makefile.plugin.mk |
52 | 80 | =================================================================== | 83 | =================================================================== |
55 | 81 | --- shotwell-0.12.90.orig/plugins/Makefile.plugin.mk 2012-08-24 09:03:04.000000000 +1200 | 84 | --- shotwell-0.12.90.orig/plugins/Makefile.plugin.mk 2012-08-24 00:03:04.000000000 +0300 |
56 | 82 | +++ shotwell-0.12.90/plugins/Makefile.plugin.mk 2012-08-24 15:15:23.967988123 +1200 | 85 | +++ shotwell-0.12.90/plugins/Makefile.plugin.mk 2012-08-28 10:25:15.292033578 +0300 |
57 | 83 | @@ -27,6 +27,8 @@ | 86 | @@ -27,6 +27,8 @@ |
58 | 84 | # automatically include the shotwell-plugin-dev-1.0 package as a local dependency | 87 | # automatically include the shotwell-plugin-dev-1.0 package as a local dependency |
59 | 85 | EXT_PKGS := $(PKGS) | 88 | EXT_PKGS := $(PKGS) |
60 | @@ -91,8 +94,8 @@ | |||
61 | 91 | SRC_FILES := ../common/Resources.vala $(SRC_FILES) | 94 | SRC_FILES := ../common/Resources.vala $(SRC_FILES) |
62 | 92 | Index: shotwell-0.12.90/plugins/common/RESTSupport.vala | 95 | Index: shotwell-0.12.90/plugins/common/RESTSupport.vala |
63 | 93 | =================================================================== | 96 | =================================================================== |
66 | 94 | --- shotwell-0.12.90.orig/plugins/common/RESTSupport.vala 2012-08-24 09:03:04.000000000 +1200 | 97 | --- shotwell-0.12.90.orig/plugins/common/RESTSupport.vala 2012-08-24 00:03:04.000000000 +0300 |
67 | 95 | +++ shotwell-0.12.90/plugins/common/RESTSupport.vala 2012-08-24 15:15:23.967988123 +1200 | 98 | +++ shotwell-0.12.90/plugins/common/RESTSupport.vala 2012-08-28 10:25:15.296033528 +0300 |
68 | 96 | @@ -314,7 +314,7 @@ | 99 | @@ -314,7 +314,7 @@ |
69 | 97 | old_url = message.get_uri().to_string(false); | 100 | old_url = message.get_uri().to_string(false); |
70 | 98 | url_with_query = get_endpoint_url() + "?" + formdata_string; | 101 | url_with_query = get_endpoint_url() + "?" + formdata_string; |
71 | @@ -105,7 +108,7 @@ | |||
72 | 105 | Index: shotwell-0.12.90/plugins/common/accounts.vala | 108 | Index: shotwell-0.12.90/plugins/common/accounts.vala |
73 | 106 | =================================================================== | 109 | =================================================================== |
74 | 107 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | 110 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
76 | 108 | +++ shotwell-0.12.90/plugins/common/accounts.vala 2012-08-24 15:15:23.967988123 +1200 | 111 | +++ shotwell-0.12.90/plugins/common/accounts.vala 2012-08-28 10:25:15.296033528 +0300 |
77 | 109 | @@ -0,0 +1,54 @@ | 112 | @@ -0,0 +1,54 @@ |
78 | 110 | +/* Copyright 2009-2011 Yorba Foundation | 113 | +/* Copyright 2009-2011 Yorba Foundation |
79 | 111 | + * | 114 | + * |
80 | @@ -163,8 +166,8 @@ | |||
81 | 163 | + | 166 | + |
82 | 164 | Index: shotwell-0.12.90/plugins/shotwell-publishing/FacebookPublishing.vala | 167 | Index: shotwell-0.12.90/plugins/shotwell-publishing/FacebookPublishing.vala |
83 | 165 | =================================================================== | 168 | =================================================================== |
86 | 166 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/FacebookPublishing.vala 2012-08-24 15:07:12.024005156 +1200 | 169 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/FacebookPublishing.vala 2012-08-24 00:03:04.000000000 +0300 |
87 | 167 | +++ shotwell-0.12.90/plugins/shotwell-publishing/FacebookPublishing.vala 2012-08-24 15:15:23.967988123 +1200 | 170 | +++ shotwell-0.12.90/plugins/shotwell-publishing/FacebookPublishing.vala 2012-08-28 11:11:00.554691926 +0300 |
88 | 168 | @@ -4,6 +4,8 @@ | 171 | @@ -4,6 +4,8 @@ |
89 | 169 | * (version 2.1 or later). See the COPYING file in this distribution. | 172 | * (version 2.1 or later). See the COPYING file in this distribution. |
90 | 170 | */ | 173 | */ |
91 | @@ -186,7 +189,7 @@ | |||
92 | 186 | } | 189 | } |
93 | 187 | 190 | ||
94 | 188 | namespace Publishing.Facebook { | 191 | namespace Publishing.Facebook { |
96 | 189 | @@ -163,14 +170,103 @@ | 192 | @@ -163,11 +170,11 @@ |
97 | 190 | private int publish_to_album = NO_ALBUM; | 193 | private int publish_to_album = NO_ALBUM; |
98 | 191 | private weak Spit.Publishing.PluginHost host = null; | 194 | private weak Spit.Publishing.PluginHost host = null; |
99 | 192 | private FacebookRESTSession session = null; | 195 | private FacebookRESTSession session = null; |
100 | @@ -199,99 +202,7 @@ | |||
101 | 199 | 202 | ||
102 | 200 | private Resolution target_resolution = Resolution.HIGH; | 203 | private Resolution target_resolution = Resolution.HIGH; |
103 | 201 | 204 | ||
197 | 202 | + private struct LocaleLookup { | 205 | @@ -402,37 +409,56 @@ |
105 | 203 | + public string prefix; | ||
106 | 204 | + public string translation; | ||
107 | 205 | + public string? exception_code; | ||
108 | 206 | + public string? exception_translation; | ||
109 | 207 | + public string? exception_code_2; | ||
110 | 208 | + public string? exception_translation_2; | ||
111 | 209 | + } | ||
112 | 210 | + | ||
113 | 211 | + private const LocaleLookup[] locale_lookup_table = { | ||
114 | 212 | + { "es", "es-la", "ES", "es-es" }, | ||
115 | 213 | + { "en", "en-gb", "US", "en-us" }, | ||
116 | 214 | + { "fr", "fr-fr", "CA", "fr-ca" }, | ||
117 | 215 | + { "pt", "pt-br", "PT", "pt-pt" }, | ||
118 | 216 | + { "zh", "zh-cn", "HK", "zh-hk", "TW", "zh-tw" }, | ||
119 | 217 | + { "af", "af-za" }, | ||
120 | 218 | + { "ar", "ar-ar" }, | ||
121 | 219 | + { "nb", "nb-no" }, | ||
122 | 220 | + { "no", "nb-no" }, | ||
123 | 221 | + { "id", "id-id" }, | ||
124 | 222 | + { "ms", "ms-my" }, | ||
125 | 223 | + { "ca", "ca-es" }, | ||
126 | 224 | + { "cs", "cs-cz" }, | ||
127 | 225 | + { "cy", "cy-gb" }, | ||
128 | 226 | + { "da", "da-dk" }, | ||
129 | 227 | + { "de", "de-de" }, | ||
130 | 228 | + { "tl", "tl-ph" }, | ||
131 | 229 | + { "ko", "ko-kr" }, | ||
132 | 230 | + { "hr", "hr-hr" }, | ||
133 | 231 | + { "it", "it-it" }, | ||
134 | 232 | + { "lt", "lt-lt" }, | ||
135 | 233 | + { "hu", "hu-hu" }, | ||
136 | 234 | + { "nl", "nl-nl" }, | ||
137 | 235 | + { "ja", "ja-jp" }, | ||
138 | 236 | + { "nb", "nb-no" }, | ||
139 | 237 | + { "no", "nb-no" }, | ||
140 | 238 | + { "pl", "pl-pl" }, | ||
141 | 239 | + { "ro", "ro-ro" }, | ||
142 | 240 | + { "ru", "ru-ru" }, | ||
143 | 241 | + { "sk", "sk-sk" }, | ||
144 | 242 | + { "sl", "sl-sl" }, | ||
145 | 243 | + { "sv", "sv-se" }, | ||
146 | 244 | + { "th", "th-th" }, | ||
147 | 245 | + { "vi", "vi-vn" }, | ||
148 | 246 | + { "tr", "tr-tr" }, | ||
149 | 247 | + { "el", "el-gr" }, | ||
150 | 248 | + { "bg", "bg-bg" }, | ||
151 | 249 | + { "sr", "sr-rs" }, | ||
152 | 250 | + { "he", "he-il" }, | ||
153 | 251 | + { "hi", "hi-in" }, | ||
154 | 252 | + { "bn", "bn-in" }, | ||
155 | 253 | + { "pa", "pa-in" }, | ||
156 | 254 | + { "ta", "ta-in" }, | ||
157 | 255 | + { "te", "te-in" }, | ||
158 | 256 | + { "ml", "ml-in" } | ||
159 | 257 | + }; | ||
160 | 258 | + | ||
161 | 259 | + private string get_system_locale_as_facebook_locale() { | ||
162 | 260 | + unowned string? raw_system_locale = Intl.setlocale(LocaleCategory.ALL, ""); | ||
163 | 261 | + if (raw_system_locale == null || raw_system_locale == "") | ||
164 | 262 | + return "www"; | ||
165 | 263 | + | ||
166 | 264 | + string system_locale = raw_system_locale.split(".")[0]; | ||
167 | 265 | + | ||
168 | 266 | + foreach (LocaleLookup locale_lookup in locale_lookup_table) { | ||
169 | 267 | + if (!system_locale.has_prefix(locale_lookup.prefix)) | ||
170 | 268 | + continue; | ||
171 | 269 | + | ||
172 | 270 | + if (locale_lookup.exception_code != null) { | ||
173 | 271 | + assert(locale_lookup.exception_translation != null); | ||
174 | 272 | + | ||
175 | 273 | + if (system_locale.contains(locale_lookup.exception_code)) | ||
176 | 274 | + return locale_lookup.exception_translation; | ||
177 | 275 | + } | ||
178 | 276 | + | ||
179 | 277 | + if (locale_lookup.exception_code_2 != null) { | ||
180 | 278 | + assert(locale_lookup.exception_translation_2 != null); | ||
181 | 279 | + | ||
182 | 280 | + if (system_locale.contains(locale_lookup.exception_code_2)) | ||
183 | 281 | + return locale_lookup.exception_translation_2; | ||
184 | 282 | + } | ||
185 | 283 | + | ||
186 | 284 | + return locale_lookup.translation; | ||
187 | 285 | + } | ||
188 | 286 | + | ||
189 | 287 | + // default | ||
190 | 288 | + return "www"; | ||
191 | 289 | + } | ||
192 | 290 | + | ||
193 | 291 | public FacebookPublisher(Spit.Publishing.Service service, | ||
194 | 292 | Spit.Publishing.PluginHost host) { | ||
195 | 293 | debug("FacebookPublisher instantiated."); | ||
196 | 294 | @@ -402,37 +498,80 @@ | ||
198 | 295 | start(); | 206 | start(); |
199 | 296 | } | 207 | } |
200 | 297 | 208 | ||
201 | @@ -347,46 +258,22 @@ | |||
202 | 347 | + data = account.get_session_parameters(out mechanism); | 258 | + data = account.get_session_parameters(out mechanism); |
203 | 348 | + debug("Got account data"); | 259 | + debug("Got account data"); |
204 | 349 | + } catch (GLib.Error e) { | 260 | + } catch (GLib.Error e) { |
216 | 350 | + debug("EVENT: couldn't create session for account: %s", | 261 | + warning("EVENT: couldn't create session for account: %s", |
217 | 351 | + e.message); | 262 | + e.message); |
207 | 352 | + } | ||
208 | 353 | + } | ||
209 | 354 | + | ||
210 | 355 | + if (auth_session == null) { | ||
211 | 356 | + debug("Creating unbound session"); | ||
212 | 357 | + try { | ||
213 | 358 | + auth_session = new Signon.AuthSession(0, "oauth2"); | ||
214 | 359 | + } catch (GLib.Error e) { | ||
215 | 360 | + debug("EVENT: AuthSession creation failed: %s", e.message); | ||
218 | 361 | + return; | 263 | + return; |
219 | 362 | + } | 264 | + } |
220 | 363 | } | 265 | } |
221 | 364 | + | 266 | + |
222 | 365 | + if (data == null) { | 267 | + if (data == null) { |
242 | 366 | + debug("Using own params"); | 268 | + warning ("No account authentication data"); |
243 | 367 | + data = new HashTable<string,Value?>(str_hash, str_equal); | 269 | + host.post_error(new Spit.Publishing.PublishingError.SERVICE_ERROR( |
244 | 368 | + string facebook_locale = get_system_locale_as_facebook_locale(); | 270 | + "Error while accessing the account")); |
245 | 369 | + string host_name = "%s.facebook.com".printf(facebook_locale); | 271 | + return; |
227 | 370 | + data.insert("Host", host_name); | ||
228 | 371 | + data.insert("AuthPath", "/dialog/oauth"); | ||
229 | 372 | + data.insert("ClientId", APPLICATION_ID); | ||
230 | 373 | + data.insert("RedirectUri", "https://www.facebook.com/connect/login_success.html"); | ||
231 | 374 | + string[] scopes = { | ||
232 | 375 | + "offline_access", | ||
233 | 376 | + "publish_stream", | ||
234 | 377 | + "user_photos", | ||
235 | 378 | + "user_videos" | ||
236 | 379 | + }; | ||
237 | 380 | + data.insert("Scope", scopes); | ||
238 | 381 | + string[] response_type = { | ||
239 | 382 | + "token" | ||
240 | 383 | + }; | ||
241 | 384 | + data.insert("ResponseType", response_type); | ||
246 | 385 | + } | 272 | + } |
247 | 386 | + | 273 | + |
248 | 387 | + var windowId = host.get_dialog_xid(); | 274 | + var windowId = host.get_dialog_xid(); |
249 | 388 | + if (windowId != 0) { | 275 | + if (windowId != 0) { |
251 | 389 | + data.insert("WindowId", windowId); | 276 | + data.insert("WindowId", (uint)windowId); |
252 | 390 | + } | 277 | + } |
253 | 391 | + | 278 | + |
254 | 392 | + auth_session.process(data, mechanism, on_processed); | 279 | + auth_session.process(data, mechanism, on_processed); |
255 | @@ -394,7 +281,7 @@ | |||
256 | 394 | } | 281 | } |
257 | 395 | 282 | ||
258 | 396 | private void do_save_session_information() { | 283 | private void do_save_session_information() { |
260 | 397 | @@ -562,30 +701,6 @@ | 284 | @@ -562,30 +588,6 @@ |
261 | 398 | host.post_error(err); | 285 | host.post_error(err); |
262 | 399 | } | 286 | } |
263 | 400 | 287 | ||
264 | @@ -425,7 +312,7 @@ | |||
265 | 425 | private void on_session_authenticated() { | 312 | private void on_session_authenticated() { |
266 | 426 | if (!is_running()) | 313 | if (!is_running()) |
267 | 427 | return; | 314 | return; |
269 | 428 | @@ -773,14 +888,8 @@ | 315 | @@ -773,14 +775,8 @@ |
270 | 429 | get_persistent_uid(), get_persistent_user_name()); | 316 | get_persistent_uid(), get_persistent_user_name()); |
271 | 430 | on_session_authenticated(); | 317 | on_session_authenticated(); |
272 | 431 | } else { | 318 | } else { |
273 | @@ -442,13 +329,12 @@ | |||
274 | 442 | } | 329 | } |
275 | 443 | } | 330 | } |
276 | 444 | 331 | ||
278 | 445 | @@ -909,39 +1018,14 @@ | 332 | @@ -909,39 +905,14 @@ |
279 | 446 | return (access_token != null && uid != null && user_name != null); | 333 | return (access_token != null && uid != null && user_name != null); |
280 | 447 | } | 334 | } |
281 | 448 | 335 | ||
282 | 449 | - public void authenticate_with_parameters(string access_token, string uid, string user_name) { | 336 | - public void authenticate_with_parameters(string access_token, string uid, string user_name) { |
285 | 450 | + public void authenticate_with_parameters(string access_token, string? uid, string? user_name) { | 337 | - this.access_token = access_token; |
284 | 451 | this.access_token = access_token; | ||
286 | 452 | - this.uid = uid; | 338 | - this.uid = uid; |
287 | 453 | - this.user_name = user_name; | 339 | - this.user_name = user_name; |
288 | 454 | - } | 340 | - } |
289 | @@ -477,7 +363,8 @@ | |||
290 | 477 | - access_token = access_token.replace("#access_token=", ""); | 363 | - access_token = access_token.replace("#access_token=", ""); |
291 | 478 | - | 364 | - |
292 | 479 | - // we've got an access token! | 365 | - // we've got an access token! |
294 | 480 | - this.access_token = access_token; | 366 | + public void authenticate_with_parameters(string access_token, string? uid, string? user_name) { |
295 | 367 | this.access_token = access_token; | ||
296 | 481 | - | 368 | - |
297 | 482 | - do_user_id_fetch_transaction(); | 369 | - do_user_id_fetch_transaction(); |
298 | 483 | + if (uid == null) { | 370 | + if (uid == null) { |
299 | @@ -489,7 +376,7 @@ | |||
300 | 489 | } | 376 | } |
301 | 490 | 377 | ||
302 | 491 | public string get_endpoint_url() { | 378 | public string get_endpoint_url() { |
304 | 492 | @@ -1335,190 +1419,6 @@ | 379 | @@ -1335,190 +1306,6 @@ |
305 | 493 | } | 380 | } |
306 | 494 | } | 381 | } |
307 | 495 | 382 | ||
308 | @@ -682,8 +569,8 @@ | |||
309 | 682 | private Gtk.Box pane_widget = null; | 569 | private Gtk.Box pane_widget = null; |
310 | 683 | Index: shotwell-0.12.90/plugins/shotwell-publishing/FlickrPublishing.vala | 570 | Index: shotwell-0.12.90/plugins/shotwell-publishing/FlickrPublishing.vala |
311 | 684 | =================================================================== | 571 | =================================================================== |
314 | 685 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/FlickrPublishing.vala 2012-08-24 15:12:30.611994126 +1200 | 572 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/FlickrPublishing.vala 2012-08-24 00:03:04.000000000 +0300 |
315 | 686 | +++ shotwell-0.12.90/plugins/shotwell-publishing/FlickrPublishing.vala 2012-08-24 15:15:23.971988123 +1200 | 573 | +++ shotwell-0.12.90/plugins/shotwell-publishing/FlickrPublishing.vala 2012-08-28 11:11:16.866844467 +0300 |
316 | 687 | @@ -4,6 +4,8 @@ | 574 | @@ -4,6 +4,8 @@ |
317 | 688 | * (version 2.1 or later). See the COPYING file in this distribution. | 575 | * (version 2.1 or later). See the COPYING file in this distribution. |
318 | 689 | */ | 576 | */ |
319 | @@ -748,8 +635,8 @@ | |||
320 | 748 | + data = account.get_session_parameters(out mechanism); | 635 | + data = account.get_session_parameters(out mechanism); |
321 | 749 | + debug("Got account data"); | 636 | + debug("Got account data"); |
322 | 750 | + } catch (GLib.Error e) { | 637 | + } catch (GLib.Error e) { |
325 | 751 | + debug("EVENT: couldn't create session for account: %s", | 638 | + warning("EVENT: couldn't create session for account: %s", |
326 | 752 | + e.message); | 639 | + e.message); |
327 | 753 | + } | 640 | + } |
328 | 754 | + } | 641 | + } |
329 | 755 | 642 | ||
330 | @@ -774,7 +661,7 @@ | |||
331 | 774 | - session.set_request_phase_credentials(token, token_secret); | 661 | - session.set_request_phase_credentials(token, token_secret); |
332 | 775 | + var windowId = host.get_dialog_xid(); | 662 | + var windowId = host.get_dialog_xid(); |
333 | 776 | + if (windowId != 0) { | 663 | + if (windowId != 0) { |
335 | 777 | + data.insert("WindowId", windowId); | 664 | + data.insert("WindowId", (uint)windowId); |
336 | 778 | + } | 665 | + } |
337 | 779 | 666 | ||
338 | 780 | - do_launch_system_browser(token); | 667 | - do_launch_system_browser(token); |
339 | @@ -1099,8 +986,8 @@ | |||
340 | 1099 | return access_phase_token; | 986 | return access_phase_token; |
341 | 1100 | Index: shotwell-0.12.90/plugins/shotwell-publishing/Makefile | 987 | Index: shotwell-0.12.90/plugins/shotwell-publishing/Makefile |
342 | 1101 | =================================================================== | 988 | =================================================================== |
345 | 1102 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/Makefile 2012-08-24 15:13:53.000000000 +1200 | 989 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/Makefile 2012-08-24 00:03:04.000000000 +0300 |
346 | 1103 | +++ shotwell-0.12.90/plugins/shotwell-publishing/Makefile 2012-08-24 15:15:23.971988123 +1200 | 990 | +++ shotwell-0.12.90/plugins/shotwell-publishing/Makefile 2012-08-28 10:25:15.300033478 +0300 |
347 | 1104 | @@ -18,6 +18,7 @@ | 991 | @@ -18,6 +18,7 @@ |
348 | 1105 | FlickrPublishing.vala \ | 992 | FlickrPublishing.vala \ |
349 | 1106 | YouTubePublishing.vala \ | 993 | YouTubePublishing.vala \ |
350 | @@ -1111,8 +998,8 @@ | |||
351 | 1111 | ../common/ui.vala | 998 | ../common/ui.vala |
352 | 1112 | Index: shotwell-0.12.90/plugins/shotwell-publishing/PicasaPublishing.vala | 999 | Index: shotwell-0.12.90/plugins/shotwell-publishing/PicasaPublishing.vala |
353 | 1113 | =================================================================== | 1000 | =================================================================== |
356 | 1114 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/PicasaPublishing.vala 2012-08-24 15:15:13.435988488 +1200 | 1001 | --- shotwell-0.12.90.orig/plugins/shotwell-publishing/PicasaPublishing.vala 2012-08-24 00:03:04.000000000 +0300 |
357 | 1115 | +++ shotwell-0.12.90/plugins/shotwell-publishing/PicasaPublishing.vala 2012-08-24 15:15:23.971988123 +1200 | 1002 | +++ shotwell-0.12.90/plugins/shotwell-publishing/PicasaPublishing.vala 2012-08-28 11:10:22.379612657 +0300 |
358 | 1116 | @@ -4,6 +4,8 @@ | 1003 | @@ -4,6 +4,8 @@ |
359 | 1117 | * (version 2.1 or later). See the COPYING file in this distribution. | 1004 | * (version 2.1 or later). See the COPYING file in this distribution. |
360 | 1118 | */ | 1005 | */ |
361 | @@ -1142,173 +1029,170 @@ | |||
362 | 1142 | 1029 | ||
363 | 1143 | public PicasaPublisher(Spit.Publishing.Service service, | 1030 | public PicasaPublisher(Spit.Publishing.Service service, |
364 | 1144 | Spit.Publishing.PluginHost host) { | 1031 | Spit.Publishing.PluginHost host) { |
366 | 1145 | @@ -123,6 +131,29 @@ | 1032 | @@ -83,18 +91,6 @@ |
367 | 1033 | media_type |= p.get_media_type(); | ||
368 | 1034 | } | ||
369 | 1035 | |||
370 | 1036 | - private string get_user_authorization_url() { | ||
371 | 1037 | - return "https://accounts.google.com/o/oauth2/auth?" + | ||
372 | 1038 | - "response_type=code&" + | ||
373 | 1039 | - "client_id=" + OAUTH_CLIENT_ID + "&" + | ||
374 | 1040 | - "redirect_uri=" + Soup.URI.encode("urn:ietf:wg:oauth:2.0:oob", null) + "&" + | ||
375 | 1041 | - "scope=" + Soup.URI.encode("http://picasaweb.google.com/data/", null) + "+" + | ||
376 | 1042 | - Soup.URI.encode("https://www.googleapis.com/auth/userinfo.profile", null) + "&" + | ||
377 | 1043 | - "state=connect&" + | ||
378 | 1044 | - "access_type=offline&" + | ||
379 | 1045 | - "approval_prompt=force"; | ||
380 | 1046 | - } | ||
381 | 1047 | - | ||
382 | 1048 | private Album[] extract_albums(Xml.Node* document_root) throws Spit.Publishing.PublishingError { | ||
383 | 1049 | Album[] result = new Album[0]; | ||
384 | 1050 | |||
385 | 1051 | @@ -133,14 +129,6 @@ | ||
386 | 1146 | return result; | 1052 | return result; |
387 | 1147 | } | 1053 | } |
388 | 1148 | 1054 | ||
446 | 1149 | + private string? extract_username(Xml.Node* document_root) throws Spit.Publishing.PublishingError { | 1055 | - internal string? get_persistent_refresh_token() { |
447 | 1150 | + Xml.Node* doc_node_iter = null; | 1056 | - return host.get_config_string("refresh_token", null); |
448 | 1151 | + if (document_root->name == "feed") | 1057 | - } |
449 | 1152 | + doc_node_iter = document_root->children; | 1058 | - |
450 | 1153 | + else | 1059 | - internal void set_persistent_refresh_token(string token) { |
451 | 1154 | + throw new Spit.Publishing.PublishingError.MALFORMED_RESPONSE("response root node " + | 1060 | - host.set_config_string("refresh_token", token); |
452 | 1155 | + "isn't a <feed>"); | 1061 | - } |
453 | 1156 | + | 1062 | - |
454 | 1157 | + for ( ; doc_node_iter != null; doc_node_iter = doc_node_iter->next) { | 1063 | internal bool get_persistent_strip_metadata() { |
455 | 1158 | + if (doc_node_iter->name != "author") | 1064 | return host.get_config_bool("strip_metadata", false); |
456 | 1159 | + continue; | 1065 | } |
457 | 1160 | + | 1066 | @@ -149,16 +137,6 @@ |
458 | 1161 | + Xml.Node* author_node_iter = doc_node_iter->children; | 1067 | host.set_config_bool("strip_metadata", strip_metadata); |
459 | 1162 | + for ( ; author_node_iter != null; author_node_iter = author_node_iter->next) { | 1068 | } |
460 | 1163 | + if (author_node_iter->name == "name") | 1069 | |
461 | 1164 | + return author_node_iter->get_content(); | 1070 | - internal void invalidate_persistent_session() { |
462 | 1165 | + } | 1071 | - debug("invalidating persisted Picasa Web Albums session."); |
463 | 1166 | + | 1072 | - |
464 | 1167 | + } | 1073 | - host.unset_config_key("refresh_token"); |
465 | 1168 | + | 1074 | - } |
466 | 1169 | + return null; | 1075 | - |
467 | 1170 | + } | 1076 | - internal bool is_persistent_session_available() { |
468 | 1171 | + | 1077 | - return get_persistent_refresh_token() != null; |
469 | 1172 | internal string? get_persistent_username() { | 1078 | - } |
470 | 1173 | return host.get_config_string("user_name", null); | 1079 | - |
471 | 1174 | } | 1080 | public bool is_running() { |
472 | 1175 | @@ -131,6 +162,10 @@ | 1081 | return running; |
473 | 1176 | return host.get_config_string("auth_token", null); | 1082 | } |
474 | 1177 | } | 1083 | @@ -173,92 +151,69 @@ |
418 | 1178 | |||
419 | 1179 | + internal string? get_persistent_auth_method() { | ||
420 | 1180 | + return host.get_config_string("auth_method", null); | ||
421 | 1181 | + } | ||
422 | 1182 | + | ||
423 | 1183 | internal void set_persistent_username(string username) { | ||
424 | 1184 | host.set_config_string("user_name", username); | ||
425 | 1185 | } | ||
426 | 1186 | @@ -139,11 +174,16 @@ | ||
427 | 1187 | host.set_config_string("auth_token", auth_token); | ||
428 | 1188 | } | ||
429 | 1189 | |||
430 | 1190 | + internal void set_persistent_auth_method(string auth_method) { | ||
431 | 1191 | + host.set_config_string("auth_method", auth_method); | ||
432 | 1192 | + } | ||
433 | 1193 | + | ||
434 | 1194 | internal void invalidate_persistent_session() { | ||
435 | 1195 | debug("invalidating persisted Picasa Web Albums session."); | ||
436 | 1196 | |||
437 | 1197 | - host.unset_config_key("user_name"); | ||
438 | 1198 | - host.unset_config_key("auth_token"); | ||
439 | 1199 | + set_persistent_username(""); | ||
440 | 1200 | + set_persistent_auth_token(""); | ||
441 | 1201 | + set_persistent_auth_method(""); | ||
442 | 1202 | } | ||
443 | 1203 | |||
444 | 1204 | internal bool is_persistent_session_available() { | ||
445 | 1205 | @@ -164,76 +204,89 @@ | ||
475 | 1206 | 1084 | ||
476 | 1207 | debug("EVENT: user clicked 'Login' in welcome pane."); | 1085 | debug("EVENT: user clicked 'Login' in welcome pane."); |
477 | 1208 | 1086 | ||
517 | 1209 | - do_show_credentials_pane(CredentialsPane.Mode.INTRO); | 1087 | - do_launch_browser_for_authorization(); |
479 | 1210 | - } | ||
480 | 1211 | - | ||
481 | 1212 | - private void on_credentials_go_back() { | ||
482 | 1213 | - if (!is_running()) | ||
483 | 1214 | - return; | ||
484 | 1215 | - | ||
485 | 1216 | - debug("EVENT: user clicked 'Go Back' in credentials pane."); | ||
486 | 1217 | - | ||
487 | 1218 | - do_show_service_welcome_pane(); | ||
488 | 1219 | - } | ||
489 | 1220 | - | ||
490 | 1221 | - private void on_credentials_login(string username, string password) { | ||
491 | 1222 | - if (!is_running()) | ||
492 | 1223 | - return; | ||
493 | 1224 | - | ||
494 | 1225 | - debug("EVENT: user clicked 'Login' in credentials pane."); | ||
495 | 1226 | - | ||
496 | 1227 | - this.username = username; | ||
497 | 1228 | - | ||
498 | 1229 | - do_network_login(username, password); | ||
499 | 1230 | - } | ||
500 | 1231 | - | ||
501 | 1232 | - private void on_token_fetch_complete(Publishing.RESTSupport.Transaction txn) { | ||
502 | 1233 | - txn.completed.disconnect(on_token_fetch_complete); | ||
503 | 1234 | - txn.network_error.disconnect(on_token_fetch_error); | ||
504 | 1235 | - | ||
505 | 1236 | - if (!is_running()) | ||
506 | 1237 | - return; | ||
507 | 1238 | - | ||
508 | 1239 | - if (session.is_authenticated()) // ignore these events if the session is already auth'd | ||
509 | 1240 | - return; | ||
510 | 1241 | - | ||
511 | 1242 | - debug("EVENT: network transaction to fetch token for login completed successfully."); | ||
512 | 1243 | - | ||
513 | 1244 | - int index = txn.get_response().index_of("Auth="); | ||
514 | 1245 | - string auth_substring = (index >= 0) ? txn.get_response()[index:txn.get_response().length] : ""; | ||
515 | 1246 | - auth_substring = auth_substring.chomp(); | ||
516 | 1247 | - string auth_token = auth_substring.substring(5); | ||
518 | 1248 | + do_hosted_web_authentication(); | 1088 | + do_hosted_web_authentication(); |
521 | 1249 | + } | 1089 | } |
522 | 1250 | + | 1090 | |
523 | 1091 | - private void on_auth_code_entry_pane_proceed(AuthCodeEntryPane sender, string code) { | ||
524 | 1092 | - debug("EVENT: user clicked 'Continue' in authorization code entry pane."); | ||
525 | 1093 | - | ||
526 | 1094 | - sender.proceed.disconnect(on_auth_code_entry_pane_proceed); | ||
527 | 1095 | - | ||
528 | 1096 | - do_get_access_tokens(code); | ||
529 | 1097 | - } | ||
530 | 1098 | - | ||
531 | 1099 | - private void on_browser_launched() { | ||
532 | 1100 | - debug("EVENT: system web browser launched to solicit user authorization."); | ||
533 | 1101 | - | ||
534 | 1102 | - do_show_auth_code_entry_pane(); | ||
535 | 1103 | - } | ||
536 | 1104 | - | ||
537 | 1105 | - private void on_get_access_tokens_completed(Publishing.RESTSupport.Transaction txn) { | ||
538 | 1106 | - txn.completed.disconnect(on_get_access_tokens_completed); | ||
539 | 1107 | - txn.network_error.disconnect(on_get_access_tokens_error); | ||
540 | 1251 | + public void on_processed(Signon.AuthSession self, owned HashTable<string,Value?>? session_data, GLib.Error error){ | 1108 | + public void on_processed(Signon.AuthSession self, owned HashTable<string,Value?>? session_data, GLib.Error error){ |
541 | 1252 | + if (error != null) { | 1109 | + if (error != null) { |
542 | 1253 | + debug("got error: %s", error.message); | 1110 | + debug("got error: %s", error.message); |
543 | 1254 | + /* TODO: handle errors */ | 1111 | + /* TODO: handle errors */ |
544 | 1255 | + return; | 1112 | + return; |
545 | 1256 | + } | 1113 | + } |
547 | 1257 | + | 1114 | |
548 | 1115 | - debug("EVENT: network transaction to exchange authorization code for access tokens " + | ||
549 | 1116 | - "completed successfully."); | ||
550 | 1258 | + host.set_service_locked(true); | 1117 | + host.set_service_locked(true); |
551 | 1259 | + host.install_account_fetch_wait_pane(); | 1118 | + host.install_account_fetch_wait_pane(); |
552 | 1260 | 1119 | ||
556 | 1261 | session.authenticated.connect(on_session_authenticated); | 1120 | - do_extract_tokens(txn.get_response()); |
557 | 1262 | - session.authenticate(auth_token, username); | 1121 | - } |
558 | 1263 | + | 1122 | - |
559 | 1123 | - private void on_get_access_tokens_error(Publishing.RESTSupport.Transaction txn, | ||
560 | 1124 | - Spit.Publishing.PublishingError err) { | ||
561 | 1125 | - txn.completed.disconnect(on_get_access_tokens_completed); | ||
562 | 1126 | - txn.network_error.disconnect(on_get_access_tokens_error); | ||
563 | 1127 | + session.authenticated.connect(on_session_authenticated); | ||
564 | 1128 | |||
565 | 1129 | - debug("EVENT: network transaction to exchange authorization code for access tokens " + | ||
566 | 1130 | - "failed; response = '%s'", txn.get_response()); | ||
567 | 1131 | - } | ||
568 | 1132 | - | ||
569 | 1133 | - private void on_refresh_token_available(string token) { | ||
570 | 1134 | - debug("EVENT: an OAuth refresh token has become available."); | ||
571 | 1135 | - | ||
572 | 1136 | - do_save_refresh_token_to_configuration_system(token); | ||
573 | 1137 | - } | ||
574 | 1138 | - | ||
575 | 1139 | - private void on_access_token_available(string token) { | ||
576 | 1140 | - debug("EVENT: an OAuth access token has become available."); | ||
577 | 1141 | - | ||
578 | 1142 | - do_authenticate_session(token); | ||
579 | 1143 | - } | ||
580 | 1144 | - | ||
581 | 1145 | - private void on_not_set_up_pane_proceed(NotSetUpMessagePane sender) { | ||
582 | 1146 | - debug("EVENT: user clicked 'Continue' in Account Not Set Up Message Pane."); | ||
583 | 1147 | - | ||
584 | 1148 | - sender.proceed.disconnect(on_not_set_up_pane_proceed); | ||
585 | 1149 | - | ||
586 | 1150 | - do_launch_browser_for_authorization(); | ||
587 | 1264 | + if (session_data.lookup("AccessToken") != null) { | 1151 | + if (session_data.lookup("AccessToken") != null) { |
588 | 1265 | + string token = session_data.lookup("AccessToken").get_string(); | 1152 | + string token = session_data.lookup("AccessToken").get_string(); |
589 | 1266 | + debug("OAuth Access Token: %s", token); | 1153 | + debug("OAuth Access Token: %s", token); |
591 | 1267 | + session.authenticate(token, null, "OAuth2"); | 1154 | + session.authenticate(token, "OAuth2"); |
592 | 1268 | + } else if (session_data.lookup("AuthToken") != null) { | 1155 | + } else if (session_data.lookup("AuthToken") != null) { |
593 | 1269 | + string token = session_data.lookup("AuthToken").get_string(); | 1156 | + string token = session_data.lookup("AuthToken").get_string(); |
594 | 1270 | + debug("ClientLogin Access Token: %s", token); | 1157 | + debug("ClientLogin Access Token: %s", token); |
596 | 1271 | + session.authenticate(token, null, "ClientLogin"); | 1158 | + session.authenticate(token, "ClientLogin"); |
597 | 1272 | + } else { | 1159 | + } else { |
598 | 1273 | + debug("Access token not present!"); | 1160 | + debug("Access token not present!"); |
599 | 1274 | + } | 1161 | + } |
600 | 1275 | } | 1162 | } |
601 | 1163 | - | ||
602 | 1164 | - private void on_refresh_access_token_transaction_completed(Publishing.RESTSupport.Transaction | ||
603 | 1165 | - txn) { | ||
604 | 1166 | - txn.completed.disconnect(on_refresh_access_token_transaction_completed); | ||
605 | 1167 | - txn.network_error.disconnect(on_refresh_access_token_transaction_error); | ||
606 | 1168 | - | ||
607 | 1169 | - if (!is_running()) | ||
608 | 1170 | - return; | ||
609 | 1276 | 1171 | ||
610 | 1277 | - private void on_token_fetch_error(Publishing.RESTSupport.Transaction bad_txn, | ||
611 | 1278 | - Spit.Publishing.PublishingError err) { | ||
612 | 1279 | - bad_txn.completed.disconnect(on_token_fetch_complete); | ||
613 | 1280 | - bad_txn.network_error.disconnect(on_token_fetch_error); | ||
614 | 1281 | - | ||
615 | 1282 | - if (!is_running()) | ||
616 | 1283 | - return; | ||
617 | 1284 | - | ||
618 | 1285 | - if (session.is_authenticated()) // ignore these events if the session is already auth'd | 1172 | - if (session.is_authenticated()) // ignore these events if the session is already auth'd |
619 | 1286 | - return; | 1173 | - return; |
620 | 1287 | - | ||
621 | 1288 | - debug("EVENT: network transaction to fetch token for login failed; response = '%s'.", | ||
622 | 1289 | - bad_txn.get_response()); | ||
623 | 1290 | - | ||
624 | 1291 | - // HTTP error 403 is invalid authentication -- if we get this error during token fetch | ||
625 | 1292 | - // then we can just show the login screen again with a retry message; if we get any error | ||
626 | 1293 | - // other than 403 though, we can't recover from it, so just post the error to the user | ||
627 | 1294 | - if (bad_txn.get_status_code() == 403) { | ||
628 | 1295 | - if (bad_txn.get_response().contains("CaptchaRequired")) | ||
629 | 1296 | - do_show_credentials_pane(CredentialsPane.Mode.ADDITIONAL_SECURITY); | ||
630 | 1297 | - else | ||
631 | 1298 | - do_show_credentials_pane(CredentialsPane.Mode.FAILED_RETRY); | ||
632 | 1299 | - } | ||
633 | 1300 | - else { | ||
634 | 1301 | - host.post_error(err); | ||
635 | 1302 | - } | ||
636 | 1303 | + private void do_hosted_web_authentication() { | 1174 | + private void do_hosted_web_authentication() { |
637 | 1304 | + debug("ACTION: doing hosted web authentication."); | 1175 | + debug("ACTION: doing hosted web authentication."); |
639 | 1305 | + | 1176 | |
640 | 1177 | - debug("EVENT: refresh access token transaction completed successfully."); | ||
641 | 1178 | - | ||
642 | 1179 | - do_extract_tokens(txn.get_response()); | ||
643 | 1180 | - } | ||
644 | 1181 | - | ||
645 | 1182 | - private void on_refresh_access_token_transaction_error(Publishing.RESTSupport.Transaction txn, | ||
646 | 1183 | - Spit.Publishing.PublishingError err) { | ||
647 | 1184 | - txn.completed.disconnect(on_refresh_access_token_transaction_completed); | ||
648 | 1185 | - txn.network_error.disconnect(on_refresh_access_token_transaction_error); | ||
649 | 1186 | - | ||
650 | 1187 | - if (!is_running()) | ||
651 | 1188 | - return; | ||
652 | 1306 | + HashTable<string,Value?> data = null; | 1189 | + HashTable<string,Value?> data = null; |
653 | 1307 | + string mechanism = "user_agent"; | 1190 | + string mechanism = "user_agent"; |
654 | 1308 | + | 1191 | + |
655 | 1309 | + SharingAccounts accounts = | 1192 | + SharingAccounts accounts = |
656 | 1310 | + new SharingAccounts(); | 1193 | + new SharingAccounts(); |
658 | 1311 | + | 1194 | |
659 | 1195 | - if (session.is_authenticated()) // ignore these events if the session is already auth'd | ||
660 | 1312 | + SharingAccount? account = accounts.get_account_for_provider("google"); | 1196 | + SharingAccount? account = accounts.get_account_for_provider("google"); |
661 | 1313 | + if (account != null) { | 1197 | + if (account != null) { |
662 | 1314 | + try { | 1198 | + try { |
663 | @@ -1316,41 +1200,24 @@ | |||
664 | 1316 | + data = account.get_session_parameters(out mechanism); | 1200 | + data = account.get_session_parameters(out mechanism); |
665 | 1317 | + debug("Got account data"); | 1201 | + debug("Got account data"); |
666 | 1318 | + } catch (GLib.Error e) { | 1202 | + } catch (GLib.Error e) { |
679 | 1319 | + debug("EVENT: couldn't create session for account: %s", | 1203 | + warning("EVENT: couldn't create session for account: %s", |
680 | 1320 | + e.message); | 1204 | + e.message); |
669 | 1321 | + } | ||
670 | 1322 | + } | ||
671 | 1323 | + | ||
672 | 1324 | + if (auth_session == null) { | ||
673 | 1325 | + debug("Creating unbound session"); | ||
674 | 1326 | + try { | ||
675 | 1327 | + auth_session = new Signon.AuthSession(0, "oauth2"); | ||
676 | 1328 | + } catch (GLib.Error e) { | ||
677 | 1329 | + debug("EVENT: AuthSession creation failed: %s", e.message); | ||
678 | 1330 | + return; | ||
681 | 1331 | + } | 1205 | + } |
682 | 1332 | + } | 1206 | + } |
683 | 1333 | + | 1207 | + |
684 | 1334 | + if (data == null) { | 1208 | + if (data == null) { |
699 | 1335 | + debug("Using own params"); | 1209 | + warning ("No account authentication data"); |
700 | 1336 | + data = new HashTable<string,Value?>(str_hash, str_equal); | 1210 | + host.post_error(new Spit.Publishing.PublishingError.SERVICE_ERROR( |
701 | 1337 | + data.insert("Host", "accounts.google.com"); | 1211 | + "Error while accessing the account")); |
702 | 1338 | + data.insert("AuthPath", "o/oauth2/auth"); | 1212 | return; |
689 | 1339 | + data.insert("ClientId", "1041829795610-htf69c529db58qcq8jvf58bijn1ie3oi.apps.googleusercontent.com"); | ||
690 | 1340 | + data.insert("RedirectUri", "http://www.mardy.it/oauth2callback"); | ||
691 | 1341 | + string[] scopes = { | ||
692 | 1342 | + "https://picasaweb.google.com/data/" | ||
693 | 1343 | + }; | ||
694 | 1344 | + data.insert("Scope", scopes); | ||
695 | 1345 | + string[] response_type = { | ||
696 | 1346 | + "token" | ||
697 | 1347 | + }; | ||
698 | 1348 | + data.insert("ResponseType", response_type); | ||
703 | 1349 | + } | 1213 | + } |
705 | 1350 | + | 1214 | |
706 | 1215 | - debug("EVENT: refresh access token transaction caused a network error."); | ||
707 | 1216 | - | ||
708 | 1217 | - host.post_error(err); | ||
709 | 1351 | + var windowId = host.get_dialog_xid(); | 1218 | + var windowId = host.get_dialog_xid(); |
710 | 1352 | + if (windowId != 0) { | 1219 | + if (windowId != 0) { |
712 | 1353 | + data.insert("WindowId", windowId); | 1220 | + data.insert("WindowId", (uint)windowId); |
713 | 1354 | + } | 1221 | + } |
714 | 1355 | + | 1222 | + |
715 | 1356 | + auth_session.process(data, mechanism, on_processed); | 1223 | + auth_session.process(data, mechanism, on_processed); |
716 | @@ -1358,7 +1225,7 @@ | |||
717 | 1358 | } | 1225 | } |
718 | 1359 | 1226 | ||
719 | 1360 | private void on_session_authenticated() { | 1227 | private void on_session_authenticated() { |
721 | 1361 | @@ -271,25 +324,7 @@ | 1228 | @@ -313,19 +268,7 @@ |
722 | 1362 | debug("EVENT: fetching account and album information failed; response = '%s'.", | 1229 | debug("EVENT: fetching account and album information failed; response = '%s'.", |
723 | 1363 | bad_txn.get_response()); | 1230 | bad_txn.get_response()); |
724 | 1364 | 1231 | ||
725 | @@ -1366,161 +1233,286 @@ | |||
726 | 1366 | - // if we get a 404 error (resource not found) on the initial album fetch, then the | 1233 | - // if we get a 404 error (resource not found) on the initial album fetch, then the |
727 | 1367 | - // user's album feed doesn't exist -- this occurs when the user has a valid Google | 1234 | - // user's album feed doesn't exist -- this occurs when the user has a valid Google |
728 | 1368 | - // account but it hasn't yet been set up for use with Picasa. In this case, we | 1235 | - // account but it hasn't yet been set up for use with Picasa. In this case, we |
741 | 1369 | - // re-display the credentials capture pane with an "account not set up" message. | 1236 | - // display an informational pane with an "account not set up" message. In addition, we |
742 | 1370 | - // In addition, we deauthenticate the session. Deauth is neccessary because we | 1237 | - // deauthenticate the session. Deauth is neccessary because must've previously auth'd |
743 | 1371 | - // did previously auth the user's account. If we get any other kind of error, we can't | 1238 | - // the user's account to even be able to query the album feed. |
744 | 1372 | - // recover, so just post it to the user | 1239 | - session.deauthenticate(); |
745 | 1373 | - session.deauthenticate(); | 1240 | - do_show_not_set_up_pane(); |
734 | 1374 | - do_show_credentials_pane(CredentialsPane.Mode.NOT_SET_UP); | ||
735 | 1375 | - } else if (bad_txn.get_status_code() == 403) { | ||
736 | 1376 | - // if we get a 403 error (authentication failed) then we need to return to the login | ||
737 | 1377 | - // screen because the user's auth token is no longer valid and he or she needs to | ||
738 | 1378 | - // login again to obtain a new one | ||
739 | 1379 | - session.deauthenticate(); | ||
740 | 1380 | - do_show_credentials_pane(CredentialsPane.Mode.INTRO); | ||
746 | 1381 | - } else { | 1241 | - } else { |
747 | 1242 | - // If we get any other kind of error, we can't recover, so just post it to the user | ||
748 | 1382 | - host.post_error(err); | 1243 | - host.post_error(err); |
749 | 1383 | - } | 1244 | - } |
750 | 1384 | + host.post_error(err); | 1245 | + host.post_error(err); |
751 | 1385 | } | 1246 | } |
752 | 1386 | 1247 | ||
753 | 1387 | private void on_publishing_options_logout() { | 1248 | private void on_publishing_options_logout() { |
755 | 1388 | @@ -414,34 +449,6 @@ | 1249 | @@ -335,7 +278,6 @@ |
756 | 1250 | debug("EVENT: user clicked 'Logout' in the publishing options pane."); | ||
757 | 1251 | |||
758 | 1252 | session.deauthenticate(); | ||
759 | 1253 | - invalidate_persistent_session(); | ||
760 | 1254 | |||
761 | 1255 | do_show_service_welcome_pane(); | ||
762 | 1256 | } | ||
763 | 1257 | @@ -453,94 +395,6 @@ | ||
764 | 1389 | host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_service_welcome_login); | 1258 | host.install_welcome_pane(SERVICE_WELCOME_MESSAGE, on_service_welcome_login); |
765 | 1390 | } | 1259 | } |
766 | 1391 | 1260 | ||
779 | 1392 | - private void do_show_credentials_pane(CredentialsPane.Mode mode) { | 1261 | - private void do_launch_browser_for_authorization() { |
780 | 1393 | - debug("ACTION: showing credentials capture pane in %s mode.", mode.to_string()); | 1262 | - string auth_url = get_user_authorization_url(); |
781 | 1394 | - | 1263 | - |
782 | 1395 | - CredentialsPane creds_pane = new CredentialsPane(host, mode); | 1264 | - debug("ACTION: launching external web browser to get user authorization; " + |
783 | 1396 | - creds_pane.go_back.connect(on_credentials_go_back); | 1265 | - "authorization URL = '%s'", auth_url); |
784 | 1397 | - creds_pane.login.connect(on_credentials_login); | 1266 | - |
785 | 1398 | - | 1267 | - try { |
786 | 1399 | - host.install_dialog_pane(creds_pane); | 1268 | - Process.spawn_command_line_async("xdg-open " + auth_url); |
787 | 1400 | - } | 1269 | - } catch (SpawnError e) { |
788 | 1401 | - | 1270 | - host.post_error(new Spit.Publishing.PublishingError.LOCAL_FILE_ERROR( |
789 | 1402 | - private void do_network_login(string username, string password) { | 1271 | - _("couldn't launch system web browser to complete Picasa Web Albums login"))); |
790 | 1403 | - debug("ACTION: running network login transaction for user = '%s'.", username); | 1272 | - return; |
791 | 1273 | - } | ||
792 | 1274 | - | ||
793 | 1275 | - on_browser_launched(); | ||
794 | 1276 | - } | ||
795 | 1277 | - | ||
796 | 1278 | - private void do_show_auth_code_entry_pane() { | ||
797 | 1279 | - debug("ACTION: showing OAuth authorization code entry pane."); | ||
798 | 1280 | - | ||
799 | 1281 | - Gtk.Builder builder = new Gtk.Builder(); | ||
800 | 1282 | - | ||
801 | 1283 | - try { | ||
802 | 1284 | - builder.add_from_file(host.get_module_file().get_parent().get_child( | ||
803 | 1285 | - "picasa_auth_code_entry_pane.glade").get_path()); | ||
804 | 1286 | - } catch (Error e) { | ||
805 | 1287 | - warning("Could not parse UI file! Error: %s.", e.message); | ||
806 | 1288 | - host.post_error( | ||
807 | 1289 | - new Spit.Publishing.PublishingError.LOCAL_FILE_ERROR( | ||
808 | 1290 | - _("A file required for publishing is unavailable. Publishing to Picasa Web Albums can't continue."))); | ||
809 | 1291 | - return; | ||
810 | 1292 | - } | ||
811 | 1293 | - | ||
812 | 1294 | - AuthCodeEntryPane pane = new AuthCodeEntryPane(builder); | ||
813 | 1295 | - pane.proceed.connect(on_auth_code_entry_pane_proceed); | ||
814 | 1296 | - host.install_dialog_pane(pane); | ||
815 | 1297 | - } | ||
816 | 1298 | - | ||
817 | 1299 | - private void do_get_access_tokens(string code) { | ||
818 | 1300 | - debug("ACTION: exchanging OAuth authorization code '%s' for access token.", code); | ||
819 | 1301 | - | ||
820 | 1302 | - GetAccessTokensTransaction txn = new GetAccessTokensTransaction(session, code); | ||
821 | 1303 | - txn.completed.connect(on_get_access_tokens_completed); | ||
822 | 1304 | - txn.network_error.connect(on_get_access_tokens_error); | ||
823 | 1305 | - | ||
824 | 1306 | - try { | ||
825 | 1307 | - txn.execute(); | ||
826 | 1308 | - } catch (Spit.Publishing.PublishingError err) { | ||
827 | 1309 | - host.post_error(err); | ||
828 | 1310 | - } | ||
829 | 1311 | - } | ||
830 | 1312 | - | ||
831 | 1313 | - private void do_extract_tokens(string response_body) { | ||
832 | 1314 | - debug("ACTION: extracting OAuth tokens from body of server response"); | ||
833 | 1315 | - | ||
834 | 1316 | - Json.Parser parser = new Json.Parser(); | ||
835 | 1317 | - | ||
836 | 1318 | - try { | ||
837 | 1319 | - parser.load_from_data(response_body); | ||
838 | 1320 | - } catch (Error err) { | ||
839 | 1321 | - host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( | ||
840 | 1322 | - "Couldn't parse JSON response: " + err.message)); | ||
841 | 1323 | - return; | ||
842 | 1324 | - } | ||
843 | 1325 | - | ||
844 | 1326 | - Json.Object response_obj = parser.get_root().get_object(); | ||
845 | 1327 | - | ||
846 | 1328 | - if ((!response_obj.has_member("access_token")) && (!response_obj.has_member("refresh_token"))) { | ||
847 | 1329 | - host.post_error(new Spit.Publishing.PublishingError.MALFORMED_RESPONSE( | ||
848 | 1330 | - "neither access_token nor refresh_token not present in server response")); | ||
849 | 1331 | - return; | ||
850 | 1332 | - } | ||
851 | 1333 | - | ||
852 | 1334 | - if (response_obj.has_member("refresh_token")) { | ||
853 | 1335 | - string refresh_token = response_obj.get_string_member("refresh_token"); | ||
854 | 1336 | - | ||
855 | 1337 | - if (refresh_token != "") | ||
856 | 1338 | - on_refresh_token_available(refresh_token); | ||
857 | 1339 | - } | ||
858 | 1340 | - | ||
859 | 1341 | - if (response_obj.has_member("access_token")) { | ||
860 | 1342 | - string access_token = response_obj.get_string_member("access_token"); | ||
861 | 1343 | - | ||
862 | 1344 | - if (access_token != "") | ||
863 | 1345 | - on_access_token_available(access_token); | ||
864 | 1346 | - } | ||
865 | 1347 | - } | ||
866 | 1348 | - | ||
867 | 1349 | private void do_extract_username(string response_body) { | ||
868 | 1350 | debug("ACTION: extracting username from body of server response"); | ||
869 | 1351 | |||
870 | 1352 | @@ -562,66 +416,8 @@ | ||
871 | 1353 | if (username != "") | ||
872 | 1354 | this.username = username; | ||
873 | 1355 | } | ||
874 | 1356 | - | ||
875 | 1357 | - if (response_obj.has_member("access_token")) { | ||
876 | 1358 | - string access_token = response_obj.get_string_member("access_token"); | ||
877 | 1359 | - | ||
878 | 1360 | - if (access_token != "") | ||
879 | 1361 | - on_access_token_available(access_token); | ||
880 | 1362 | - } | ||
881 | 1363 | } | ||
882 | 1364 | |||
883 | 1365 | - private void do_save_refresh_token_to_configuration_system(string token) { | ||
884 | 1366 | - debug("ACTION: saving OAuth refresh token to configuration system"); | ||
885 | 1367 | - | ||
886 | 1368 | - set_persistent_refresh_token(token); | ||
887 | 1369 | - } | ||
888 | 1370 | - | ||
889 | 1371 | - private void do_refresh_session(string refresh_token) { | ||
890 | 1372 | - debug("ACTION: using OAuth refresh token to refresh session."); | ||
891 | 1404 | - | 1373 | - |
892 | 1405 | - host.install_login_wait_pane(); | 1374 | - host.install_login_wait_pane(); |
898 | 1406 | - | 1375 | - |
899 | 1407 | - TokenFetchTransaction fetch_trans = new TokenFetchTransaction(session, username, password); | 1376 | - RefreshAccessTokenTransaction txn = new RefreshAccessTokenTransaction(session, refresh_token); |
900 | 1408 | - fetch_trans.network_error.connect(on_token_fetch_error); | 1377 | - |
901 | 1409 | - fetch_trans.completed.connect(on_token_fetch_complete); | 1378 | - txn.completed.connect(on_refresh_access_token_transaction_completed); |
902 | 1410 | - | 1379 | - txn.network_error.connect(on_refresh_access_token_transaction_error); |
903 | 1380 | - | ||
904 | 1411 | - try { | 1381 | - try { |
906 | 1412 | - fetch_trans.execute(); | 1382 | - txn.execute(); |
907 | 1413 | - } catch (Spit.Publishing.PublishingError err) { | 1383 | - } catch (Spit.Publishing.PublishingError err) { |
922 | 1414 | - // 403 errors are recoverable, so don't post the error to our host immediately; | 1384 | - host.post_error(err); |
923 | 1415 | - // instead, try to recover from it | 1385 | - } |
924 | 1416 | - on_token_fetch_error(fetch_trans, err); | 1386 | - } |
925 | 1417 | - } | 1387 | - |
926 | 1418 | - } | 1388 | - private void do_authenticate_session(string token) { |
927 | 1419 | - | 1389 | - debug("ACTION: authenticating session."); |
928 | 1420 | private void do_save_auth_info() { | 1390 | - |
929 | 1421 | debug("ACTION: saving authentication information to configuration system."); | 1391 | - session.authenticated.connect(on_session_authenticated); |
930 | 1422 | 1392 | - session.authenticate(token); | |
931 | 1423 | @@ -449,6 +456,7 @@ | 1393 | - } |
932 | 1424 | 1394 | - | |
933 | 1425 | set_persistent_auth_token(session.get_auth_token()); | 1395 | - private void do_show_not_set_up_pane() { |
934 | 1426 | set_persistent_username(session.get_username()); | 1396 | - debug("ACTION: showing account not set up message pane"); |
935 | 1427 | + set_persistent_auth_method(session.get_auth_method()); | 1397 | - |
936 | 1398 | - Gtk.Builder builder = new Gtk.Builder(); | ||
937 | 1399 | - | ||
938 | 1400 | - try { | ||
939 | 1401 | - builder.add_from_file(host.get_module_file().get_parent().get_child( | ||
940 | 1402 | - "picasa_not_set_up_pane.glade").get_path()); | ||
941 | 1403 | - } catch (Error e) { | ||
942 | 1404 | - warning("Could not parse UI file! Error: %s.", e.message); | ||
943 | 1405 | - host.post_error( | ||
944 | 1406 | - new Spit.Publishing.PublishingError.LOCAL_FILE_ERROR( | ||
945 | 1407 | - _("A file required for publishing is unavailable. Publishing to Picasa Web Albums can't continue."))); | ||
946 | 1408 | - return; | ||
947 | 1409 | - } | ||
948 | 1410 | - | ||
949 | 1411 | - NotSetUpMessagePane pane = new NotSetUpMessagePane(builder); | ||
950 | 1412 | - pane.proceed.connect(on_not_set_up_pane_proceed); | ||
951 | 1413 | - host.install_dialog_pane(pane); | ||
952 | 1414 | - } | ||
953 | 1415 | - | ||
954 | 1416 | private void do_fetch_username() { | ||
955 | 1417 | debug("ACTION: running network transaction to fetch username."); | ||
956 | 1418 | |||
957 | 1419 | @@ -771,11 +567,7 @@ | ||
958 | 1420 | |||
959 | 1421 | running = true; | ||
960 | 1422 | |||
961 | 1423 | - if (is_persistent_session_available()) { | ||
962 | 1424 | - do_refresh_session(get_persistent_refresh_token()); | ||
963 | 1425 | - } else { | ||
964 | 1426 | - do_show_service_welcome_pane(); | ||
965 | 1427 | - } | ||
966 | 1428 | + do_show_service_welcome_pane(); | ||
967 | 1428 | } | 1429 | } |
968 | 1429 | 1430 | ||
990 | 1430 | private void do_fetch_account_information() { | 1431 | public void stop() { |
991 | 1431 | @@ -485,6 +493,8 @@ | 1432 | @@ -801,6 +593,7 @@ |
992 | 1432 | 1433 | ||
972 | 1433 | try { | ||
973 | 1434 | albums = extract_albums(response_doc.get_root_node()); | ||
974 | 1435 | + username = extract_username(response_doc.get_root_node()); | ||
975 | 1436 | + set_persistent_username(username); | ||
976 | 1437 | } catch (Spit.Publishing.PublishingError err) { | ||
977 | 1438 | host.post_error(err); | ||
978 | 1439 | return; | ||
979 | 1440 | @@ -567,7 +577,8 @@ | ||
980 | 1441 | |||
981 | 1442 | if (is_persistent_session_available()) { | ||
982 | 1443 | username = get_persistent_username(); | ||
983 | 1444 | - session.authenticate(get_persistent_auth_token(), get_persistent_username()); | ||
984 | 1445 | + session.authenticate(get_persistent_auth_token(), get_persistent_username(), | ||
985 | 1446 | + get_persistent_auth_method()); | ||
986 | 1447 | do_fetch_account_information(); | ||
987 | 1448 | } else { | ||
988 | 1449 | do_show_service_welcome_pane(); | ||
989 | 1450 | @@ -598,6 +609,7 @@ | ||
993 | 1451 | internal class Session : Publishing.RESTSupport.Session { | 1434 | internal class Session : Publishing.RESTSupport.Session { |
994 | 1452 | private string? auth_token = null; | 1435 | private string? auth_token = null; |
995 | 1453 | private string? username = null; | ||
996 | 1454 | + private string? auth_method = null; | 1436 | + private string? auth_method = null; |
997 | 1455 | 1437 | ||
998 | 1456 | public Session() { | 1438 | public Session() { |
999 | 1457 | } | 1439 | } |
1001 | 1458 | @@ -606,9 +618,10 @@ | 1440 | @@ -809,45 +602,24 @@ |
1002 | 1459 | return (auth_token != null); | 1441 | return (auth_token != null); |
1003 | 1460 | } | 1442 | } |
1004 | 1461 | 1443 | ||
1007 | 1462 | - public void authenticate(string auth_token, string username) { | 1444 | - public void authenticate(string auth_token) { |
1008 | 1463 | + public void authenticate(string auth_token, string? username, string auth_method) { | 1445 | + public void authenticate(string auth_token, string auth_method) { |
1009 | 1464 | this.auth_token = auth_token; | 1446 | this.auth_token = auth_token; |
1010 | 1465 | this.username = username; | ||
1011 | 1466 | + this.auth_method = auth_method; | 1447 | + this.auth_method = auth_method; |
1012 | 1467 | 1448 | ||
1013 | 1468 | notify_authenticated(); | 1449 | notify_authenticated(); |
1014 | 1469 | } | 1450 | } |
1016 | 1470 | @@ -616,6 +629,7 @@ | 1451 | |
1017 | 1471 | public void deauthenticate() { | 1452 | public void deauthenticate() { |
1018 | 1472 | auth_token = null; | 1453 | auth_token = null; |
1019 | 1473 | username = null; | ||
1020 | 1474 | + auth_method = null; | 1454 | + auth_method = null; |
1021 | 1475 | } | 1455 | } |
1025 | 1476 | 1456 | ||
1023 | 1477 | public string? get_username() { | ||
1024 | 1478 | @@ -625,19 +639,9 @@ | ||
1026 | 1479 | public string? get_auth_token() { | 1457 | public string? get_auth_token() { |
1027 | 1480 | return auth_token; | 1458 | return auth_token; |
1028 | 1481 | } | 1459 | } |
1029 | 1482 | -} | 1460 | -} |
1043 | 1483 | - | 1461 | |
1044 | 1484 | -internal class TokenFetchTransaction : Publishing.RESTSupport.Transaction { | 1462 | -internal class GetAccessTokensTransaction : Publishing.RESTSupport.Transaction { |
1045 | 1485 | - private const string ENDPOINT_URL = "https://www.google.com/accounts/ClientLogin"; | 1463 | - private const string ENDPOINT_URL = "https://accounts.google.com/o/oauth2/token"; |
1046 | 1486 | - | 1464 | - |
1047 | 1487 | - public TokenFetchTransaction(Session session, string username, string password) { | 1465 | - public GetAccessTokensTransaction(Session session, string auth_code) { |
1048 | 1488 | - base.with_endpoint_url(session, ENDPOINT_URL); | 1466 | - base.with_endpoint_url(session, ENDPOINT_URL); |
1049 | 1489 | - | 1467 | - |
1050 | 1490 | - add_argument("accountType", "HOSTED_OR_GOOGLE"); | 1468 | - add_argument("code", auth_code); |
1051 | 1491 | - add_argument("Email", username); | 1469 | - add_argument("client_id", OAUTH_CLIENT_ID); |
1052 | 1492 | - add_argument("Passwd", password); | 1470 | - add_argument("client_secret", OAUTH_CLIENT_SECRET); |
1053 | 1493 | - add_argument("service", "lh2"); | 1471 | - add_argument("redirect_uri", "urn:ietf:wg:oauth:2.0:oob"); |
1054 | 1494 | - add_argument("source", "yorba-shotwell-" + _VERSION); | 1472 | - add_argument("grant_type", "authorization_code"); |
1055 | 1495 | + | 1473 | - } |
1056 | 1474 | -} | ||
1057 | 1475 | - | ||
1058 | 1476 | -internal class RefreshAccessTokenTransaction : Publishing.RESTSupport.Transaction { | ||
1059 | 1477 | - private const string ENDPOINT_URL = "https://accounts.google.com/o/oauth2/token"; | ||
1060 | 1478 | - | ||
1061 | 1479 | - public RefreshAccessTokenTransaction(Session session, string refresh_token) { | ||
1062 | 1480 | - base.with_endpoint_url(session, ENDPOINT_URL); | ||
1063 | 1481 | - | ||
1064 | 1482 | - add_argument("client_id", OAUTH_CLIENT_ID); | ||
1065 | 1483 | - add_argument("client_secret", OAUTH_CLIENT_SECRET); | ||
1066 | 1484 | - add_argument("refresh_token", refresh_token); | ||
1067 | 1485 | - add_argument("grant_type", "refresh_token"); | ||
1068 | 1496 | + public string? get_auth_method() { | 1486 | + public string? get_auth_method() { |
1069 | 1497 | + return auth_method; | 1487 | + return auth_method; |
1070 | 1498 | } | 1488 | } |
1071 | 1499 | } | 1489 | } |
1072 | 1500 | 1490 | ||
1074 | 1501 | @@ -652,12 +656,19 @@ | 1491 | @@ -862,7 +634,13 @@ |
1075 | 1502 | base.with_endpoint_url(session, endpoint_url, method); | 1492 | base.with_endpoint_url(session, endpoint_url, method); |
1076 | 1503 | assert(session.is_authenticated()); | 1493 | assert(session.is_authenticated()); |
1077 | 1504 | 1494 | ||
1079 | 1505 | - add_header("Authorization", "GoogleLogin auth=%s".printf(session.get_auth_token())); | 1495 | - add_header("Authorization", "Bearer " + session.get_auth_token()); |
1080 | 1506 | + if (session.get_auth_method() == "ClientLogin") { | 1496 | + if (session.get_auth_method() == "ClientLogin") { |
1081 | 1507 | + add_header("Authorization", | 1497 | + add_header("Authorization", |
1083 | 1508 | + "GoogleLogin auth=%s".printf(session.get_auth_token())); | 1498 | + "GoogleLogin auth=" + session.get_auth_token()); |
1084 | 1509 | + } else { | 1499 | + } else { |
1085 | 1510 | + add_argument("access_token", session.get_auth_token()); | ||
1086 | 1511 | + add_header("Authorization", | 1500 | + add_header("Authorization", |
1088 | 1512 | + "Bearer %s".printf(session.get_auth_token())); | 1501 | + "Bearer " + session.get_auth_token()); |
1089 | 1513 | + } | 1502 | + } |
1090 | 1514 | } | 1503 | } |
1091 | 1515 | } | 1504 | } |
1092 | 1516 | 1505 | ||
1093 | 1506 | @@ -875,7 +653,7 @@ | ||
1094 | 1507 | } | ||
1095 | 1508 | |||
1096 | 1517 | internal class AlbumDirectoryTransaction : AuthenticatedTransaction { | 1509 | internal class AlbumDirectoryTransaction : AuthenticatedTransaction { |
1097 | 1518 | - private const string ENDPOINT_URL = "http://picasaweb.google.com/data/feed/api/user/" + | 1510 | - private const string ENDPOINT_URL = "http://picasaweb.google.com/data/feed/api/user/" + |
1098 | 1519 | + private const string ENDPOINT_URL = "https://picasaweb.google.com/data/feed/api/user/" + | 1511 | + private const string ENDPOINT_URL = "https://picasaweb.google.com/data/feed/api/user/" + |
1099 | 1520 | "default"; | 1512 | "default"; |
1100 | 1521 | 1513 | ||
1101 | 1522 | public AlbumDirectoryTransaction(Session session) { | 1514 | public AlbumDirectoryTransaction(Session session) { |
1103 | 1523 | @@ -674,7 +685,7 @@ | 1515 | @@ -892,7 +670,7 @@ |
1104 | 1524 | } | 1516 | } |
1105 | 1525 | 1517 | ||
1106 | 1526 | private class AlbumCreationTransaction : AuthenticatedTransaction { | 1518 | private class AlbumCreationTransaction : AuthenticatedTransaction { |
1107 | @@ -1529,227 +1521,123 @@ | |||
1108 | 1529 | "default"; | 1521 | "default"; |
1109 | 1530 | private const string ALBUM_ENTRY_TEMPLATE = "<?xml version='1.0' encoding='utf-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gphoto='http://schemas.google.com/photos/2007'><title type='text'>%s</title><gphoto:access>%s</gphoto:access><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/photos/2007#album'></category></entry>"; | 1522 | private const string ALBUM_ENTRY_TEMPLATE = "<?xml version='1.0' encoding='utf-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gphoto='http://schemas.google.com/photos/2007'><title type='text'>%s</title><gphoto:access>%s</gphoto:access><category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/photos/2007#album'></category></entry>"; |
1110 | 1531 | 1523 | ||
1112 | 1532 | @@ -747,8 +758,14 @@ | 1524 | @@ -971,9 +749,14 @@ |
1113 | 1533 | // that we've been building up | 1525 | // that we've been building up |
1114 | 1534 | Soup.Message outbound_message = | 1526 | Soup.Message outbound_message = |
1115 | 1535 | soup_form_request_new_from_multipart(get_endpoint_url(), message_parts); | 1527 | soup_form_request_new_from_multipart(get_endpoint_url(), message_parts); |
1117 | 1536 | - outbound_message.request_headers.append("Authorization", "GoogleLogin auth=%s".printf(session.get_auth_token())); | 1528 | - outbound_message.request_headers.append("Authorization", "Bearer " + |
1118 | 1529 | - session.get_auth_token()); | ||
1119 | 1537 | set_message(outbound_message); | 1530 | set_message(outbound_message); |
1120 | 1538 | + if (session.get_auth_method() == "ClientLogin") { | 1531 | + if (session.get_auth_method() == "ClientLogin") { |
1121 | 1539 | + add_header("Authorization", | 1532 | + add_header("Authorization", |
1123 | 1540 | + "GoogleLogin auth=%s".printf(session.get_auth_token())); | 1533 | + "GoogleLogin auth=" + session.get_auth_token()); |
1124 | 1541 | + } else { | 1534 | + } else { |
1125 | 1542 | + add_header("Authorization", | 1535 | + add_header("Authorization", |
1127 | 1543 | + "Bearer %s".printf(session.get_auth_token())); | 1536 | + "Bearer " + session.get_auth_token()); |
1128 | 1544 | + } | 1537 | + } |
1129 | 1545 | 1538 | ||
1130 | 1546 | // send the message and get its response | 1539 | // send the message and get its response |
1131 | 1547 | set_is_executed(true); | 1540 | set_is_executed(true); |
1133 | 1548 | @@ -756,199 +773,6 @@ | 1541 | @@ -981,95 +764,6 @@ |
1134 | 1549 | } | 1542 | } |
1135 | 1550 | } | 1543 | } |
1136 | 1551 | 1544 | ||
1180 | 1552 | -internal class CredentialsPane : Spit.Publishing.DialogPane, GLib.Object { | 1545 | -internal class AuthCodeEntryPane : Spit.Publishing.DialogPane, GLib.Object { |
1181 | 1553 | - public enum Mode { | 1546 | - private Gtk.Box pane_widget = null; |
1182 | 1554 | - INTRO, | 1547 | - private Gtk.Button continue_button = null; |
1183 | 1555 | - FAILED_RETRY, | 1548 | - private Gtk.Entry entry = null; |
1184 | 1556 | - NOT_SET_UP, | 1549 | - private Gtk.Label entry_caption = null; |
1185 | 1557 | - ADDITIONAL_SECURITY; | 1550 | - private Gtk.Label explanatory_text = null; |
1186 | 1558 | - | 1551 | - |
1187 | 1559 | - public string to_string() { | 1552 | - public signal void proceed(AuthCodeEntryPane sender, string authorization_code); |
1188 | 1560 | - switch (this) { | 1553 | - |
1189 | 1561 | - case Mode.INTRO: | 1554 | - public AuthCodeEntryPane(Gtk.Builder builder) { |
1190 | 1562 | - return "INTRO"; | 1555 | - assert(builder != null); |
1191 | 1563 | - | 1556 | - assert(builder.get_objects().length() > 0); |
1192 | 1564 | - case Mode.FAILED_RETRY: | 1557 | - |
1193 | 1565 | - return "FAILED_RETRY"; | 1558 | - explanatory_text = builder.get_object("explanatory_text") as Gtk.Label; |
1194 | 1566 | - | 1559 | - entry_caption = builder.get_object("entry_caption") as Gtk.Label; |
1195 | 1567 | - case Mode.NOT_SET_UP: | 1560 | - entry = builder.get_object("entry") as Gtk.Entry; |
1196 | 1568 | - return "NOT_SET_UP"; | 1561 | - continue_button = builder.get_object("continue_button") as Gtk.Button; |
1197 | 1569 | - | 1562 | - |
1198 | 1570 | - case Mode.ADDITIONAL_SECURITY: | 1563 | - pane_widget = builder.get_object("pane_widget") as Gtk.Box; |
1199 | 1571 | - return "ADDITIONAL_SECURITY"; | 1564 | - |
1200 | 1572 | - | 1565 | - pane_widget.show_all(); |
1201 | 1573 | - default: | 1566 | - |
1202 | 1574 | - error("unrecognized CredentialsPane.Mode enumeration value"); | 1567 | - on_entry_contents_changed(); |
1203 | 1575 | - } | 1568 | - } |
1204 | 1576 | - } | 1569 | - |
1205 | 1577 | - } | 1570 | - private void on_continue_clicked() { |
1206 | 1578 | - | 1571 | - proceed(this, entry.get_text()); |
1207 | 1579 | - private LegacyCredentialsPane wrapped = null; | 1572 | - } |
1208 | 1580 | - | 1573 | - |
1209 | 1581 | - public signal void go_back(); | 1574 | - private void on_entry_contents_changed() { |
1210 | 1582 | - public signal void login(string email, string password); | 1575 | - continue_button.set_sensitive(entry.text_length > 0); |
1168 | 1583 | - | ||
1169 | 1584 | - public CredentialsPane(Spit.Publishing.PluginHost host, Mode mode = Mode.INTRO, | ||
1170 | 1585 | - string? username = null) { | ||
1171 | 1586 | - wrapped = new LegacyCredentialsPane(host, mode, username); | ||
1172 | 1587 | - } | ||
1173 | 1588 | - | ||
1174 | 1589 | - protected void notify_go_back() { | ||
1175 | 1590 | - go_back(); | ||
1176 | 1591 | - } | ||
1177 | 1592 | - | ||
1178 | 1593 | - protected void notify_login(string email, string password) { | ||
1179 | 1594 | - login(email, password); | ||
1211 | 1595 | - } | 1576 | - } |
1212 | 1596 | - | 1577 | - |
1213 | 1597 | - public Gtk.Widget get_widget() { | 1578 | - public Gtk.Widget get_widget() { |
1215 | 1598 | - return wrapped; | 1579 | - return pane_widget; |
1216 | 1599 | - } | 1580 | - } |
1217 | 1600 | - | 1581 | - |
1218 | 1601 | - public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() { | 1582 | - public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() { |
1219 | 1602 | - return Spit.Publishing.DialogPane.GeometryOptions.NONE; | 1583 | - return Spit.Publishing.DialogPane.GeometryOptions.NONE; |
1220 | 1603 | - } | 1584 | - } |
1227 | 1604 | - | 1585 | - |
1228 | 1605 | - public void on_pane_installed() { | 1586 | - public void on_pane_installed() { |
1229 | 1606 | - wrapped.go_back.connect(notify_go_back); | 1587 | - continue_button.clicked.connect(on_continue_clicked); |
1230 | 1607 | - wrapped.login.connect(notify_login); | 1588 | - entry.changed.connect(on_entry_contents_changed); |
1225 | 1608 | - | ||
1226 | 1609 | - wrapped.installed(); | ||
1231 | 1610 | - } | 1589 | - } |
1233 | 1611 | - | 1590 | - |
1234 | 1612 | - public void on_pane_uninstalled() { | 1591 | - public void on_pane_uninstalled() { |
1237 | 1613 | - wrapped.go_back.disconnect(notify_go_back); | 1592 | - continue_button.clicked.disconnect(on_continue_clicked); |
1238 | 1614 | - wrapped.login.disconnect(notify_login); | 1593 | - entry.changed.disconnect(on_entry_contents_changed); |
1239 | 1615 | - } | 1594 | - } |
1240 | 1616 | -} | 1595 | -} |
1241 | 1617 | - | 1596 | - |
1366 | 1618 | -internal class LegacyCredentialsPane : Gtk.VBox { | 1597 | -internal class NotSetUpMessagePane : Spit.Publishing.DialogPane, GLib.Object { |
1367 | 1619 | - private const string INTRO_MESSAGE = _("Enter the email address and password associated with your Picasa Web Albums account."); | 1598 | - private Gtk.Box pane_widget = null; |
1368 | 1620 | - private const string FAILED_RETRY_MESSAGE = _("Picasa Web Albums didn't recognize the email address and password you entered. To try again, re-enter your email address and password below."); | 1599 | - private Gtk.Button continue_button = null; |
1369 | 1621 | - private const string NOT_SET_UP_MESSAGE = _("The email address and password you entered correspond to a Google account that isn't set up for use with Picasa Web Albums. You can set up most accounts by using your browser to log into the Picasa Web Albums site at least once. To try again, re-enter your email address and password below."); | 1600 | - |
1370 | 1622 | - private const string ADDITIONAL_SECURITY_MESSAGE = _("The email address and password you entered correspond to a Google account that has been tagged as requiring additional security. You can clear this tag by using your browser to log into Picasa Web Albums. To try again, re-enter your email address and password below."); | 1601 | - public signal void proceed(NotSetUpMessagePane sender); |
1371 | 1623 | - | 1602 | - |
1372 | 1624 | - private const int UNIFORM_ACTION_BUTTON_WIDTH = 102; | 1603 | - public NotSetUpMessagePane(Gtk.Builder builder) { |
1373 | 1625 | - private const int VERTICAL_SPACE_HEIGHT = 32; | 1604 | - assert(builder != null); |
1374 | 1626 | - public const int STANDARD_CONTENT_LABEL_WIDTH = 500; | 1605 | - assert(builder.get_objects().length() > 0); |
1375 | 1627 | - | 1606 | - |
1376 | 1628 | - private weak Spit.Publishing.PluginHost host = null; | 1607 | - continue_button = builder.get_object("continue_button") as Gtk.Button; |
1377 | 1629 | - private Gtk.Entry email_entry; | 1608 | - pane_widget = builder.get_object("pane_widget") as Gtk.Box; |
1378 | 1630 | - private Gtk.Entry password_entry; | 1609 | - |
1379 | 1631 | - private Gtk.Button login_button; | 1610 | - pane_widget.show_all(); |
1380 | 1632 | - private Gtk.Button go_back_button; | 1611 | - } |
1381 | 1633 | - private string? username = null; | 1612 | - |
1382 | 1634 | - | 1613 | - private void on_continue_clicked() { |
1383 | 1635 | - public signal void go_back(); | 1614 | - proceed(this); |
1384 | 1636 | - public signal void login(string email, string password); | 1615 | - } |
1385 | 1637 | - | 1616 | - |
1386 | 1638 | - public LegacyCredentialsPane(Spit.Publishing.PluginHost host, CredentialsPane.Mode mode = | 1617 | - public Gtk.Widget get_widget() { |
1387 | 1639 | - CredentialsPane.Mode.INTRO, string? username = null) { | 1618 | - return pane_widget; |
1388 | 1640 | - this.host = host; | 1619 | - } |
1389 | 1641 | - this.username = username; | 1620 | - |
1390 | 1642 | - | 1621 | - public Spit.Publishing.DialogPane.GeometryOptions get_preferred_geometry() { |
1391 | 1643 | - add(gtk_vspacer(VERTICAL_SPACE_HEIGHT)); | 1622 | - return Spit.Publishing.DialogPane.GeometryOptions.NONE; |
1392 | 1644 | - | 1623 | - } |
1393 | 1645 | - Gtk.Label intro_message_label = new Gtk.Label(""); | 1624 | - |
1394 | 1646 | - intro_message_label.set_line_wrap(true); | 1625 | - public void on_pane_installed() { |
1395 | 1647 | - add(intro_message_label); | 1626 | - continue_button.clicked.connect(on_continue_clicked); |
1396 | 1648 | - intro_message_label.set_size_request(STANDARD_CONTENT_LABEL_WIDTH, -1); | 1627 | - } |
1397 | 1649 | - intro_message_label.set_alignment(0.5f, 0.0f); | 1628 | - |
1398 | 1650 | - switch (mode) { | 1629 | - public void on_pane_uninstalled() { |
1399 | 1651 | - case CredentialsPane.Mode.INTRO: | 1630 | - continue_button.clicked.disconnect(on_continue_clicked); |
1276 | 1652 | - intro_message_label.set_text(INTRO_MESSAGE); | ||
1277 | 1653 | - break; | ||
1278 | 1654 | - | ||
1279 | 1655 | - case CredentialsPane.Mode.FAILED_RETRY: | ||
1280 | 1656 | - intro_message_label.set_markup("<b>%s</b>\n\n%s".printf(_( | ||
1281 | 1657 | - "Unrecognized User"), FAILED_RETRY_MESSAGE)); | ||
1282 | 1658 | - break; | ||
1283 | 1659 | - | ||
1284 | 1660 | - case CredentialsPane.Mode.NOT_SET_UP: | ||
1285 | 1661 | - intro_message_label.set_markup("<b>%s</b>\n\n%s".printf(_("Account Not Ready"), | ||
1286 | 1662 | - NOT_SET_UP_MESSAGE)); | ||
1287 | 1663 | - add(gtk_vspacer(VERTICAL_SPACE_HEIGHT)); | ||
1288 | 1664 | - break; | ||
1289 | 1665 | - | ||
1290 | 1666 | - case CredentialsPane.Mode.ADDITIONAL_SECURITY: | ||
1291 | 1667 | - intro_message_label.set_markup("<b>%s</b>\n\n%s".printf(_("Additional Security Required"), | ||
1292 | 1668 | - ADDITIONAL_SECURITY_MESSAGE)); | ||
1293 | 1669 | - add(gtk_vspacer(VERTICAL_SPACE_HEIGHT)); | ||
1294 | 1670 | - break; | ||
1295 | 1671 | - } | ||
1296 | 1672 | - | ||
1297 | 1673 | - Gtk.Alignment entry_widgets_table_aligner = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 0.0f); | ||
1298 | 1674 | - Gtk.Table entry_widgets_table = new Gtk.Table(3,2, false); | ||
1299 | 1675 | - Gtk.Label email_entry_label = new Gtk.Label.with_mnemonic(_("_Email address:")); | ||
1300 | 1676 | - email_entry_label.set_alignment(0.0f, 0.5f); | ||
1301 | 1677 | - Gtk.Label password_entry_label = new Gtk.Label.with_mnemonic(_("_Password:")); | ||
1302 | 1678 | - password_entry_label.set_alignment(0.0f, 0.5f); | ||
1303 | 1679 | - email_entry = new Gtk.Entry(); | ||
1304 | 1680 | - if (username != null) | ||
1305 | 1681 | - email_entry.set_text(username); | ||
1306 | 1682 | - email_entry.changed.connect(on_email_changed); | ||
1307 | 1683 | - password_entry = new Gtk.Entry(); | ||
1308 | 1684 | - password_entry.set_visibility(false); | ||
1309 | 1685 | - entry_widgets_table.attach(email_entry_label, 0, 1, 0, 1, | ||
1310 | 1686 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1311 | 1687 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, 6); | ||
1312 | 1688 | - entry_widgets_table.attach(password_entry_label, 0, 1, 1, 2, | ||
1313 | 1689 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1314 | 1690 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, 6); | ||
1315 | 1691 | - entry_widgets_table.attach(email_entry, 1, 2, 0, 1, | ||
1316 | 1692 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1317 | 1693 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, 6); | ||
1318 | 1694 | - entry_widgets_table.attach(password_entry, 1, 2, 1, 2, | ||
1319 | 1695 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1320 | 1696 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, 6); | ||
1321 | 1697 | - go_back_button = new Gtk.Button.with_mnemonic(_("Go _Back")); | ||
1322 | 1698 | - go_back_button.clicked.connect(on_go_back_button_clicked); | ||
1323 | 1699 | - Gtk.Alignment go_back_button_aligner = new Gtk.Alignment(0.0f, 0.5f, 0.0f, 0.0f); | ||
1324 | 1700 | - go_back_button_aligner.add(go_back_button); | ||
1325 | 1701 | - go_back_button.set_size_request(UNIFORM_ACTION_BUTTON_WIDTH, -1); | ||
1326 | 1702 | - login_button = new Gtk.Button.with_mnemonic(_("_Login")); | ||
1327 | 1703 | - login_button.clicked.connect(on_login_button_clicked); | ||
1328 | 1704 | - login_button.set_sensitive(username != null); | ||
1329 | 1705 | - Gtk.Alignment login_button_aligner = new Gtk.Alignment(1.0f, 0.5f, 0.0f, 0.0f); | ||
1330 | 1706 | - login_button_aligner.add(login_button); | ||
1331 | 1707 | - login_button.set_size_request(UNIFORM_ACTION_BUTTON_WIDTH, -1); | ||
1332 | 1708 | - entry_widgets_table.attach(go_back_button_aligner, 0, 1, 2, 3, | ||
1333 | 1709 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1334 | 1710 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, VERTICAL_SPACE_HEIGHT); | ||
1335 | 1711 | - entry_widgets_table.attach(login_button_aligner, 1, 2, 2, 3, | ||
1336 | 1712 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, | ||
1337 | 1713 | - Gtk.AttachOptions.EXPAND | Gtk.AttachOptions.FILL, 6, VERTICAL_SPACE_HEIGHT); | ||
1338 | 1714 | - entry_widgets_table_aligner.add(entry_widgets_table); | ||
1339 | 1715 | - add(entry_widgets_table_aligner); | ||
1340 | 1716 | - | ||
1341 | 1717 | - email_entry_label.set_mnemonic_widget(email_entry); | ||
1342 | 1718 | - password_entry_label.set_mnemonic_widget(password_entry); | ||
1343 | 1719 | - | ||
1344 | 1720 | - add(gtk_vspacer(VERTICAL_SPACE_HEIGHT)); | ||
1345 | 1721 | - } | ||
1346 | 1722 | - | ||
1347 | 1723 | - private void on_login_button_clicked() { | ||
1348 | 1724 | - login(email_entry.get_text(), password_entry.get_text()); | ||
1349 | 1725 | - } | ||
1350 | 1726 | - | ||
1351 | 1727 | - private void on_go_back_button_clicked() { | ||
1352 | 1728 | - go_back(); | ||
1353 | 1729 | - } | ||
1354 | 1730 | - | ||
1355 | 1731 | - private void on_email_changed() { | ||
1356 | 1732 | - login_button.set_sensitive(email_entry.get_text() != ""); | ||
1357 | 1733 | - } | ||
1358 | 1734 | - | ||
1359 | 1735 | - public void installed() { | ||
1360 | 1736 | - host.set_service_locked(false); | ||
1361 | 1737 | - | ||
1362 | 1738 | - email_entry.grab_focus(); | ||
1363 | 1739 | - password_entry.set_activates_default(true); | ||
1364 | 1740 | - login_button.can_default = true; | ||
1365 | 1741 | - host.set_dialog_default_widget(login_button); | ||
1400 | 1742 | - } | 1631 | - } |
1401 | 1743 | -} | 1632 | -} |
1402 | 1744 | - | 1633 | - |
1403 | 1745 | internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object { | 1634 | internal class PublishingOptionsPane : Spit.Publishing.DialogPane, GLib.Object { |
1407 | 1746 | private LegacyPublishingOptionsPane wrapped = null; | 1635 | private class SizeDescription { |
1408 | 1747 | 1636 | public string name; | |
1406 | 1748 | |||
1409 | 1749 | Index: shotwell-0.12.90/src/plugins/PublishingInterfaces.vala | 1637 | Index: shotwell-0.12.90/src/plugins/PublishingInterfaces.vala |
1410 | 1750 | =================================================================== | 1638 | =================================================================== |
1413 | 1751 | --- shotwell-0.12.90.orig/src/plugins/PublishingInterfaces.vala 2012-08-24 09:03:04.000000000 +1200 | 1639 | --- shotwell-0.12.90.orig/src/plugins/PublishingInterfaces.vala 2012-08-24 00:03:04.000000000 +0300 |
1414 | 1752 | +++ shotwell-0.12.90/src/plugins/PublishingInterfaces.vala 2012-08-24 15:15:23.971988123 +1200 | 1640 | +++ shotwell-0.12.90/src/plugins/PublishingInterfaces.vala 2012-08-28 10:25:15.300033478 +0300 |
1415 | 1753 | @@ -494,6 +494,7 @@ | 1641 | @@ -494,6 +494,7 @@ |
1416 | 1754 | */ | 1642 | */ |
1417 | 1755 | public abstract Spit.Publishing.Publisher.MediaType get_publishable_media_type(); | 1643 | public abstract Spit.Publishing.Publisher.MediaType get_publishable_media_type(); |
1418 | @@ -1776,8 +1664,8 @@ | |||
1419 | 1776 | protected virtual void reserved3() {} | 1664 | protected virtual void reserved3() {} |
1420 | 1777 | Index: shotwell-0.12.90/src/publishing/PublishingPluginHost.vala | 1665 | Index: shotwell-0.12.90/src/publishing/PublishingPluginHost.vala |
1421 | 1778 | =================================================================== | 1666 | =================================================================== |
1424 | 1779 | --- shotwell-0.12.90.orig/src/publishing/PublishingPluginHost.vala 2012-08-24 09:03:04.000000000 +1200 | 1667 | --- shotwell-0.12.90.orig/src/publishing/PublishingPluginHost.vala 2012-08-24 00:03:04.000000000 +0300 |
1425 | 1780 | +++ shotwell-0.12.90/src/publishing/PublishingPluginHost.vala 2012-08-24 15:15:23.971988123 +1200 | 1668 | +++ shotwell-0.12.90/src/publishing/PublishingPluginHost.vala 2012-08-28 10:25:15.300033478 +0300 |
1426 | 1781 | @@ -232,6 +232,13 @@ | 1669 | @@ -232,6 +232,13 @@ |
1427 | 1782 | 1670 | ||
1428 | 1783 | return report_plugin_upload_progress; | 1671 | return report_plugin_upload_progress; |
1429 | @@ -1794,8 +1682,8 @@ | |||
1430 | 1794 | } | 1682 | } |
1431 | 1795 | Index: shotwell-0.12.90/src/publishing/PublishingUI.vala | 1683 | Index: shotwell-0.12.90/src/publishing/PublishingUI.vala |
1432 | 1796 | =================================================================== | 1684 | =================================================================== |
1435 | 1797 | --- shotwell-0.12.90.orig/src/publishing/PublishingUI.vala 2012-08-24 09:03:04.000000000 +1200 | 1685 | --- shotwell-0.12.90.orig/src/publishing/PublishingUI.vala 2012-08-24 00:03:04.000000000 +0300 |
1436 | 1798 | +++ shotwell-0.12.90/src/publishing/PublishingUI.vala 2012-08-24 15:15:23.971988123 +1200 | 1686 | +++ shotwell-0.12.90/src/publishing/PublishingUI.vala 2012-08-28 10:25:15.300033478 +0300 |
1437 | 1799 | @@ -296,6 +296,7 @@ | 1687 | @@ -296,6 +296,7 @@ |
1438 | 1800 | Spit.Publishing.Service[] all_services = load_all_services(); | 1688 | Spit.Publishing.Service[] all_services = load_all_services(); |
1439 | 1801 | 1689 |
Thanks mardy, I got that merged into the Ubuntu branch