Comparison

plugins/mod_bookmarks.lua @ 12593:1832b6c9c6ed 0.12

mod_bookmarks: Reduce error about not having bookmarks to debug (thanks tom) This is happens if the account is new and doesn't have any bookmarks yet, which is not a problem. Rarely seen since most clients currently use the older version of XEP-0084 stored in XEP-0049 rather than in PEP, but at least one (Converse.js )does. One scenario in which this would show up often is with Converse.js as a guest chat using anonymous authentication, where all "accounts" would always be new and not have any bookmarks. This scenario probably does not need to have mod_bookmarks at all, but if enabled globally it would likely become loaded onto the VirtualHost unless explicitly disabled.
author Kim Alvefur <zash@zash.se>
date Tue, 26 Jul 2022 23:44:33 +0200
parent 12259:57792ed670e7
child 12977:74b9e05af71e
comparison
equal deleted inserted replaced
12592:d580e6a57cbb 12593:1832b6c9c6ed
85 local username = session.username; 85 local username = session.username;
86 local jid = username.."@"..session.host; 86 local jid = username.."@"..session.host;
87 local service = mod_pep.get_pep_service(username); 87 local service = mod_pep.get_pep_service(username);
88 local ok, ret = service:get_items(namespace, session.full_jid); 88 local ok, ret = service:get_items(namespace, session.full_jid);
89 if not ok then 89 if not ok then
90 module:log("error", "Failed to retrieve PEP bookmarks of %s: %s", jid, ret); 90 if ret == "item-not-found" then
91 module:log("debug", "Got no PEP bookmarks item for %s, returning empty private bookmarks", jid);
92 else
93 module:log("error", "Failed to retrieve PEP bookmarks of %s: %s", jid, ret);
94 end
91 session.send(st.error_reply(stanza, "cancel", ret, "Failed to retrieve bookmarks from PEP")); 95 session.send(st.error_reply(stanza, "cancel", ret, "Failed to retrieve bookmarks from PEP"));
92 return true; 96 return true;
93 end 97 end
94 98
95 local storage = generate_legacy_storage(ret); 99 local storage = generate_legacy_storage(ret);