mod_groups_internal: Save MUC room after creation to commit it to storage
authorMatthew Wild <mwild1@gmail.com>
Fri, 12 Jan 2024 15:37:13 +0000
changeset 5825 c9279845fc41
parent 5824 742142f9771e
child 5826 fe3bde6ef95a
mod_groups_internal: Save MUC room after creation to commit it to storage Without this, the MUC could be lost on an unclean shutdown.
mod_groups_internal/mod_groups_internal.lua
--- a/mod_groups_internal/mod_groups_internal.lua	Thu Jan 11 15:53:18 2024 +0000
+++ b/mod_groups_internal/mod_groups_internal.lua	Fri Jan 12 15:37:13 2024 +0000
@@ -297,6 +297,8 @@
 	-- Create the MUC
 	local muc_jid, room = _create_muc_room(name);
 	if not muc_jid then return nil, room; end
+	room:save(); -- This ensures the room is committed to storage
+
 	table.insert(mucs, muc_jid);
 	if group_info.muc_jid then -- COMPAT include old muc_jid into array
 		table.insert(mucs, group_info.muc_jid);