mod_groups_internal: correctly destroy MUC associated with group
Turns out, delete does not do what I think it does. destroy does
what I think it does.
--- a/mod_groups_internal/mod_groups_internal.lua Mon Feb 01 16:43:27 2021 +0100
+++ b/mod_groups_internal/mod_groups_internal.lua Tue Feb 02 22:28:09 2021 +0100
@@ -122,7 +122,7 @@
});
if not ok then
if room then
- muc_host:delete_room(room)
+ room:destroy()
end
return nil, "internal-server-error";
end
@@ -182,7 +182,10 @@
if group_members_store:set(group_id, nil) then
local group_info = get_info(group_id);
if group_info and group_info.muc_jid then
- muc_host.delete_room(muc_host.get_room_from_jid(group_info.muc_jid));
+ local room = muc_host.get_room_from_jid(group_info.muc_jid)
+ if room then
+ room:destroy()
+ end
end
return group_info_store:set(group_id, nil);
end