Changeset

290:ee416b285802

mod_group_bookmarks: Always ensure bookmarks are injected, even if the user has no bookmarks already stored
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Dec 2010 20:24:20 +0000
parents 289:415034fd38c2
children 291:94fab3c0a7aa
files mod_group_bookmarks/mod_group_bookmarks.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_group_bookmarks/mod_group_bookmarks.lua	Mon Dec 20 16:24:13 2010 +0000
+++ b/mod_group_bookmarks/mod_group_bookmarks.lua	Wed Dec 22 20:24:20 2010 +0000
@@ -56,6 +56,9 @@
 		end
 		if stanza.attr.type == "get" then
 			local data = data and data[key];
+			if (not data) and key == "storage:storage:bookmarks" then
+				data = st.stanza("storage", { xmlns = "storage:bookmarks" });
+			end
 			if data then
 				data = st.deserialize(data);
 				if key == "storage:storage:bookmarks" then