Changeset

4423:ca821df93cb9

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.
author Jonas Schäfer <jonas@wielicki.name>
date Tue, 02 Feb 2021 22:28:09 +0100
parents 4422:2047dd56cc40
children 4424:679be18e6a5e
files mod_groups_internal/mod_groups_internal.lua
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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