diff mod_groups_internal/mod_groups_internal.lua @ 4415:c7424b96c75e

mod_groups_internal: maintain the name of the associated MUC
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 30 Jan 2021 16:25:12 +0100
parents 105586ca9a79
children 7e379ccb8ed6
line wrap: on
line diff
--- a/mod_groups_internal/mod_groups_internal.lua	Sat Jan 30 10:47:57 2021 +0100
+++ b/mod_groups_internal/mod_groups_internal.lua	Sat Jan 30 16:25:12 2021 +0100
@@ -109,6 +109,7 @@
 		room:set_allow_member_invites(false)
 		room:set_moderated(false)
 		room:set_whois("anyone")
+		room:set_name(group_info.name)
 	end
 
 	local ok = group_info_store:set(group_id, {
@@ -138,6 +139,13 @@
 		return nil, "bad-request"
 	end
 
+	-- TODO: we should probably prohibit changing/removing the MUC JID of
+	-- an existing group.
+	if info.muc_jid then
+		room = muc_host.get_room_from_jid(info.muc_jid);
+		room:set_name(info.name);
+	end
+
 	local ok = group_info_store:set(group_id, info);
 	if not ok then
 		return nil, "internal-server-error";