Mercurial > prosody-modules
comparison mod_default_bookmarks/mod_default_bookmarks.lua @ 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 | 420ebea00cf3 |
children | b3f0f82af5a2 |
comparison
equal
deleted
inserted
replaced
4853:3804332c204e | 4854:ee2463fbf794 |
---|---|
51 if is_on_trunk then | 51 if is_on_trunk then |
52 local mod_bookmarks = module:depends "bookmarks"; | 52 local mod_bookmarks = module:depends "bookmarks"; |
53 local function on_bookmarks_empty(event) | 53 local function on_bookmarks_empty(event) |
54 local session = event.session; | 54 local session = event.session; |
55 local bookmarks = get_default_bookmarks(session.username); | 55 local bookmarks = get_default_bookmarks(session.username); |
56 if bookmarks then | 56 if bookmarks.publish_to_pep then |
57 mod_bookmarks.publish_to_pep(session.full_jid, bookmarks); | 57 mod_bookmarks.publish_to_pep(session.full_jid, bookmarks); |
58 else | |
59 module:log("error", "Method for publishing legacy bookmarks not exposed by mod_bookmarks") | |
58 end | 60 end |
59 end | 61 end |
60 module:hook("bookmarks/empty", on_bookmarks_empty); | 62 module:hook("bookmarks/empty", on_bookmarks_empty); |
61 else | 63 else |
62 local function on_private_xml_get(event) | 64 local function on_private_xml_get(event) |