Skip to main content

tuwunel_api/server/
edu_types.rs

1use axum::{Json, extract::State, response::IntoResponse};
2use serde_json::json;
3use tuwunel_core::Result;
4
5/// # `GET /_matrix/federation/v1/query/edutypes`
6///
7/// MSC4373: advertise which EDU types this server wishes to receive.
8#[tracing::instrument(skip_all, level = "debug")]
9pub(crate) async fn get_edu_types_route(
10	State(services): State<crate::State>,
11) -> Result<impl IntoResponse> {
12	let cfg = &services.server.config;
13
14	Ok(Json(json!({
15		"m.presence": cfg.allow_incoming_presence,
16		"m.receipt": cfg.allow_incoming_read_receipts,
17		"m.typing": cfg.allow_incoming_typing,
18	})))
19}