comparison mod_groups_internal/mod_groups_internal.lua @ 5824:f1e816df1f73

mod_groups_internal: Also remove MUCs that still exist, but have been destroyed Tombstones could previously fool us into thinking the MUC was still there.
author Matthew Wild <mwild1@gmail.com>
date Fri, 12 Jan 2024 18:19:56 +0000
parents fe3bde6ef95a
children 865c77b5c6dc
comparison
equal deleted inserted replaced
5823:220502eb05aa 5824:f1e816df1f73
245 elseif group_info.mucs then 245 elseif group_info.mucs then
246 local user_jid = username .. "@" .. host; 246 local user_jid = username .. "@" .. host;
247 for i = #group_info.mucs, 1, -1 do 247 for i = #group_info.mucs, 1, -1 do
248 local muc_jid = group_info.mucs[i]; 248 local muc_jid = group_info.mucs[i];
249 local room = muc_host.get_room_from_jid(muc_jid); 249 local room = muc_host.get_room_from_jid(muc_jid);
250 if not room then 250 if not room or room._data.destroyed then
251 -- MUC no longer available, for some reason 251 -- MUC no longer available, for some reason
252 -- Let's remove it from the circle metadata... 252 -- Let's remove it from the circle metadata...
253 table.remove(group_info.mucs, i); 253 table.remove(group_info.mucs, i);
254 group_info_store:set_key(group_id, "mucs", group_info.mucs); 254 group_info_store:set_key(group_id, "mucs", group_info.mucs);
255 else 255 else