Software /
code /
prosody-modules
Comparison
mod_groups_muc_bookmarks/mod_groups_muc_bookmarks.lua @ 4586:240fa534f586
mod_groups_muc_bookmarks: handle removal of accounts without bookmarks
Otherwise, nil ensues.
author | Jonas Schäfer <jonas@wielicki.name> |
---|---|
date | Sat, 12 Jun 2021 15:29:53 +0200 |
parent | 4425:b3e0295e14a3 |
child | 4861:5fadb991003d |
comparison
equal
deleted
inserted
replaced
4585:05c74210c007 | 4586:240fa534f586 |
---|---|
89 local function remove_bookmark(jid, room, autojoin, name) | 89 local function remove_bookmark(jid, room, autojoin, name) |
90 local pep_service = mod_pep.get_pep_service(jid_split(jid)) | 90 local pep_service = mod_pep.get_pep_service(jid_split(jid)) |
91 | 91 |
92 autojoin = autojoin or false and true | 92 autojoin = autojoin or false and true |
93 local current = get_current_bookmarks(jid, pep_service) | 93 local current = get_current_bookmarks(jid, pep_service) |
94 if not current then | |
95 return | |
96 end | |
94 current:maptags(function (node) | 97 current:maptags(function (node) |
95 if node.attr.xmlns and node.attr.xmlns ~= XMLNS_XEP0048 then | 98 if node.attr.xmlns and node.attr.xmlns ~= XMLNS_XEP0048 then |
96 return node | 99 return node |
97 end | 100 end |
98 if node.name ~= "conference" then | 101 if node.name ~= "conference" then |