mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
add ignored user checks on /context and /event, misc cleanup
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
2 files changed
+46
-27
No files matched your search
@@ -79,11 +79,15 @@ pub(crate) async fn get_context_route(
|
||||
|
||||
let (base_token, base_event, visible) = try_join!(base_token, base_event, visible)?;
|
||||
|
||||
if base_event.room_id != body.room_id {
|
||||
if base_event.room_id != body.room_id || base_event.event_id != body.event_id {
|
||||
return Err!(Request(NotFound("Base event not found.")));
|
||||
}
|
||||
|
||||
if !visible {
|
||||
if !visible
|
||||
|| ignored_filter(&services, (base_token, base_event.clone()), sender_user)
|
||||
.await
|
||||
.is_none()
|
||||
{
|
||||
return Err!(Request(Forbidden("You don't have permission to view this event.")));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user