Added functionality to keep privacy settings when bookmarks exported via API.
[scuttle] / api / posts_get.php
index d54f86a4ca06f4cb9d11de46033243a4539a0e72..2c875ecdaaf770d3d56753c9738add43c1240ea6 100644 (file)
@@ -54,8 +54,14 @@ foreach ($bookmarks['bookmarks'] as $row) {
     } else {
         $taglist = 'system:unfiled';
     }
+    // The privacy setting in scuttle is to set bStatus to 2 in database.
+    if(trim($row['bStatus']) == '2') {
+        $shared = "no";
+    } else {
+        $shared = "yes";
+    }
 
-    echo "\t<post href=\"". filter($row['bAddress'], 'xml') .'" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. $row['bHash'] .'" others="'. $bookmarkservice->countOthers($row['bAddress']) .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
+    echo "\t<post href=\"". filter($row['bAddress'], 'xml') .'"  shared="' . $shared . '" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. $row['bHash'] .'" others="'. $bookmarkservice->countOthers($row['bAddress']) .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
 }
 
 echo '</posts>';

Benjamin Mako Hill || Want to submit a patch?