mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
modules/client/createroom: Make special conditions to optimize user's user rooms.
This commit is contained in:
parent
3b34785853
commit
33d3764c71
1 changed files with 16 additions and 9 deletions
|
@ -148,17 +148,29 @@ try
|
||||||
room.room_id
|
room.room_id
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const json::string preset
|
||||||
|
{
|
||||||
|
json::get<"preset"_>(c)
|
||||||
|
};
|
||||||
|
|
||||||
// creator join event
|
// creator join event
|
||||||
|
|
||||||
const event::id::buf join_event_id
|
// user rooms don't have their user joined to them at this time otherwise
|
||||||
|
// they'll appear to clients.
|
||||||
|
if(preset != "user")
|
||||||
{
|
{
|
||||||
join(room, creator)
|
const event::id::buf join_event_id
|
||||||
};
|
{
|
||||||
|
join(room, creator)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// initial power_levels
|
// initial power_levels
|
||||||
|
|
||||||
thread_local char pl_content_buf[4_KiB]; try
|
// initial power levels aren't set on internal user rooms for now.
|
||||||
|
if(preset != "user") try
|
||||||
{
|
{
|
||||||
|
thread_local char pl_content_buf[4_KiB];
|
||||||
send(room, creator, "m.room.power_levels", "",
|
send(room, creator, "m.room.power_levels", "",
|
||||||
{
|
{
|
||||||
json::get<"power_level_content_override"_>(c)?
|
json::get<"power_level_content_override"_>(c)?
|
||||||
|
@ -176,11 +188,6 @@ try
|
||||||
|
|
||||||
// initial join_rules
|
// initial join_rules
|
||||||
|
|
||||||
const json::string preset
|
|
||||||
{
|
|
||||||
json::get<"preset"_>(c)
|
|
||||||
};
|
|
||||||
|
|
||||||
const string_view &join_rule
|
const string_view &join_rule
|
||||||
{
|
{
|
||||||
preset == "private_chat"? "invite":
|
preset == "private_chat"? "invite":
|
||||||
|
|
Loading…
Reference in a new issue