mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-26 12:15:22 +02:00
WIP: add event fetchers to auth_check calls
Some checks failed
Documentation / Build and Deploy Documentation (push) Failing after 2s
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 2s
Rust Checks / Clippy (push) Failing after 11s
Rust Checks / Cargo Test (push) Failing after 10s
Some checks failed
Documentation / Build and Deploy Documentation (push) Failing after 2s
Release Docker Image / define-variables (push) Failing after 1s
Release Docker Image / build-image (linux/amd64, linux-amd64) (push) Has been skipped
Release Docker Image / build-image (linux/arm64, linux-arm64) (push) Has been skipped
Release Docker Image / merge (push) Has been skipped
Rust Checks / Format (push) Failing after 2s
Rust Checks / Clippy (push) Failing after 11s
Rust Checks / Cargo Test (push) Failing after 10s
This commit is contained in:
parent
f183f99b07
commit
aa25e2c897
2 changed files with 15 additions and 7 deletions
|
@ -261,11 +261,7 @@ where
|
|||
if room_version.create_id_as_room_id {
|
||||
// TODO: fetch the create event from the room ID
|
||||
let create_event_id = &EventId::parse(incoming_event.room_id().localpart());
|
||||
// if let Err(e) = create_event_id {
|
||||
// error!(?e, "invalid room ID for create event");
|
||||
// return Ok(false);
|
||||
// }
|
||||
// room_create_event = fetch_event(create_event_id).await;
|
||||
|
||||
match create_event_id {
|
||||
| Ok(id) => {
|
||||
room_create_event = fetch_event(id).await;
|
||||
|
|
|
@ -562,6 +562,7 @@ where
|
|||
event.sender(),
|
||||
Some(state_key),
|
||||
event.content(),
|
||||
room_version,
|
||||
)?;
|
||||
|
||||
let mut auth_state = StateMap::new();
|
||||
|
@ -609,9 +610,20 @@ where
|
|||
let fetch_state = |ty: &StateEventType, key: &str| {
|
||||
future::ready(auth_state.get(&ty.with_state_key(key)))
|
||||
};
|
||||
let fetch_event2 = |id: &EventId| {
|
||||
let id = id.to_owned();
|
||||
let evt = auth_events.get(&id);
|
||||
future::ready(evt) // TODO: FIXME!
|
||||
};
|
||||
|
||||
let auth_result =
|
||||
auth_check(room_version, &event, current_third_party.as_ref(), fetch_state).await;
|
||||
let auth_result = auth_check(
|
||||
room_version,
|
||||
&event,
|
||||
current_third_party.as_ref(),
|
||||
fetch_state,
|
||||
fetch_event2,
|
||||
)
|
||||
.await;
|
||||
|
||||
match auth_result {
|
||||
| Ok(true) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue