aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-07-26 23:44:33 +0200
committerKim Alvefur <zash@zash.se>2022-07-26 23:44:33 +0200
commit96301b2229b2ceeab1797e4bc4e29707b0a32681 (patch)
treecc78e3e6b88e1941a04502550663a2364f3db288 /plugins
parent9f51add3a83cd0bbc6c765ce08cda1a4a42fc8a2 (diff)
downloadprosody-96301b2229b2ceeab1797e4bc4e29707b0a32681.tar.gz
prosody-96301b2229b2ceeab1797e4bc4e29707b0a32681.zip
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.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_bookmarks.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_bookmarks.lua b/plugins/mod_bookmarks.lua
index cd6eae67..d67915f8 100644
--- a/plugins/mod_bookmarks.lua
+++ b/plugins/mod_bookmarks.lua
@@ -87,7 +87,11 @@ local function on_retrieve_legacy_pep(event)
local service = mod_pep.get_pep_service(username);
local ok, ret = service:get_items(namespace, session.full_jid);
if not ok then
- module:log("error", "Failed to retrieve PEP bookmarks of %s: %s", jid, ret);
+ if ret == "item-not-found" then
+ module:log("debug", "Got no PEP bookmarks item for %s, returning empty private bookmarks", jid);
+ else
+ module:log("error", "Failed to retrieve PEP bookmarks of %s: %s", jid, ret);
+ end
session.send(st.error_reply(stanza, "cancel", ret, "Failed to retrieve bookmarks from PEP"));
return true;
end