Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

set owner to new bookmarks.

allo769c3f1249c9
diff --git a/htroot/Bookmarks.java b/htroot/Bookmarks.java
index be9bd843a..f5debe7de 100644
--- a/htroot/Bookmarks.java
+++ b/htroot/Bookmarks.java
@@ -115,16 +115,12 @@ public class Bookmarks {
if(bookmark != null){
bookmark.setProperty(bookmarksDB.Bookmark.BOOKMARK_TITLE, title);
bookmark.setProperty(bookmarksDB.Bookmark.BOOKMARK_DESCRIPTION, description);
+ if(user!=null) bookmark.setOwner(user.getUserName());
+
if(((String) post.get("public")).equals("public")){
bookmark.setPublic(true);
- // create a news message
- HashMap map = new HashMap();
- map.put("url", url.replace(',', '|'));
- map.put("title", title.replace(',', ' '));
- map.put("description", description.replace(',', ' '));
- map.put("tags", tagsString.replace(',', ' '));
- yacyCore.newsPool.publishMyNews(new yacyNewsRecord("bkmrkadd", map));
+ publishNews(url, title, description, tagsString);
}else{
bookmark.setPublic(false);
}
@@ -285,4 +281,14 @@ public class Bookmarks {
return prop;
}
+ private static void publishNews(String url, String title, String description, String tagsString) {
+ // create a news message
+ HashMap map = new HashMap();
+ map.put("url", url.replace(',', '|'));
+ map.put("title", title.replace(',', ' '));
+ map.put("description", description.replace(',', ' '));
+ map.put("tags", tagsString.replace(',', ' '));
+ yacyCore.newsPool.publishMyNews(new yacyNewsRecord("bkmrkadd", map));
+ }
+
}