Comparison

mod_groups_muc_bookmarks/mod_groups_muc_bookmarks.lua @ 4863:fdf50c4d23a3

mod_groups_muc_bookmarks: restore bookmark injection on empty store
author Jonas Schäfer <jonas@wielicki.name>
date Sun, 09 Jan 2022 18:20:28 +0100
parent 4862:9a8a43d0faed
child 5709:d5ff386dc97f
comparison
equal deleted inserted replaced
4862:9a8a43d0faed 4863:fdf50c4d23a3
15 ["access_model"] = "whitelist"; 15 ["access_model"] = "whitelist";
16 }; 16 };
17 17
18 local function get_current_bookmarks(jid, service) 18 local function get_current_bookmarks(jid, service)
19 local ok, items = service:get_items(XMLNS_BM2, jid) 19 local ok, items = service:get_items(XMLNS_BM2, jid)
20 if not ok then return nil, items; end 20 if not ok then
21 if items == "item-not-found" then
22 return {}, nil;
23 else
24 return nil, items;
25 end
26 end
21 return items or {}; 27 return items or {};
22 end 28 end
23 29
24 local function update_bookmark(jid, service, room, bookmark) 30 local function update_bookmark(jid, service, room, bookmark)
25 local ok, err = service:publish(XMLNS_BM2, jid, room, bookmark, default_options); 31 local ok, err = service:publish(XMLNS_BM2, jid, room, bookmark, default_options);