mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd:Ⓜ️:room::state::space: Conditionally auth for non-internal rooms.
This commit is contained in:
parent
08b3b6cddc
commit
9e4f15e2e5
1 changed files with 10 additions and 1 deletions
|
@ -2879,6 +2879,11 @@ ircd::m::room::state::space::rebuild::rebuild(const room::id &room_id)
|
|||
if(!it)
|
||||
return;
|
||||
|
||||
const bool check_auth
|
||||
{
|
||||
!m::internal(room_id)
|
||||
};
|
||||
|
||||
size_t state_count(0), messages_count(0), state_deleted(0);
|
||||
for(; it; ++it, ++messages_count) try
|
||||
{
|
||||
|
@ -2894,7 +2899,9 @@ ircd::m::room::state::space::rebuild::rebuild(const room::id &room_id)
|
|||
const m::event &event{*it};
|
||||
const auto &[pass_static, reason_static]
|
||||
{
|
||||
room::auth::check_static(event)
|
||||
check_auth?
|
||||
room::auth::check_static(event):
|
||||
room::auth::passfail{true, {}}
|
||||
};
|
||||
|
||||
if(!pass_static)
|
||||
|
@ -2908,6 +2915,8 @@ ircd::m::room::state::space::rebuild::rebuild(const room::id &room_id)
|
|||
|
||||
const auto &[pass_relative, reason_relative]
|
||||
{
|
||||
!check_auth?
|
||||
room::auth::passfail{true, {}}:
|
||||
pass_static?
|
||||
room::auth::check_relative(event):
|
||||
room::auth::passfail{false, {}},
|
||||
|
|
Loading…
Reference in a new issue