Changeset

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 4414:dbfa830e4504
children 4416:dd3bfe8f182e
files mod_groups_internal/mod_groups_internal.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
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";