# HG changeset patch # User Jonas Schäfer # Date 1611606773 -3600 # Node ID dfb34cc9702835e1cc780578f0b65856fce6c700 # Parent 205a027d86f34892dbbee262f39579c3ec507f0e mod_groups_internal: allow specifying a group_id on create It will refuse to create that group if it exists already, as it should. diff -r 205a027d86f3 -r dfb34cc97028 mod_groups_internal/mod_groups_internal.lua --- a/mod_groups_internal/mod_groups_internal.lua Mon Jan 25 18:43:48 2021 +0100 +++ b/mod_groups_internal/mod_groups_internal.lua Mon Jan 25 21:32:53 2021 +0100 @@ -84,11 +84,17 @@ end --luacheck: ignore 131 -function create(group_info, create_muc) +function create(group_info, create_muc, group_id) if not group_info.name then return nil, "group-name-required"; end - local group_id = id.short(); + if group_id then + if exists(group_id) then + return nil, "conflict" + end + else + group_id = id.short(); + end if create_muc then return nil, "not-implemented";