[f-spot/FSPOT_0_6_0_STABLE] Facebook Export: unlist the "Profile pictures" album
- From: Lorenzo Milesi <lmilesi src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [f-spot/FSPOT_0_6_0_STABLE] Facebook Export: unlist the "Profile pictures" album
- Date: Mon, 19 Oct 2009 07:10:36 +0000 (UTC)
commit c48a59df0626c34f7358926597f1555d49f36e9c
Author: Lorenzo Milesi <maxxer yetopen it>
Date: Sun Oct 18 21:05:48 2009 +0200
Facebook Export: unlist the "Profile pictures" album
Upload from external app to that album is forbidden.
Ref: http://wiki.developers.facebook.com/index.php/Photos.getAlbums
Fix bgo#595952.
.../FacebookExport/FacebookExport.addin.xml | 2 +-
.../Mono.Facebook/FacebookSession.cs | 18 +++++++++++++++---
2 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/extensions/Exporters/FacebookExport/FacebookExport.addin.xml b/extensions/Exporters/FacebookExport/FacebookExport.addin.xml
index 40ef2bb..80f9dee 100644
--- a/extensions/Exporters/FacebookExport/FacebookExport.addin.xml
+++ b/extensions/Exporters/FacebookExport/FacebookExport.addin.xml
@@ -1,6 +1,6 @@
<Addin namespace="FSpot"
id="FacebookExport"
- version="0.6.0.7"
+ version="0.6.0.8"
name="FacebookExport"
description="Export pictures to facebook"
author="George Talusan, Jim Ramsay, Stephane Delcroix"
diff --git a/extensions/Exporters/FacebookExport/Mono.Facebook/FacebookSession.cs b/extensions/Exporters/FacebookExport/Mono.Facebook/FacebookSession.cs
index 85d1c47..137b090 100644
--- a/extensions/Exporters/FacebookExport/Mono.Facebook/FacebookSession.cs
+++ b/extensions/Exporters/FacebookExport/Mono.Facebook/FacebookSession.cs
@@ -118,10 +118,22 @@ namespace Mono.Facebook
FacebookParam.Create ("session_key", session_info.SessionKey),
FacebookParam.Create ("call_id", DateTime.Now.Ticks));
- foreach (Album album in rsp.Albums)
- album.Session = this;
+ // Fetch "Profile pictures" album ID, and remove it from list. We cannot upload there. Bgo#595952
+ AlbumsResponse rsp_profile = util.GetResponse<AlbumsResponse> ("facebook.photos.getAlbums",
+ FacebookParam.Create ("uid", session_info.UId),
+ FacebookParam.Create ("session_key", session_info.SessionKey),
+ FacebookParam.Create ("aid", "-3"),
+ FacebookParam.Create ("call_id", DateTime.Now.Ticks));
+
+ Album [] rsp_albums = new Album [rsp.Albums.Length - 1];
+ uint id = 0;
+ foreach (Album album in rsp.Albums)
+ if (album.AId != rsp_profile.Albums [0].AId) {
+ album.Session = this;
+ rsp_albums [id ++] = album;
+ }
- return rsp.Albums;
+ return rsp_albums;
}
public Album CreateAlbum (string name, string description, string location)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]