Software /
code /
prosody-modules
Comparison
mod_bookmarks/mod_bookmarks.lua @ 3231:f7777bc6e677
mod_bookmarks: Enforce publish_options since Prosody 249d90ff992e.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 18 Aug 2018 14:10:38 +0100 |
parent | 3230:ba0d444b64aa |
child | 3232:34e30a891bd3 |
comparison
equal
deleted
inserted
replaced
3230:ba0d444b64aa | 3231:f7777bc6e677 |
---|---|
40 | 40 |
41 local function publish_to_pep(username, jid, bookmarks) | 41 local function publish_to_pep(username, jid, bookmarks) |
42 local service = mod_pep.get_pep_service(username); | 42 local service = mod_pep.get_pep_service(username); |
43 local item = st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = "current" }) | 43 local item = st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = "current" }) |
44 :add_child(bookmarks); | 44 :add_child(bookmarks); |
45 return service:publish("storage:bookmarks", jid, "current", item); | 45 local options = { |
46 ["persist_items"] = true; | |
47 ["access_model"] = "whitelist"; | |
48 }; | |
49 return service:publish("storage:bookmarks", jid, "current", item, options); | |
46 end | 50 end |
47 | 51 |
48 -- Synchronise Private XML to PEP. | 52 -- Synchronise Private XML to PEP. |
49 local function on_publish_private_xml(event) | 53 local function on_publish_private_xml(event) |
50 local stanza, session = event.stanza, event.origin; | 54 local stanza, session = event.stanza, event.origin; |