[libsocialweb] smugmug: Fix Collections.GetDetails



commit add3121d5a336a96b8deb8a8d6df941d162d4db6
Author: Eitan Isaacson <eitan isaacson collabora co uk>
Date:   Thu Mar 3 15:53:16 2011 -0800

    smugmug: Fix Collections.GetDetails
    
    Fixes: https://bugs.meego.com/show_bug.cgi?id=14119

 services/smugmug/smugmug.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/services/smugmug/smugmug.c b/services/smugmug/smugmug.c
index 87456e2..8e29ef1 100644
--- a/services/smugmug/smugmug.c
+++ b/services/smugmug/smugmug.c
@@ -703,7 +703,18 @@ _smugmug_collections_get_details (SwCollectionsIface *self,
 
   g_return_if_fail (priv->rest_proxy != NULL);
 
-  id = g_strsplit (collection_id, "_", 2);
+  if (!g_str_has_prefix(collection_id, ALBUM_PREFIX)) {
+    GError *error =
+      g_error_new (SW_SERVICE_ERROR,
+                   SW_SERVICE_ERROR_NOT_SUPPORTED,
+                   "SmugMug collection ID (%s) must start with '%s'",
+                   collection_id, ALBUM_PREFIX);
+    dbus_g_method_return_error (context, error);
+    g_error_free (error);
+    return;
+  }
+
+  id = g_strsplit (collection_id + strlen (ALBUM_PREFIX), "_", 2);
 
   if (g_strv_length (id) != 2) {
     g_warning ("invalid collection id");



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