0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-28 17:52:54 +01:00

ircd:Ⓜ️:room::create: Implement room_alias_name in initial room creation.

This commit is contained in:
Jason Volk 2023-02-17 13:24:33 -08:00
parent 92ca127f54
commit 77cd8832c1

View file

@ -136,6 +136,28 @@ try
};
}
// initial m.room.canonical_alias (room_alias_name)
if(json::get<"room_alias_name"_>(c)) try
{
const id::room_alias::buf canonical_alias
{
json::get<"room_alias_name"_>(c), origin(my())
};
send(room, creator, "m.room.canonical_alias", "",
{
{ "alias", canonical_alias }
});
}
catch(const std::exception &e)
{
report_error
{
errors, room_id, creator, "Failed to set room_alias_name: %s", e.what()
};
}
// initial join_rules
const string_view &join_rule