Update links to spec.matrix.org/v1.2

This commit is contained in:
Jonathan de Jong 2022-02-18 19:45:04 +01:00 committed by Jonas Platte
parent 01c1dab4e6
commit 936bb64e84
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
77 changed files with 104 additions and 102 deletions

View File

@ -20,7 +20,7 @@ Here is a list of helpful resources you can consult:
## Documentation
- [Matrix spec Documentation](https://matrix.org/docs/spec/)
- [Matrix spec Documentation](https://spec.matrix.org/v1.2/)
## Chat Rooms

View File

@ -11,7 +11,7 @@
//! Such types can then be used by client code to make requests, and by server code to fulfill
//! those requests.
//!
//! [apis]: https://matrix.org/docs/spec/#matrix-apis
//! [apis]: https://spec.matrix.org/v1.2/#matrix-apis
#![warn(missing_docs)]
@ -309,7 +309,7 @@ pub trait OutgoingRequestAppserviceExt: OutgoingRequest {
/// Tries to convert this request into an `http::Request` and appends a virtual `user_id` to
/// [assert Appservice identity][id_assert].
///
/// [id_assert]: https://matrix.org/docs/spec/application_service/r0.1.2#identity-assertion
/// [id_assert]: https://spec.matrix.org/v1.2/application-service-api/#identity-assertion
fn try_into_http_request_with_user_id<T: Default + BufMut>(
self,
base_url: &str,

View File

@ -15,7 +15,7 @@ pub mod thirdparty;
/// A namespace defined by an application service.
///
/// Used for [appservice registration](https://matrix.org/docs/spec/application_service/r0.1.2#registration).
/// Used for [appservice registration](https://spec.matrix.org/v1.2/application-service-api/#registration).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Namespace {
@ -35,7 +35,7 @@ impl Namespace {
/// Namespaces defined by an application service.
///
/// Used for [appservice registration](https://matrix.org/docs/spec/application_service/r0.1.2#registration).
/// Used for [appservice registration](https://spec.matrix.org/v1.2/application-service-api/#registration).
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Namespaces {
@ -65,7 +65,7 @@ impl Namespaces {
/// To create an instance of this type, first create a `RegistrationInit` and convert it via
/// `Registration::from` / `.into()`.
///
/// Used for [appservice registration](https://matrix.org/docs/spec/application_service/r0.1.2#registration).
/// Used for [appservice registration](https://spec.matrix.org/v1.2/application-service-api/#registration).
#[derive(Clone, Debug, Serialize, Deserialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct Registration {
@ -103,7 +103,7 @@ pub struct Registration {
/// This struct will not be updated even if additional fields are added to `Registration` in a new
/// (non-breaking) release of the Matrix specification.
///
/// Used for [appservice registration](https://matrix.org/docs/spec/application_service/r0.1.2#registration).
/// Used for [appservice registration](https://spec.matrix.org/v1.2/application-service-api/#registration).
#[derive(Debug)]
#[allow(clippy::exhaustive_structs)]
pub struct RegistrationInit {

View File

@ -79,7 +79,7 @@ pub mod v3 {
/// Appservices can [bypass the registration flows][admin] entirely by providing their
/// token in the header and setting this login `type` to `m.login.application_service`.
///
/// [admin]: https://matrix.org/docs/spec/application_service/r0.1.2#server-admin-style-permissions
/// [admin]: https://spec.matrix.org/v1.2/application-service-api/#server-admin-style-permissions
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub login_type: Option<&'a LoginType>,
}

View File

@ -33,7 +33,7 @@ pub enum ErrorKind {
///
/// For more information, see [the spec].
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#soft-logout
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#soft-logout
soft_logout: bool,
},

View File

@ -3,7 +3,7 @@ use serde::{ser::SerializeStruct as _, Deserialize, Serialize, Serializer};
/// Specifies options for [lazy-loading membership events][lazy-loading] on
/// supported endpoints
///
/// [lazy-loading]: https://matrix.org/docs/spec/client_server/r0.6.1#lazy-loading-room-members
/// [lazy-loading]: https://spec.matrix.org/v1.2/client-server-api/#lazy-loading-room-members
#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize)]
#[serde(from = "LazyLoadJsonRepr")]
#[allow(clippy::exhaustive_enums)]

View File

@ -1,6 +1,6 @@
//! Module for [User-Interactive Authentication API][uiaa] types.
//!
//! [uiaa]: https://matrix.org/docs/spec/client_server/r0.6.1#user-interactive-authentication-api
//! [uiaa]: https://spec.matrix.org/v1.2/client-server-api/#user-interactive-authentication-api
use std::{borrow::Cow, fmt};
@ -339,7 +339,7 @@ pub enum AuthType {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#password-based
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#password-based
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.password")]
@ -376,7 +376,7 @@ impl IncomingPassword {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#google-recaptcha
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#google-recaptcha
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.recaptcha")]
@ -406,7 +406,7 @@ impl IncomingReCaptcha {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#email-based-identity-homeserver
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#email-based-identity--homeserver
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.email.identity")]
@ -437,7 +437,7 @@ impl IncomingEmailIdentity {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#phone-number-msisdn-based-identity-homeserver
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#phone-numbermsisdn-based-identity--homeserver
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.msisdn")]
@ -465,7 +465,7 @@ impl IncomingMsisdn {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#dummy-auth
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#dummy-auth
#[derive(Clone, Debug, Default, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.dummy")]
@ -492,7 +492,7 @@ impl IncomingDummy {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://spec.matrix.org/unstable/client-server-api/#token-authenticated-registration
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#token-authenticated-registration
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
#[serde(tag = "type", rename = "m.login.registration_token")]
@ -522,7 +522,7 @@ impl IncomingRegistrationToken {
///
/// See [the spec] for how to use this.
///
/// [the spec]: https://matrix.org/docs/spec/client_server/r0.6.1#fallback
/// [the spec]: https://spec.matrix.org/v1.2/client-server-api/#fallback
#[derive(Clone, Debug, Outgoing, Serialize)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub struct FallbackAcknowledgement<'a> {

View File

@ -1,6 +1,6 @@
//! Common types for [encryption] related tasks.
//!
//! [encryption]: https://matrix.org/docs/spec/client_server/r0.6.1#id76
//! [encryption]: https://spec.matrix.org/v1.2/client-server-api/#end-to-end-encryption
use std::collections::BTreeMap;

View File

@ -1,6 +1,6 @@
//! Common types for the [`m.room.power_levels` event][power_levels].
//!
//! [power_levels]: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-power-levels
//! [power_levels]: https://spec.matrix.org/v1.2/client-server-api/#mroompower_levels
use js_int::{int, Int};
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,6 @@
//! Common types for the [presence module][presence].
//!
//! [presence]: https://matrix.org/docs/spec/client_server/r0.6.1#id62
//! [presence]: https://spec.matrix.org/v1.2/client-server-api/#presence
use ruma_serde::StringEnum;

View File

@ -1,6 +1,6 @@
//! Common types for the [push notifications module][push].
//!
//! [push]: https://matrix.org/docs/spec/client_server/r0.6.1#id89
//! [push]: https://spec.matrix.org/v1.2/client-server-api/#push-notifications
//!
//! ## Understanding the types of this module
//!
@ -438,7 +438,7 @@ impl PusherData {
/// This type can hold an arbitrary string. To check for formats that are not available as a
/// documented variant here, use its string representation, obtained through `.as_str()`.
///
/// [spec]: https://matrix.org/docs/spec/push_gateway/r0.1.1#homeserver-behaviour
/// [spec]: https://spec.matrix.org/v1.2/push-gateway-api/#homeserver-behaviour
#[derive(Clone, Debug, PartialEq, Eq, StringEnum)]
#[ruma_enum(rename_all = "snake_case")]
#[non_exhaustive]

View File

@ -6,7 +6,7 @@ use serde_json::value::RawValue as RawJsonValue;
/// This represents the different actions that should be taken when a rule is matched, and
/// controls how notifications are delivered to the client.
///
/// See <https://matrix.org/docs/spec/client_server/r0.6.1#actions> for details.
/// See [the spec](https://spec.matrix.org/v1.2/client-server-api/#actions) for details.
#[derive(Clone, Debug)]
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
pub enum Action {

View File

@ -1,6 +1,6 @@
///! Constructors for [predefined push rules].
///!
///! [predefined push rules]: https://matrix.org/docs/spec/client_server/r0.6.1#predefined-rules
///! [predefined push rules]: https://spec.matrix.org/v1.2/client-server-api/#predefined-rules
use indexmap::indexset;
use ruma_identifiers::UserId;
@ -12,7 +12,7 @@ use super::{
impl Ruleset {
/// The list of all [predefined push rules].
///
/// [predefined push rules]: https://matrix.org/docs/spec/client_server/r0.6.1#predefined-rules
/// [predefined push rules]: https://spec.matrix.org/v1.2/client-server-api/#predefined-rules
///
/// # Parameters
///

View File

@ -1,6 +1,6 @@
//! Common types for the [third party networks module][thirdparty].
//!
//! [thirdparty]: https://matrix.org/docs/spec/client_server/r0.6.1#id153
//! [thirdparty]: https://spec.matrix.org/v1.2/client-server-api/#third-party-networks
use std::collections::BTreeMap;

View File

@ -1,6 +1,6 @@
//! Common types for the Send-To-Device Messaging
//!
//! [send-to-device]: https://matrix.org/docs/spec/client_server/r0.6.1#id70
//! [send-to-device]: https://spec.matrix.org/v1.2/client-server-api/#send-to-device-messaging
use std::{
convert::TryFrom,

View File

@ -1,6 +1,6 @@
//! Types for the [`m.call.answer`] event.
//!
//! [`m.call.answer`]: https://spec.matrix.org/v1.1/client-server-api/#mcallanswer
//! [`m.call.answer`]: https://spec.matrix.org/v1.2/client-server-api/#mcallanswer
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.call.candidates`] event.
//!
//! [`m.call.candidates`]: https://spec.matrix.org/v1.1/client-server-api/#mcallcandidates
//! [`m.call.candidates`]: https://spec.matrix.org/v1.2/client-server-api/#mcallcandidates
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.call.hangup`] event.
//!
//! [`m.call.hangup`]: https://spec.matrix.org/v1.1/client-server-api/#mcallhangup
//! [`m.call.hangup`]: https://spec.matrix.org/v1.2/client-server-api/#mcallhangup
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.call.invite`] event.
//!
//! [`m.call.invite`]: https://spec.matrix.org/v1.1/client-server-api/#mcallinvite
//! [`m.call.invite`]: https://spec.matrix.org/v1.2/client-server-api/#mcallinvite
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.direct`] event.
//!
//! [`m.direct`]: https://spec.matrix.org/v1.1/client-server-api/#mdirect
//! [`m.direct`]: https://spec.matrix.org/v1.2/client-server-api/#mdirect
use std::{
collections::BTreeMap,

View File

@ -1,6 +1,6 @@
//! Types for the [`m.dummy`] event.
//!
//! [`m.dummy`]: https://spec.matrix.org/v1.1/client-server-api/#mdummy
//! [`m.dummy`]: https://spec.matrix.org/v1.2/client-server-api/#mdummy
use std::fmt;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.forwarded_room_key`] event.
//!
//! [`m.forwarded_room_key`]: https://spec.matrix.org/v1.1/client-server-api/#mforwarded_room_key
//! [`m.forwarded_room_key`]: https://spec.matrix.org/v1.2/client-server-api/#mforwarded_room_key
use ruma_events_macros::EventContent;
use ruma_identifiers::{EventEncryptionAlgorithm, RoomId};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.fully_read`] event.
//!
//! [`m.fully_read`]: https://spec.matrix.org/v1.1/client-server-api/#mfully_read
//! [`m.fully_read`]: https://spec.matrix.org/v1.2/client-server-api/#mfully_read
use ruma_events_macros::EventContent;
use ruma_identifiers::EventId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.ignored_user_list`] event.
//!
//! [`m.ignored_user_list`]: https://spec.matrix.org/v1.1/client-server-api/#mignored_user_list
//! [`m.ignored_user_list`]: https://spec.matrix.org/v1.2/client-server-api/#mignored_user_list
use ruma_events_macros::EventContent;
use ruma_identifiers::UserId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.accept`] event.
//!
//! [`m.key.verification.accept`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationaccept
//! [`m.key.verification.accept`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationaccept
use std::collections::BTreeMap;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.cancel`] event.
//!
//! [`m.key.verification.cancel`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationcancel
//! [`m.key.verification.cancel`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationcancel
use ruma_events_macros::EventContent;
use ruma_identifiers::TransactionId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.done`] event.
//!
//! [`m.key.verification.done`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationdone
//! [`m.key.verification.done`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationdone
use ruma_events_macros::EventContent;
use ruma_identifiers::TransactionId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.key`] event.
//!
//! [`m.key.verification.key`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationkey
//! [`m.key.verification.key`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationkey
use ruma_events_macros::EventContent;
use ruma_identifiers::TransactionId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.mac`] event.
//!
//! [`m.key.verification.mac`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationmac
//! [`m.key.verification.mac`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationmac
use std::collections::BTreeMap;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.ready`] event.
//!
//! [`m.key.verification.ready`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationready
//! [`m.key.verification.ready`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationready
use ruma_events_macros::EventContent;
use ruma_identifiers::{DeviceId, TransactionId};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.request`] event.
//!
//! [`m.key.verification.request`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationrequest
//! [`m.key.verification.request`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationrequest
use ruma_common::MilliSecondsSinceUnixEpoch;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.key.verification.start`] event.
//!
//! [`m.key.verification.start`]: https://spec.matrix.org/v1.1/client-server-api/#mkeyverificationstart
//! [`m.key.verification.start`]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationstart
use std::collections::BTreeMap;
@ -86,9 +86,9 @@ pub enum StartMethod {
/// The `m.reciprocate.v1` verification method.
///
/// The spec entry for this method can be found [here][1].
/// The spec entry for this method can be found [here].
///
/// [1]: https://spec.matrix.org/unstable/client-server-api/#mkeyverificationstartmreciprocatev1
/// [here]: https://spec.matrix.org/v1.2/client-server-api/#mkeyverificationstartmreciprocatev1
ReciprocateV1(ReciprocateV1Content),
/// Any unknown start method.

View File

@ -1,6 +1,6 @@
//! Types for the [`m.policy.rule.room`] event.
//!
//! [`m.policy.rule.room`]: https://spec.matrix.org/v1.1/client-server-api/#mpolicyruleroom
//! [`m.policy.rule.room`]: https://spec.matrix.org/v1.2/client-server-api/#mpolicyruleroom
use ruma_events_macros::EventContent;
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.policy.rule.server`] event.
//!
//! [`m.policy.rule.server`]: https://spec.matrix.org/v1.1/client-server-api/#mpolicyruleserver
//! [`m.policy.rule.server`]: https://spec.matrix.org/v1.2/client-server-api/#mpolicyruleserver
use ruma_events_macros::EventContent;
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.policy.rule.user`] event.
//!
//! [`m.policy.rule.user`]: https://spec.matrix.org/v1.1/client-server-api/#mpolicyruleuser
//! [`m.policy.rule.user`]: https://spec.matrix.org/v1.2/client-server-api/#mpolicyruleuser
use ruma_events_macros::EventContent;
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.push_rules`] event.
//!
//! [`m.push_rules`]: https://spec.matrix.org/v1.1/client-server-api/#mpush_rules
//! [`m.push_rules`]: https://spec.matrix.org/v1.2/client-server-api/#mpush_rules
use ruma_common::push::Ruleset;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.receipt`] event.
//!
//! [`m.receipt`]: https://spec.matrix.org/v1.1/client-server-api/#mreceipt
//! [`m.receipt`]: https://spec.matrix.org/v1.2/client-server-api/#mreceipt
use std::{
collections::BTreeMap,

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.avatar`] event.
//!
//! [`m.room.avatar`]: https://spec.matrix.org/v1.1/client-server-api/#mroomavatar
//! [`m.room.avatar`]: https://spec.matrix.org/v1.2/client-server-api/#mroomavatar
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.canonical_alias`] event.
//!
//! [`m.room.canonical_alias`]: https://spec.matrix.org/v1.1/client-server-api/#mroomcanonical_alias
//! [`m.room.canonical_alias`]: https://spec.matrix.org/v1.2/client-server-api/#mroomcanonical_alias
use ruma_events_macros::EventContent;
use ruma_identifiers::RoomAliasId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.create`] event.
//!
//! [`m.room.create`]: https://spec.matrix.org/v1.1/client-server-api/#mroomcreate
//! [`m.room.create`]: https://spec.matrix.org/v1.2/client-server-api/#mroomcreate
use ruma_events_macros::EventContent;
use ruma_identifiers::{EventId, RoomId, RoomVersionId, UserId};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.encrypted`] event.
//!
//! [`m.room.encrypted`]: https://spec.matrix.org/v1.1/client-server-api/#mroomencrypted
//! [`m.room.encrypted`]: https://spec.matrix.org/v1.2/client-server-api/#mroomencrypted
use std::collections::BTreeMap;
@ -24,7 +24,7 @@ pub struct RoomEncryptedEventContent {
/// Information about related messages for [rich replies].
///
/// [rich replies]: https://matrix.org/docs/spec/client_server/r0.6.1#rich-replies
/// [rich replies]: https://spec.matrix.org/v1.2/client-server-api/#rich-replies
#[serde(flatten, skip_serializing_if = "Option::is_none")]
pub relates_to: Option<Relation>,
}

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.encryption`] event.
//!
//! [`m.room.encryption`]: https://spec.matrix.org/v1.1/client-server-api/#mroomencryption
//! [`m.room.encryption`]: https://spec.matrix.org/v1.2/client-server-api/#mroomencryption
use js_int::UInt;
use ruma_events_macros::EventContent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.guest_access`] event.
//!
//! [`m.room.guest_access`]: https://spec.matrix.org/v1.1/client-server-api/#mroomguest_access
//! [`m.room.guest_access`]: https://spec.matrix.org/v1.2/client-server-api/#mroomguest_access
use ruma_events_macros::EventContent;
use ruma_serde::StringEnum;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.history_visibility`] event.
//!
//! [`m.room.history_visibility`]: https://spec.matrix.org/v1.1/client-server-api/#mroomhistory_visibility
//! [`m.room.history_visibility`]: https://spec.matrix.org/v1.2/client-server-api/#mroomhistory_visibility
use ruma_events_macros::EventContent;
use ruma_serde::StringEnum;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.join_rules`] event.
//!
//! [`m.room.join_rules`]: https://spec.matrix.org/v1.1/client-server-api/#mroomjoin_rules
//! [`m.room.join_rules`]: https://spec.matrix.org/v1.2/client-server-api/#mroomjoin_rules
use std::{borrow::Cow, collections::BTreeMap};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.member`] event.
//!
//! [`m.room.member`]: https://spec.matrix.org/v1.1/client-server-api/#mroommember
//! [`m.room.member`]: https://spec.matrix.org/v1.2/client-server-api/#mroommember
use std::collections::BTreeMap;
@ -383,7 +383,7 @@ impl RoomMemberEvent {
///
/// Check [the specification][spec] for details.
///
/// [spec]: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-member
/// [spec]: https://spec.matrix.org/v1.2/client-server-api/#mroommember
pub fn membership_change(&self) -> MembershipChange {
membership_change(&self.content, self.prev_content.as_ref(), &self.sender, &self.state_key)
}
@ -394,7 +394,7 @@ impl SyncStateEvent<RoomMemberEventContent> {
///
/// Check [the specification][spec] for details.
///
/// [spec]: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-member
/// [spec]: https://spec.matrix.org/v1.2/client-server-api/#mroommember
pub fn membership_change(&self) -> MembershipChange {
membership_change(&self.content, self.prev_content.as_ref(), &self.sender, &self.state_key)
}
@ -405,7 +405,7 @@ impl StrippedStateEvent<RoomMemberEventContent> {
///
/// Check [the specification][spec] for details.
///
/// [spec]: https://matrix.org/docs/spec/client_server/r0.6.1#m-room-member
/// [spec]: https://spec.matrix.org/v1.2/client-server-api/#mroommember
pub fn membership_change(&self) -> MembershipChange {
membership_change(&self.content, None, &self.sender, &self.state_key)
}

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.message`] event.
//!
//! [`m.room.message`]: https://spec.matrix.org/v1.1/client-server-api/#mroommessage
//! [`m.room.message`]: https://spec.matrix.org/v1.2/client-server-api/#mroommessage
use std::{borrow::Cow, fmt};
@ -38,7 +38,7 @@ pub struct RoomMessageEventContent {
/// Information about related messages for [rich replies].
///
/// [rich replies]: https://matrix.org/docs/spec/client_server/r0.6.1#rich-replies
/// [rich replies]: https://spec.matrix.org/v1.2/client-server-api/#rich-replies
#[serde(flatten, skip_serializing_if = "Option::is_none")]
pub relates_to: Option<Relation>,
}

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.message.feedback`] event.
//!
//! [`m.room.message.feedback`]: https://spec.matrix.org/v1.1/client-server-api/#mroommessagefeedback
//! [`m.room.message.feedback`]: https://spec.matrix.org/v1.2/client-server-api/#mroommessagefeedback
use ruma_events_macros::EventContent;
use ruma_identifiers::EventId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.name`] event.
//!
//! [`m.room.name`]: https://spec.matrix.org/v1.1/client-server-api/#mroomname
//! [`m.room.name`]: https://spec.matrix.org/v1.2/client-server-api/#mroomname
use ruma_events_macros::EventContent;
use ruma_identifiers::RoomName;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.pinned_events`] event.
//!
//! [`m.room.pinned_events`]: https://spec.matrix.org/v1.1/client-server-api/#mroompinned_events
//! [`m.room.pinned_events`]: https://spec.matrix.org/v1.2/client-server-api/#mroompinned_events
use ruma_events_macros::EventContent;
use ruma_identifiers::EventId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.power_levels`] event.
//!
//! [`m.room.power_levels`]: https://spec.matrix.org/v1.1/client-server-api/#mroompower_levels
//! [`m.room.power_levels`]: https://spec.matrix.org/v1.2/client-server-api/#mroompower_levels
use std::collections::BTreeMap;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.redaction`] event.
//!
//! [`m.room.redaction`]: https://spec.matrix.org/v1.1/client-server-api/#mroomredaction
//! [`m.room.redaction`]: https://spec.matrix.org/v1.2/client-server-api/#mroomredaction
use ruma_common::MilliSecondsSinceUnixEpoch;
use ruma_events_macros::{Event, EventContent};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.server_acl`] event.
//!
//! [`m.room.server_acl`]: https://spec.matrix.org/v1.1/client-server-api/#mroomserver_acl
//! [`m.room.server_acl`]: https://spec.matrix.org/v1.2/client-server-api/#mroomserver_acl
use ruma_events_macros::EventContent;
use ruma_identifiers::ServerName;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.third_party_invite`] event.
//!
//! [`m.room.third_party_invite`]: https://spec.matrix.org/v1.1/client-server-api/#mroomthird_party_invite
//! [`m.room.third_party_invite`]: https://spec.matrix.org/v1.2/client-server-api/#mroomthird_party_invite
use ruma_events_macros::EventContent;
use ruma_serde::Base64;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.tombstone`] event.
//!
//! [`m.room.tombstone`]: https://spec.matrix.org/v1.1/client-server-api/#mroomtombstone
//! [`m.room.tombstone`]: https://spec.matrix.org/v1.2/client-server-api/#mroomtombstone
use ruma_events_macros::EventContent;
use ruma_identifiers::RoomId;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room.topic`] event.
//!
//! [`m.room.topic`]: https://spec.matrix.org/v1.1/client-server-api/#mroomtopic
//! [`m.room.topic`]: https://spec.matrix.org/v1.2/client-server-api/#mroomtopic
use ruma_events_macros::EventContent;
use serde::{Deserialize, Serialize};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room_key`] event.
//!
//! [`m.room_key`]: https://spec.matrix.org/v1.1/client-server-api/#mroom_key
//! [`m.room_key`]: https://spec.matrix.org/v1.2/client-server-api/#mroom_key
use ruma_events_macros::EventContent;
use ruma_identifiers::{EventEncryptionAlgorithm, RoomId};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.room_key_request`] event.
//!
//! [`m.room_key_request`]: https://spec.matrix.org/v1.1/client-server-api/#mroom_key_request
//! [`m.room_key_request`]: https://spec.matrix.org/v1.2/client-server-api/#mroom_key_request
use ruma_events_macros::EventContent;
use ruma_identifiers::{DeviceId, EventEncryptionAlgorithm, RoomId, TransactionId};

View File

@ -1,6 +1,6 @@
//! Types for the [`m.secret.request`] event.
//!
//! [`m.secret.request`]: https://spec.matrix.org/v1.1/client-server-api/#msecretrequest
//! [`m.secret.request`]: https://spec.matrix.org/v1.2/client-server-api/#msecretrequest
use std::convert::TryFrom;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.secret.send`] event.
//!
//! [`m.secret.send`]: https://spec.matrix.org/v1.1/client-server-api/#msecretsend
//! [`m.secret.send`]: https://spec.matrix.org/v1.2/client-server-api/#msecretsend
use ruma_events_macros::EventContent;
use ruma_identifiers::TransactionId;

View File

@ -1,6 +1,6 @@
//! Types for the `m.space` events.
//!
//! See [the unstable specification](https://spec.matrix.org/unstable/client-server-api/#spaces).
//! See [the specification](https://spec.matrix.org/v1.2/client-server-api/#spaces).
pub mod child;
pub mod parent;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.space.child`] event.
//!
//! [`m.space.child`]: https://spec.matrix.org/unstable/client-server-api/#mspacechild
//! [`m.space.child`]: https://spec.matrix.org/v1.2/client-server-api/#mspacechild
use ruma_events_macros::EventContent;
use ruma_identifiers::ServerName;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.space.parent`] event.
//!
//! [`m.space.parent`]: https://spec.matrix.org/unstable/client-server-api/#mspaceparent
//! [`m.space.parent`]: https://spec.matrix.org/v1.2/client-server-api/#mspaceparent
use ruma_events_macros::EventContent;
use ruma_identifiers::ServerName;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.sticker`] event.
//!
//! [`m.sticker`]: https://spec.matrix.org/v1.1/client-server-api/#msticker
//! [`m.sticker`]: https://spec.matrix.org/v1.2/client-server-api/#msticker
use ruma_events_macros::EventContent;
use ruma_identifiers::MxcUri;

View File

@ -1,6 +1,6 @@
//! Types for the [`m.tag`] event.
//!
//! [`m.tag`]: https://spec.matrix.org/v1.1/client-server-api/#mtag
//! [`m.tag`]: https://spec.matrix.org/v1.2/client-server-api/#mtag
use std::{collections::BTreeMap, error::Error, fmt, str::FromStr};
@ -88,7 +88,7 @@ pub enum TagName {
LowPriority,
/// `m.server_notice`: Used to identify
/// [Server Notice Rooms](https://matrix.org/docs/spec/client_server/r0.6.1#module-server-notices).
/// [Server Notice Rooms](https://spec.matrix.org/v1.2/client-server-api/#server-notices).
ServerNotice,
/// `u.*`: User-defined tag

View File

@ -1,6 +1,6 @@
//! Types for the [`m.typing`] event.
//!
//! [`m.typing`]: https://spec.matrix.org/v1.1/client-server-api/#mtyping
//! [`m.typing`]: https://spec.matrix.org/v1.2/client-server-api/#mtyping
use ruma_events_macros::EventContent;
use ruma_identifiers::UserId;

View File

@ -4,7 +4,9 @@
//! to prepare a leave event to get out of the room.
pub mod v1 {
//! [GET /_matrix/federation/v1/make_leave/{roomId}/{userId}](https://matrix.org/docs/spec/server_server/r0.1.4#get-matrix-federation-v1-make-leave-roomid-userid)
//! `/v1/` ([spec])
//!
//! [spec]: https://spec.matrix.org/v1.2/server-server-api/#get_matrixfederationv1make_leaveroomiduserid
use ruma_api::ruma_api;
use ruma_identifiers::{RoomId, RoomVersionId, UserId};

View File

@ -1,8 +1,8 @@
//! A module to deserialize a response from incorrectly specified endpoint:
//!
//! - [PUT /_matrix/federation/v1/send_join/{roomId}/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v1-send-join-roomid-eventid)
//! - [PUT /_matrix/federation/v1/invite/{roomId}/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v1-invite-roomid-eventid)
//! - [PUT /_matrix/federation/v1/send_leave/{roomId}/{eventId}](https://matrix.org/docs/spec/server_server/r0.1.4#put-matrix-federation-v1-send-leave-roomid-eventid)
//! - [PUT /_matrix/federation/v1/send_join/{roomId}/{eventId}](https://spec.matrix.org/v1.2/server-server-api/#put_matrixfederationv1send_joinroomideventid)
//! - [PUT /_matrix/federation/v1/invite/{roomId}/{eventId}](https://spec.matrix.org/v1.2/server-server-api/#put_matrixfederationv1inviteroomideventid)
//! - [PUT /_matrix/federation/v1/send_leave/{roomId}/{eventId}](https://spec.matrix.org/v1.2/server-server-api/#put_matrixfederationv1send_leaveroomideventid)
//!
//! For more information, see this [GitHub issue][issue].
//!

View File

@ -97,7 +97,7 @@ pub enum MxcUriError {
/// Media identifier malformed due to invalid characters detected.
///
/// Valid characters are (in regex notation) `[A-Za-z0-9_-]+`.
/// See [here](https://matrix.org/docs/spec/client_server/r0.6.1#id408) for more details.
/// See [here](https://spec.matrix.org/v1.2/client-server-api/#security-considerations-5) for more details.
#[error("Media Identifier malformed, invalid characters")]
MediaIdMalformed,

View File

@ -17,7 +17,7 @@ pub fn validate(uri: &str) -> Result<NonZeroU8, MxcUriError> {
let server_name = &uri[..index];
let media_id = &uri[index + 1..];
// See: https://matrix.org/docs/spec/client_server/r0.6.1#id69
// See: https://spec.matrix.org/v1.2/client-server-api/#security-considerations-5
let media_id_is_valid =
media_id.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'A'..=b'Z' | b'-' ));

View File

@ -18,14 +18,14 @@ pub fn validate(s: &str) -> Result<(), Error> {
/// due to Synapse allowing them over federation. This will likely be fixed in an upcoming room
/// version; see <https://github.com/matrix-org/matrix-doc/pull/2828>.
pub fn localpart_is_fully_conforming(localpart: &str) -> Result<bool, Error> {
// See https://matrix.org/docs/spec/appendices#user-identifiers
// See https://spec.matrix.org/v1.2/appendices/#user-identifiers
let is_fully_conforming = localpart
.bytes()
.all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'-' | b'.' | b'=' | b'_' | b'/'));
// If it's not fully conforming, check if it contains characters that are also disallowed
// for historical user IDs. If there are, return an error.
// See https://matrix.org/docs/spec/appendices#historical-user-ids
// See https://spec.matrix.org/v1.2/appendices/#historical-user-ids
#[cfg(not(feature = "compat"))]
if !is_fully_conforming && localpart.bytes().any(|b| b < 0x21 || b == b':' || b > 0x7E) {
Err(Error::InvalidCharacters)

View File

@ -9,7 +9,7 @@ use crate::ServerName;
///
/// # Room versions
///
/// Matrix specifies multiple [room versions](https://matrix.org/docs/spec/#room-versions) and the
/// Matrix specifies multiple [room versions](https://spec.matrix.org/v1.2/#room-versions) and the
/// format of event identifiers differ between them. The original format used by room versions 1 and
/// 2 uses a short pseudorandom "localpart" followed by the hostname and port of the originating
/// homeserver. Later room versions change event identifiers to be a hash of the event encoded with

View File

@ -1,6 +1,6 @@
//! A URI that should be a Matrix-spec compliant [MXC URI].
//!
//! [MXC URI]: https://matrix.org/docs/spec/client_server/r0.6.1#mxc-uri
//! [MXC URI]: https://spec.matrix.org/v1.2/client-server-api/#matrix-content-mxc-uris
use std::num::NonZeroU8;
@ -12,7 +12,7 @@ type Result<T, E = MxcUriError> = std::result::Result<T, E>;
/// A URI that should be a Matrix-spec compliant [MXC URI].
///
/// [MXC URI]: https://matrix.org/docs/spec/client_server/r0.6.1#mxc-uri
/// [MXC URI]: https://spec.matrix.org/v1.2/client-server-api/#matrix-content-mxc-uris
#[repr(transparent)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]

View File

@ -183,7 +183,7 @@ where
/// Converts an event into the [canonical] string form.
///
/// [canonical]: https://matrix.org/docs/spec/appendices#canonical-json
/// [canonical]: https://spec.matrix.org/v1.2/appendices/#canonical-json
///
/// # Parameters
///

View File

@ -128,7 +128,7 @@ pub fn auth_check<E: Event>(
let sender = incoming_event.sender();
// Implementation of https://matrix.org/docs/spec/rooms/v1#authorization-rules
// Implementation of https://spec.matrix.org/v1.2/rooms/v1/#authorization-rules
//
// 1. If type is m.room.create:
if *incoming_event.event_type() == EventType::RoomCreate {

View File

@ -60,7 +60,7 @@ pub struct RoomVersion {
pub extra_redaction_checks: bool,
/// Allow knocking in event authentication.
///
/// See: <https://spec.matrix.org/v1.1/rooms/v7/> for more information.
/// See [room v7 specification](https://spec.matrix.org/v1.2/rooms/v7/) for more information.
pub allow_knocking: bool,
/// Adds support for the restricted join rule.
///

View File

@ -108,7 +108,7 @@ pub use ruma_state_res as state_res;
/// (De)serializable types for various [Matrix APIs][apis] requests and responses and abstractions
/// for them.
///
/// [apis]: https://matrix.org/docs/spec/#matrix-apis
/// [apis]: https://spec.matrix.org/v1.2/#matrix-apis
#[cfg(feature = "api")]
pub mod api {
pub use ruma_api::*;