This patch transforms Markdown soft line breaks into hard line breaks when rendering to HTML. The [CommonMark specification about soft line breaks](https://spec.commonmark.org/0.30/#soft-line-breaks) specifies: > A renderer may also provide an option to render soft line breaks as > hard line breaks. Refering to https://github.com/vector-im/element-x-ios/issues/1418, some people are expecting to get soft line breaks rendered at hard ones. This patch updates the Markdown test to include this conversion of soft to hard line breaks. It includes a list and a code block, to ensure not _all_ soft breaks are transformed into hard breaks; only the ones we expect.
18 KiB
18 KiB
[unreleased]
Bug fixes:
- Set the predefined server-default
.m.rule.tombstone
push rule as enabled by default, as defined in the spec. - Parse
m.tag
order
as a f64 value or a stringified f64 value, if thecompat-tag-info
feature is enabled.
Breaking changes:
- Make
in_reply_to
field ofThread
optional- It was wrong to be mandatory, spec was unclear (clarified here)
FlattenedJson::get
returns aFlattenedJsonValue
instead of a string- Remove the
DontNotify
andCoalesce
variants ofpush::Action
according to MSC3987- Old push rules will still deserialize successfully but the
Coalesce
variant will not returntrue
forAction::should_notify()
anymore
- Old push rules will still deserialize successfully but the
- Remove
AnswerSessionDescription
andOfferSessionDescription
types, useSessionDescription
instead.- Remove
SessionDescriptionType
, use aString
instead. A clarification in MSC2746 / Matrix 1.7 explains that thetype
field should not be validated but passed as-is to the WebRTC API. It also avoids an unnecessary conversion between the WebRTC API and the Ruma type.
- Remove
- The
reason
field inCallHangupEventContent
is now required and defaults toReason::UserHangup
(MSC2746 / Matrix 1.7) - The
Replacement
relation forRoomMessageEventContent
now takes aRoomMessageEventContentWithoutRelation
instead of aMessageType
- Make the
redacts
field ofOriginal(Sync)RoomRedactionEvent
optional to handle the format where theredacts
key is moved inside thecontent
, as introduced in room version 11, according to MSC2174 / MSC3820RoomRedactionEventContent::new()
was renamed tonew_v1()
, andwith_reason()
is no longer a constructor but a builder-type method
- Make the
creator
field ofRoomCreateEventContent
optional and deprecate it, as it was removed in room version 11, according to MSC2175 / MSC3820RoomCreateEventContent::new()
was renamed tonew_v1()
RedactedRoomCreateEventContent
is now a typedef overRoomCreateEventContent
- Add preserved fields to match the new redaction algorithm in room version 11, according to
MSC2176 / MSC3821 / MSC3820, for the following types:
RedactedRoomRedactionEventContent
,RedactedRoomPowerLevelsEventContent
,RedactedRoomMemberEventContent
RoomMessageEventContent::make_reply_to()
andmake_for_thread()
have an extra parameter to support the recommended behavior for intentional mentions in replies according to Matrix 1.7- In Markdown, soft line breaks are transformed into hard line breaks when compiled into HTML.
Improvements:
- Add convenience methods for
push::Ruleset
:- To update the server-default push rules
- To remove a user-defined push rule
- Add
AsRef<[u8]>
implementations for identifier types - Add
InitialStateEvent::{new, to_raw, to_raw_any}
- Add a convenience method to construct
RoomEncryptionEventContent
with the recommended defaults. PushCondition::EventMatch
andFlattenedJson
now use escaped dotted paths (MSC3873 / Matrix 1.7)- Add support for
event_property_is
push condition (MSC3758 / Matrix 1.7) - Add support for
event_property_contains
push condition (MSC3966 / Matrix 1.7) - Add
FullStateEventContent::redact
- Add new methods for
RoomPowerLevels
:user_can_ban
user_can_invite
user_can_kick
user_can_redact
user_can_send_message
user_can_send_state
user_can_trigger_room_notification
- Add
MessageType::sanitize
behind theunstable-sanitize
feature - Add
MatrixVersion::V1_7
- Stabilize support for annotations and reactions (MSC2677 / Matrix 1.7)
- Add support for intentional mentions push rules (MSC3952 / Matrix 1.7)
- Stabilize support for VoIP signalling improvements (MSC2746 / Matrix 1.7)
- Make the generated and stripped plain text reply fallback behavior more compatible with most of the Matrix ecosystem.
- Add support for intentional mentions according to MSC3952 / Matrix 1.7
0.11.3
Bug fixes:
- Move
.m.rule.roomnotif
push rule before.m.rule.tombstone
in the server default push rules, according to a spec clarification in Matrix 1.6
Improvements:
- Add
MatrixVersion::V1_6
- Stabilize support for fixed base64 for SAS verification (MSC3783 / Matrix 1.6)
- Deprecate
MessageAuthenticationCode::HkdfHmacSha256
- Deprecate
0.11.2
Bug fixes:
- Don't accept colons in the localpart given to
UserId::parse_with_servername
even withfeature = "compat"
Improvements:
- Derive
Hash
forReceiptType
andReceiptThread
- Update
EventContent
derive macro to emit new type definitions and type aliases under the same visibility as the input type (this fixes a future- compatibility warning when derivingEventContent
on a non-pub
type)
0.11.1
Improvements:
- Make alternate Debug representation of
MilliSecondsSinceUnixEpoch
andSecondsSinceUnixEpoch
more compact (remove newlines)
0.11.0
Bug fixes:
- HTML-relevant characters (
<
,>
, etc) in plaintext replies are now escaped during creation of the rich reply - Don't include sensitive information in
Debug
-format of types from theevents::key
andevents::secret
modules - Fix deserialization of
RoomMessageEventContent
andRoomEncryptedEventContent
when there is no relation - Fix deserialization of
StateUnsigned
when theprev_content
is redacted - Allow to deserialize
PushCondition
with unknown kind - Allow to deserialize
push::Action
with unknown value - Only percent-encode reserved characters in endpoint URL path
Breaking changes:
- Remove deprecated
EventType
enum - Remove deprecated constructors for
RoomMessageEventContent
- Remove
serde::vec_as_map_of_empty
from the public API - Remove the
api::AuthScheme::QueryOnlyAccessToken
variant, which is no longer used - The
#[ruma_api(header)]
attribute of theruma_api
macro now accepts an arbitraryhttp::header::HeaderName
- To continue using constants from
http::header
, they must be imported in the module calling the macro.
- To continue using constants from
- Make
name
optional onSecretStorageKeyEventContent
. Default constructor has been adjusted as well to not require this field. - Rename
push::PusherData
toHttpPusherData
and make theurl
field required - Remove
Ruleset::add
and the implementation ofExtend<AnyPushRule>
forRuleset
- Make
EndpointError
construction infallibleEndpointError::try_from_http_request
has been replaced byEndpointError::from_http_request
FromHttpResponseError<E>::Server
now containsE
instead ofServerError<E>
ServerError<E>
has been removedMatrixError
is now an enum with theJson
variant containing the previous fields
- Change the
ignored_users
field ofIgnoredUserListEventContent
to a map of empty structs, to allow eventual fields to be added, as intended by the spec - Make
SimplePushRule
and associated types generic over the expected type of therule_id
- Deduplicate and group relation structs in
events::relation
:- Move relation structs under
events::room::message
toevents::relation
- Move common relation structs under
events::room::encrypted
toevents::relation
and remove duplicate types - Remove
events::reaction::Relation
and useevents::relation::Annotation
instead - Remove
events::key::verification::Relation
and useevents::relation::Reference
instead
- Move relation structs under
- Rename
events::relation::Relations
toBundledRelations
- Make the
redacted_because
field inUnsignedRedacted
non-optional and replace parameterlessnew
constructor by one that takes a redaction event (likenew_because
previously, which is now removed) - Move the
Unsigned
associated type fromStateEventContent
toOriginalStateEventContent
Redacted*EventContent
s don't have anunsigned
type anymore
- Remove the
serde::urlencoded
module- Query string (de)serialization is now done by the
serde_html_form
crate
- Query string (de)serialization is now done by the
- Rename
RoomEventType
toTimelineEventType
- Remove
SecretStorageKeyEventContent
's implementation ofDeserialize
- Use
EventContentFromType::from_parts
instead
- Use
- Remove
StateUnsignedFromParts
- Replace it with a bound on
DeserializeOwned
- Replace it with a bound on
- Remove
Raw::deserialize_content
- Instead, use
.deserialize_as::<T>()
or.cast_ref::<T>().deserialize_with_type()
- Instead, use
- Remove
EventContent::from_parts
- Replace it with
EventContentFromType::from_parts
- Replace it with
- The
serde::StringEnum
derive now also generates aDebug
implementation
Improvements:
- Add
MatrixVersion::V1_4
andMatrixVersion::V1_5
- Stabilize default room server ACL push rule
- Stabilize
room_types
indirectory::Filter
androom_type
indirectory::PublicRoomsChunk
- Stabilize support for private read receipts
- Add stable support for threads
- Move
Relation::Thread
and associated types and methods out ofunstable-msc3440
- Add parameter to
RoomMessageEventContent::make_reply_to
to be thread-aware - Add
RoomMessageEventContent::make_for_reply
- Move
- Stabilize support for event replacements (edits)
- Add support for read receipts for threads (MSC3771 / Matrix 1.4)
- Add
push::PredefinedRuleId
and associated types as a list of predefined push rule IDs - Add convenience methods to
Ruleset
Ruleset::get
to access a push ruleRuleset::insert
to add or update user push rulesRuleset::set_enabled
to change the enabled state of push rulesRuleset::set_actions
to change the actions of push rules
- Add support for bundled reference relations (MSC3267 / Matrix 1.5)
- Add the
formatted
field onKeyVerificationRequestEventContent
(Matrix 1.5) - Add
content
accessors forAny*StateEvent
enums - Add the
DebugAsRefStr
derive macro toruma_common::serde
0.10.5
Improvements:
- Add support for
#[incoming_derive(!Debug)]
to theIncoming
derive macro
0.10.4
Bug fixes:
- Fix
MatrixToUri
parsing for non-url-encoded room aliases
0.10.3
Bug fixes:
- Fix ruma-common not compiling with the Cargo features
events
andunstable-msc2677
active, andunstable-msc2676
inactive
0.10.2
Improvements:
- Add
relations
accessors to event enum types:AnyMessageLikeEvent
andAnySyncMessageLikeEvent
AnyStateEvent
andAnySyncStateEvent
AnyTimelineEvent
andAnySyncTimelineEvent
0.10.1
Improvements:
- Add
RoomMessageEventContent::make_reply_to
- Deprecate reply constructors in favor of the new method
0.10.0
Bug fixes:
- Expose
MatrixIdError
,MatrixToError
,MatrixUriError
andMxcUriError
at the crate root - Fix matching of
event_match
condition- The spec clarified its behavior: https://github.com/matrix-org/matrix-spec-proposals/pull/3690
Breaking changes:
- Add
user_id
field toPushConditionRoomCtx
- Remove
PartialEq
implementation onNotificationPowerLevels
- Remove
PartialEq
implementation forevents::call::SessionDescription
- Use new
events::call::AnswerSessionDescription
forCallAnswerEventContent
andOfferSessionDescription
forCallInviteEventContent
- Use new
VoipVersionId
andVoipId
types forevents::call
events - Remove
RoomName
/OwnedRoomName
and replace usages withstr
/String
- Room name size limits were never enforced by servers (Spec change removing the size limit)
- Remove
RoomMessageFeedbackEvent
and associated types and variants according to MSC3582 - Move
CanonicalJson
,CanonicalJsonObject
andCanonicalJsonError
out of theserde
module and behind the cargo feature flagcanonical-json
- Make identifiers matrix URI constructors generic over owned parameters
- Split
RoomId
matrix URI constructors between methods with and without routing
- Split
- Allow to add routing servers to
RoomId::matrix_to_event_uri()
- Move
receipt::ReceiptType
toevents::receipt
- Make
Clone
as supertrait ofapi::OutgoingRequest
- Rename
Any[Sync]RoomEvent
toAny[Sync]TimelineEvent
RoomMemberEvent
and related types now have a custom unsigned type including theinvite_room_state
field, instead of theStateUnsigned
type used by other state events
Improvements:
- All push rules are now considered to not apply to events sent by the user themselves
- Change
events::relation::BundledAnnotation
to a struct instead of an enum- Remove
BundledReaction
- Remove
- Add unstable support for polls (MSC3381)
- Add unstable support for Improved Signalling for 1:1 VoIP (MSC2746)
- Add support for knocking in
events::room::member::MembershipChange
- Add
MatrixVersion::V1_3
- Deprecate the
sender_key
anddevice_id
fields for encrypted events (MSC3700) - Move the
relations
field ofevents::unsigned
types out ofunstable-msc2675
- Deserialize stringified integers for power levels without the
compat
feature - Add
JoinRule::KnockRestricted
(MSC3787) - Add
MatrixVersionId::V10
(MSC3604) - Add methods to sanitize messages according to the spec behind the
unstable-sanitize
feature- Can also remove rich reply fallbacks
- Implement
From<Owned*Id>
foridentifiers::matrix_uri::MatrixId
- Add unstable default push rule to ignore room server ACLs events (MSC3786)
- Add unstable support for private read receipts (MSC2285)
- Add unstable support for filtering public rooms by room type (MSC3827)
0.9.2
Bug fixes:
- Fix serialization and deserialization of events with a dynamic
event_type
0.9.1
Improvements:
- Add
StrippedPowerLevelsEvent::power_levels
- Add (
Sync
)RoomMemberEvent::membership
- Export
events::room::member::Change
- Prior to this, you couldn't actually do anything with the
membership_change
functions on various member event types
- Prior to this, you couldn't actually do anything with the
0.9.0
Bug fixes:
- Change default
invite
power level to0
- The spec was determined to be wrong about the default: https://github.com/matrix-org/matrix-spec/pull/1021
Breaking changes:
- Several ruma crates have been merged into
ruma-common
ruma-api
has moved intoapi
, behind a feature flagruma-events
has moved intoevents
, behind a feature flagruma-identifiers
types are available at the root of the crateruma-serde
has moved intoserde
- The
events::*MessageEvent
types have been renamed to*MessageLikeEvent
- Change
events::room
media types to accept either a plain file or an encrypted file, not both simultaneously - Change
events::room
media types to useDuration
where applicable - Move
prev_content
intounsigned
- Rename
identifiers::Error
toIdParseError
- Fix the
RoomMessageEventContent::*_reply_plain
methods that now return a message with aformatted_body
, according to the spec. Therefore, they only acceptOriginalRoomMessageEvent
s like their HTML counterparts. - Update the
state_key
field of state events to be of a different type depending on the content type. You now no longer need to validate manually thatm.room.member
events have a user ID as their state key!
Improvements:
- Add unstable support for extensible events (MSCs 1767, 3551, 3552, 3553, 3246, 3488)
- Add unstable support for translatable text content (MSC3554)
- Add unstable support for voice messages (MSC3245)
- Add unstable support for threads (MSC3440)
- Add
ReceiptEventContent::user_receipt
- Make
Restricted::allow
public - Conversion from
RoomPowerLevels
toRoomPowerLevelsEventContent
0.8.0
Breaking changes:
- Update
ruma-identifiers
dependency
0.7.0
Breaking changes:
- Update
ruma-identifiers
dependency - Use new
Base64
type forkey
field ofSignedKey
0.6.0
Breaking changes:
- Make a few enums non-exhaustive
- Upgrade dependencies
0.5.4
Improvements:
- Add
to_device
module containingDeviceIdOrAllDevices
0.5.3
Improvements:
- Add
instance_id
field toProtocolInstance[Init]
under theunstable-pre-spec
feature
0.5.2
Improvements:
- Add
thirdparty::ThirdPartyIdentifier
0.5.1
Improvements:
- Add
receipt::ReceiptType
- Add
MilliSecondsSinceUnixEpoch
andSecondsSinceUnixEpoch
types - Bump dependency versions
0.5.0
Breaking changes:
- Rename
push::RulesetIter
topush::RulesetIntoIter
- Change the return type of
push::Ruleset::get_actions
from an iterator to a slice
Improvements:
- Add
push::Ruleset::iter()
for borrowing iteration of rulesets - Add conversions between
AnyPushRule
andAnyPushRuleRef
(AnyPushRule::as_ref
andAnyPushRuleRef::to_owned
) - Add
push::Ruleset::get_match()
for finding the first matching push rule for an event. This is pretty much the same thing asget_actions()
but returns the entire push rule, not just its actions.
0.4.0
Breaking changes:
- Use
ruma_identifiers::MxcUri
instead ofString
foravatar_url
field indirectory::PublicRoomsChunk
- Use
ruma_identifiers::RoomId
instead ofString
forroom_id
field inpush::PushConditionRoomCtx
- Upgrade ruma-identifiers dependency to 0.19.0
0.3.1
Bug fixes:
- Fix
push::PushCondition::applies
for empty value and pattern
0.3.0
Breaking changes:
- Update set of conversion trait implementations for enums
- Replace
Vec
byIndexSet
inpush::Ruleset
- Replace
push::AnyPushRule
with an enum (the original struct still exists as justPushRule
inruma-client-api
) - … (there's a lot more, but this changelog was not kept up to date; PRs to improve it are welcome)
Improvements:
- Add the
thirdparty
module - Add
directory::{Filter, PublicRoomsChunk, RoomNetwork}
(moved fromruma_client_api::r0::directory
) - Add
push::{PusherData, PushFormat}
(moved fromruma_client_api::r0::push
) - Add
authentication::TokenType
(moved fromruma_client_api::r0::account:request_openid_token
) - Add an
IntoIterator
implementation forRuleset
- Add
push::Ruleset::get_actions
- Add
push::PushCondition::applies
- Add
push::{FlattenedJson, PushConditionRoomCtx}
- Add
0.2.0
Breaking changes:
- Make most types defined by the crate
#[non_exhaustive]