mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
enable doc_markdown lint
This commit is contained in:
parent
0f2cf26a36
commit
da440934bd
21 changed files with 51 additions and 46 deletions
|
|
@ -69,11 +69,11 @@ pub(crate) async fn get_register_available_route(
|
|||
/// to check if the user id is valid and available.
|
||||
///
|
||||
/// - Only works if registration is enabled
|
||||
/// - If type is guest: ignores all parameters except initial_device_display_name
|
||||
/// - If type is guest: ignores all parameters except `initial_device_display_name`
|
||||
/// - If sender is not appservice: Requires UIAA (but we only use a dummy stage)
|
||||
/// - If type is not guest and no username is given: Always fails after UIAA check
|
||||
/// - Creates a new account and populates it with default account data
|
||||
/// - If `inhibit_login` is false: Creates a device and returns device id and access_token
|
||||
/// - If `inhibit_login` is false: Creates a device and returns `device_id` and `access_token`
|
||||
pub(crate) async fn register_route(
|
||||
body: Ruma<register::v3::Request>,
|
||||
) -> Result<register::v3::Response> {
|
||||
|
|
@ -304,9 +304,9 @@ pub(crate) async fn register_route(
|
|||
/// - The password hash is calculated using argon2 with 32 character salt, the plain password is
|
||||
/// not saved
|
||||
///
|
||||
/// If logout_devices is true it does the following for each device except the sender device:
|
||||
/// If `logout_devices` is true it does the following for each device except the sender device:
|
||||
/// - Invalidates access token
|
||||
/// - Deletes device metadata (device id, device display name, last seen ip, last seen ts)
|
||||
/// - Deletes device metadata (device ID, device display name, last seen IP, last seen timestamp)
|
||||
/// - Forgets to-device events
|
||||
/// - Triggers device list updates
|
||||
pub(crate) async fn change_password_route(
|
||||
|
|
@ -372,7 +372,7 @@ pub(crate) async fn change_password_route(
|
|||
|
||||
/// # `GET _matrix/client/r0/account/whoami`
|
||||
///
|
||||
/// Get user_id of the sender user.
|
||||
/// Get `user_id` of the sender user.
|
||||
///
|
||||
/// Note: Also works for Application Services
|
||||
pub(crate) async fn whoami_route(body: Ruma<whoami::v3::Request>) -> Result<whoami::v3::Response> {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ use tracing::error;
|
|||
/// Allows loading room history around an event.
|
||||
///
|
||||
/// - Only works if the user is joined (TODO: always allow, but only show events if the user was
|
||||
/// joined, depending on history_visibility)
|
||||
/// joined, depending on `history_visibility`)
|
||||
pub(crate) async fn get_context_route(
|
||||
body: Ruma<get_context::v3::Request>,
|
||||
) -> Result<get_context::v3::Response> {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ pub(crate) async fn send_message_event_route(
|
|||
/// Allows paginating through room history.
|
||||
///
|
||||
/// - Only works if the user is joined (TODO: always allow, but only show events where the user was
|
||||
/// joined, depending on history_visibility)
|
||||
/// joined, depending on `history_visibility`)
|
||||
pub(crate) async fn get_message_events_route(
|
||||
body: Ruma<get_message_events::v3::Request>,
|
||||
) -> Result<get_message_events::v3::Response> {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ pub(crate) async fn get_displayname_route(
|
|||
|
||||
/// # `PUT /_matrix/client/r0/profile/{userId}/avatar_url`
|
||||
///
|
||||
/// Updates the avatar_url and blurhash.
|
||||
/// Updates the `avatar_url` and `blurhash`.
|
||||
///
|
||||
/// - Also makes sure other users receive the update using presence EDUs
|
||||
pub(crate) async fn set_avatar_url_route(
|
||||
|
|
@ -217,9 +217,9 @@ pub(crate) async fn set_avatar_url_route(
|
|||
|
||||
/// # `GET /_matrix/client/r0/profile/{userId}/avatar_url`
|
||||
///
|
||||
/// Returns the avatar_url and blurhash of the user.
|
||||
/// Returns the `avatar_url` and `blurhash` of the user.
|
||||
///
|
||||
/// - If user is on another server: Fetches avatar_url and blurhash over federation
|
||||
/// - If user is on another server: Fetches `avatar_url` and `blurhash` over federation
|
||||
pub(crate) async fn get_avatar_url_route(
|
||||
body: Ruma<get_avatar_url::v3::Request>,
|
||||
) -> Result<get_avatar_url::v3::Response> {
|
||||
|
|
@ -249,7 +249,7 @@ pub(crate) async fn get_avatar_url_route(
|
|||
|
||||
/// # `GET /_matrix/client/r0/profile/{userId}`
|
||||
///
|
||||
/// Returns the displayname, avatar_url and blurhash of the user.
|
||||
/// Returns the `displayname`, `avatar_url` and `blurhash` of the user.
|
||||
///
|
||||
/// - If user is on another server: Fetches profile over federation
|
||||
pub(crate) async fn get_profile_route(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ use tracing::{info, warn};
|
|||
/// Creates a new room.
|
||||
///
|
||||
/// - Room ID is randomly generated
|
||||
/// - Create alias if room_alias_name is set
|
||||
/// - Create alias if `room_alias_name` is set
|
||||
/// - Send create event
|
||||
/// - Join sender user
|
||||
/// - Send power levels event
|
||||
|
|
@ -543,7 +543,7 @@ pub(crate) async fn get_room_event_route(
|
|||
///
|
||||
/// Lists all aliases of the room.
|
||||
///
|
||||
/// - Only users joined to the room are allowed to call this TODO: Allow any user to call it if history_visibility is world readable
|
||||
/// - Only users joined to the room are allowed to call this TODO: Allow any user to call it if `history_visibility` is world readable
|
||||
pub(crate) async fn get_room_aliases_route(
|
||||
body: Ruma<aliases::v3::Request>,
|
||||
) -> Result<aliases::v3::Response> {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{services, Result, Ruma};
|
||||
use ruma::{api::client::space::get_hierarchy, uint};
|
||||
|
||||
/// # `GET /_matrix/client/v1/rooms/{room_id}/hierarchy``
|
||||
/// # `GET /_matrix/client/v1/rooms/{room_id}/hierarchy`
|
||||
///
|
||||
/// Paginates over the space tree in a depth-first manner to locate child rooms of a given space.
|
||||
pub(crate) async fn get_hierarchy_route(
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use tracing::log::warn;
|
|||
///
|
||||
/// - The only requirement for the content is that it has to be valid json
|
||||
/// - Tries to send the event into the room, auth rules will determine if it is allowed
|
||||
/// - If event is new canonical_alias: Rejects if alias is incorrect
|
||||
/// - If event is new `canonical_alias`: Rejects if alias is incorrect
|
||||
pub(crate) async fn send_state_event_for_key_route(
|
||||
body: Ruma<send_state_event::v3::Request>,
|
||||
) -> Result<send_state_event::v3::Response> {
|
||||
|
|
@ -45,7 +45,7 @@ pub(crate) async fn send_state_event_for_key_route(
|
|||
///
|
||||
/// - The only requirement for the content is that it has to be valid json
|
||||
/// - Tries to send the event into the room, auth rules will determine if it is allowed
|
||||
/// - If event is new canonical_alias: Rejects if alias is incorrect
|
||||
/// - If event is new `canonical_alias`: Rejects if alias is incorrect
|
||||
pub(crate) async fn send_state_event_for_empty_key_route(
|
||||
body: Ruma<send_state_event::v3::Request>,
|
||||
) -> Result<RumaResponse<send_state_event::v3::Response>> {
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ use tracing::{debug, error, info};
|
|||
///
|
||||
/// Calling this endpoint with a `since` parameter from a previous `next_batch` returns:
|
||||
/// For joined rooms:
|
||||
/// - Some of the most recent events of each timeline that happened after since
|
||||
/// - If user joined the room after since: All state events (unless lazy loading is activated) and
|
||||
/// - Some of the most recent events of each timeline that happened after `since`
|
||||
/// - If user joined the room after `since`: All state events (unless lazy loading is activated) and
|
||||
/// all device list updates in that room
|
||||
/// - If the user was already in the room: A list of all events that are in the state now, but were
|
||||
/// not in the state at `since`
|
||||
|
|
@ -61,7 +61,7 @@ use tracing::{debug, error, info};
|
|||
/// - If the user was invited after `since`: A subset of the state of the room at the point of the invite
|
||||
///
|
||||
/// For left rooms:
|
||||
/// - If the user left after `since`: prev_batch token, empty state (TODO: subset of the state at the point of the leave)
|
||||
/// - If the user left after `since`: `prev_batch` token, empty state (TODO: subset of the state at the point of the leave)
|
||||
///
|
||||
/// - Sync is handled in an async task, multiple requests from the same device with the same
|
||||
/// `since` will be cached
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ use tracing::{debug, error, warn};
|
|||
/// Wraps either an literal IP address plus port, or a hostname plus complement
|
||||
/// (colon-plus-port if it was specified).
|
||||
///
|
||||
/// Note: A `FedDest::Named` might contain an IP address in string form if there
|
||||
/// was no port specified to construct a SocketAddr with.
|
||||
/// Note: A [`FedDest::Named`] might contain an IP address in string form if there
|
||||
/// was no port specified to construct a [`SocketAddr`] with.
|
||||
///
|
||||
/// # Examples:
|
||||
/// ```rust
|
||||
|
|
@ -340,7 +340,7 @@ fn add_port_to_hostname(destination_str: &str) -> FedDest {
|
|||
FedDest::Named(host.to_owned(), port.to_owned())
|
||||
}
|
||||
|
||||
/// Returns: actual_destination, host header
|
||||
/// Returns: `actual_destination`, `Host` header
|
||||
/// Implemented according to the specification at <https://matrix.org/docs/spec/server_server/r0.1.4#resolving-server-names>
|
||||
/// Numbers in comments below refer to bullet points in linked section of specification
|
||||
async fn find_actual_destination(destination: &'_ ServerName) -> (FedDest, FedDest) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue