Author: akv
Date: 2009-12-26 02:53:15 +0100 (Sat, 26 Dec 2009)
New Revision: 2851

Modified:
   trunk/plugins/output-facebook/facebook.c
   trunk/plugins/output-facebook/facebook.h
Log:
Added facebook_ping() to see if we have access to upload photos.

Modified: trunk/plugins/output-facebook/facebook.c
===================================================================
--- trunk/plugins/output-facebook/facebook.c    2009-12-26 01:16:38 UTC (rev 
2850)
+++ trunk/plugins/output-facebook/facebook.c    2009-12-26 01:53:15 UTC (rev 
2851)
@@ -305,6 +305,31 @@
        return fb->session_key;
 }
 
+gboolean
+facebook_ping()
+{
+       GList *params = NULL;
+       GString *xml = g_string_new("");
+
+       if (!request("facebook.users.isAppAdded", params, xml))
+               return FALSE;
+
+       if (g_utf8_strlen(xml->str, 1048576) == 0)
+               return FALSE;
+
+       gboolean error = xml_error(xml->str, strlen(xml->str));
+       if (error)
+               return FALSE;
+
+       gchar *result = parse_xml_response(xml->str, strlen(xml->str), 
"users_isAppAdded_response", TRUE);
+
+       if (g_strcmp0(result, "1") != 0)
+               return FALSE;
+
+       g_string_free(xml, TRUE);
+       return TRUE;
+}
+
 void
 facebook_close()
 {

Modified: trunk/plugins/output-facebook/facebook.h
===================================================================
--- trunk/plugins/output-facebook/facebook.h    2009-12-26 01:16:38 UTC (rev 
2850)
+++ trunk/plugins/output-facebook/facebook.h    2009-12-26 01:53:15 UTC (rev 
2851)
@@ -43,6 +43,7 @@
 gchar * facebook_get_auth_url(gchar *url);
 void facebook_set_session(gchar *session);
 gchar * facebook_get_session();
+gboolean facebook_ping();
 void facebook_close();
 
 #endif /* FACEBOOK_H */


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to