Mercurial > prosody-modules
comparison mod_group_bookmarks/mod_group_bookmarks.lua @ 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 | 415034fd38c2 |
children | dcddd9195098 |
comparison
equal
deleted
inserted
replaced
289:415034fd38c2 | 290:ee416b285802 |
---|---|
54 origin.send(st.error_reply(stanza, "wait", "internal-server-error")); | 54 origin.send(st.error_reply(stanza, "wait", "internal-server-error")); |
55 return true; | 55 return true; |
56 end | 56 end |
57 if stanza.attr.type == "get" then | 57 if stanza.attr.type == "get" then |
58 local data = data and data[key]; | 58 local data = data and data[key]; |
59 if (not data) and key == "storage:storage:bookmarks" then | |
60 data = st.stanza("storage", { xmlns = "storage:bookmarks" }); | |
61 end | |
59 if data then | 62 if data then |
60 data = st.deserialize(data); | 63 data = st.deserialize(data); |
61 if key == "storage:storage:bookmarks" then | 64 if key == "storage:storage:bookmarks" then |
62 data = inject_bookmarks(origin.username, origin.host, data); | 65 data = inject_bookmarks(origin.username, origin.host, data); |
63 end | 66 end |