Mercurial > prosody-modules
comparison mod_default_bookmarks/mod_default_bookmarks.lua @ 4856:b3f0f82af5a2
mod_default_bookmarks: Fix mod_bookmarks capability check
Too many variables named too close to 'bookmarks' here...
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 08 Jan 2022 00:01:29 +0100 |
parents | ee2463fbf794 |
children | 3f6711c1c66a |
comparison
equal
deleted
inserted
replaced
4855:0c9128145bcf | 4856:b3f0f82af5a2 |
---|---|
50 | 50 |
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 if mod_bookmarks.publish_to_pep then |
56 if bookmarks.publish_to_pep then | 56 local bookmarks = get_default_bookmarks(session.username); |
57 mod_bookmarks.publish_to_pep(session.full_jid, bookmarks); | 57 if bookmarks then |
58 mod_bookmarks.publish_to_pep(session.full_jid, bookmarks); | |
59 end | |
58 else | 60 else |
59 module:log("error", "Method for publishing legacy bookmarks not exposed by mod_bookmarks") | 61 module:log("error", "Method for publishing legacy bookmarks not exposed by mod_bookmarks") |
60 end | 62 end |
61 end | 63 end |
62 module:hook("bookmarks/empty", on_bookmarks_empty); | 64 module:hook("bookmarks/empty", on_bookmarks_empty); |