From 879e51c1699258de84debf1cca94bf342b18a629 Mon Sep 17 00:00:00 2001 From: lda Date: Tue, 21 May 2024 11:17:57 +0200 Subject: [PATCH] [ADD/WIP] Set is_direct field in room leaves --- src/Room.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Room.c b/src/Room.c index 222917f..7670dbf 100644 --- a/src/Room.c +++ b/src/Room.c @@ -209,7 +209,6 @@ RoomPopulate(Room *room, User *user, RoomCreateRequest *req, ServerPart s) SetIfExistent(join_rules); SetIfExistent(history_visibility); SetIfExistent(guest_access); - /* TODO: On a trusted room, set invitees PLs to the owner's. */ #undef SetIfExistent /* User-provided initial states */ @@ -303,6 +302,10 @@ RoomPopulate(Room *room, User *user, RoomCreateRequest *req, ServerPart s) } } + JsonValueFree(JsonSet( + DbJson(room->leaves_ref), + JsonValueBoolean(req->is_direct), 1, "is_direct")); + event = RoomEventCreate(sender_str, "m.room.power_levels", "", pl_content); JsonFree(RoomEventSend(room, event)); JsonFree(event);