changeset 4854:ee2463fbf794

mod_default_bookmarks: Abort on incompatible mod_bookmarks The module formerly known as mod_bookmarks exposed this publish_to_pep function, while the new mod_bookmarks2 (called mod_bookmarks in trunk) does not.
author Kim Alvefur <zash@zash.se>
date Fri, 07 Jan 2022 23:25:33 +0100
parents 3804332c204e
children 0c9128145bcf
files mod_default_bookmarks/mod_default_bookmarks.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_default_bookmarks/mod_default_bookmarks.lua	Fri Jan 07 19:55:03 2022 +0100
+++ b/mod_default_bookmarks/mod_default_bookmarks.lua	Fri Jan 07 23:25:33 2022 +0100
@@ -53,8 +53,10 @@
 	local function on_bookmarks_empty(event)
 		local session = event.session;
 		local bookmarks = get_default_bookmarks(session.username);
-		if bookmarks then
+		if bookmarks.publish_to_pep then
 			mod_bookmarks.publish_to_pep(session.full_jid, bookmarks);
+		else
+			module:log("error", "Method for publishing legacy bookmarks not exposed by mod_bookmarks")
 		end
 	end
 	module:hook("bookmarks/empty", on_bookmarks_empty);