0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd:Ⓜ️:vm::execute: Fix determination for internal room on creations.

This commit is contained in:
Jason Volk 2020-04-07 12:59:47 -07:00
parent 4108945a2c
commit bd702d0314

View file

@ -174,10 +174,20 @@ try
m::version(room_version_buf, room{eval.room_id}, std::nothrow)
};
// Determine if this is an internal room creation event
const bool is_internal_room_create
{
json::get<"type"_>(event) == "m.room.create" &&
json::get<"sender"_>(event) &&
m::myself(json::get<"sender"_>(event))
};
// Query for whether the room apropos is an internal room.
const scope_restore room_internal
{
eval.room_internal,
is_internal_room_create?
true:
eval.room_id?
m::internal(eval.room_id):
false