42 KiB
Changelog
Unreleased
Improvements:
- The
IdDstmacro generatesBorrow<str>implementations for the borrowed and owned identifier structs.
0.18.0
Breaking changes:
- The variants of
CanonicalJsonErrorvariants changed. to_canonical_value()has stricter rules, it now returns errors for the following cases which were never documented to work in the first place:- Serializing bytes.
- Serializing booleans and integers as keys for an object.
- Serializing the same key twice in an object.
- The
canonical-jsonfeature was removed. Thecanonical_jsonmodule is no longer gated behind a cargo feature. - The
IdDstmacro doesn't generate methods and trait implementations anymore forBox{id},Arc<id>andRc<{id}>. UsingOwned{id}should be preferred. EventId::new()was renamed toEventId::new_v1(), since it works only for the first format of event IDs.- The
NoAuthenticationauthentication scheme doesn't take aSendAccessTokenas input anymore, because it doesn't make sense to be able to send access tokens for APIs that don't use them as a form of authentication. The newNoAccessTokenauthentication scheme should be used instead for APIs that rely on access tokens as a form of authentication. - It is no longer possible to construct custom
Actiontypes directly through the hidden_Customvariant. They should be constructed withAction::new()and their data should be accessed withAction::data(). - The
Tweaktype uses stronger enum types for its variants, and theCustomvariant is now hidden and cannot be constructed directly. It should be constructed withTweak::new()and its data should be accessed withTweak::set_tweak()andTweak::value(). - The struct variants of
PushConditionare now tuple variants containing a non-exhaustive struct. JsonTypewas renamed toCanonicalJsonTypeto reflect that it only represents the possible types of aCanonicalJsonValue. It can also be accessed withCanonicalJsonValue::json_type().- Refactor and improve the variants of
RedactionError:NotOfTypewas renamed toInvalidTypeand provides more details about the invalid field.JsonFieldMissingFromObjectwas renamed toMissingFieldan provides the full path of the missing field.
redact_content_in_place()is now infallible.MatrixErrorandMatrixErrorBodywere renamed toErrorandErrorBodyrespectively. TheMatrixprefix is redundant in a crate about the Matrix protocol.- The
errormodule fromruma-client-apiwas merged into theapi::errormodule.Erroris now non-exhaustive andErrorBodyhas a newStandardvariant.
Improvements:
- Add
canonical_json::Serializer, which allows to serialize a type directly to aCanonicalJsonValue, with stricter rules thanserde_json::value::Serializer. This serializer is also used into_canonical_value(). - Add the
assert_to_canonical_json_eq!macro that can be used in tests to check the canonical JSON serialization of a type against its expected value. - Add crate-internal
into_raw()/from_raw()helpers forIdDstowned IDs and use them inOwnedRoomId/OwnedRoomAliasId<->OwnedRoomOrAliasIdconversions. - Use raw ownership transfer for conversions from
OwnedDeviceIdandOwnedBase64PublicKeytoOwnedBase64PublicKeyOrDeviceId. - Identifier types implement
(Try)From<Box<str>>,(Try)From<Cow<'a, str>>andPartialEq<Cow<'a, str>>and conversions between owned types try not to reallocate when possible. - Add
EventId::new_v2_or_v3()to construct event IDs formats which are based on the event reference hash. - Add
RoomType::Call&RoomTypeFilter::Callto support MSC3417 behindunstable-msc3417 - It is now possible to use
Base64::parsewhen the innerB"bytes" type is an array, and the inner bytes can be accessed without consuming the wrapper type withBase64::as_inner(). - Add
MatrixVersion::V1_18. CanonicalJsonValue::json_type()allows to get theJsonTypeof a value.- Add
FeatureFlag::Msc4323, the unstable feature flag for the user suspension and locking endpoints, according to MSC4323. - Add unstable support for MSC4406.
- Add
rule_type()anddata()methods toAllowRule. - Implement
PartialEqandEqonCrossSigningKeyandSignatures. - Add
Error::is_endpoint_not_implemented()helper method to check if it matches the expected format for endpoints that are not implemented by the homeserver.
0.17.1
Bug fixes:
- Fix the
Cloneimplementation of theOwned*types generated with theIdDstmacro. It used to always create a new instance from the borrowed type instead of using theCloneimplementation of the internal type.
Improvements:
- Add
AppserviceUserIdentity::maybe_add_to_uri()to add an identity assertion to anhttp::Uri. This allows to reimplement the behavior ofOutgoingRequestAppserviceExt::try_into_http_request_with_identity()outside of Ruma, if using this trait is inconvenient. - Add
MatrixVersion::V1_17. JoinRuleholds arbitrary data in its fallback variant, with can be accessed withJoinRule::data(). It also means that this type won't fail to serialize for undocumented variants anymore.
0.17.0
Breaking changes:
- Merge the
PartialOrdAsRefStrderive macro intoOrdAsRefStr, so both traits are always implemented using the same logic. - Rename the
PartialEqAsRefStrderive macro toEqAsRefStrand make it implement bothPartialEqandEq. - The
StringEnumderive macro also implementsOrd,PartialOrd,EqandPartialEqusing theAsRef<str>implementation of the enum. - The predefined push rules for legacy mentions
PatternedPushRule::contains_user_name(),ConditionalPushRule::contains_display_name()andConditionalPushRule::roomnotif()were removed, according to MSC4210. Their rule IDs are still available inPredefinedContentRuleIdandPredefinedOverrideRuleId, and they are still supported inPatternedPushRule::applies_to()andConditionalPushRule::applies(), for backwards-compatibility for clients. - Macros no longer support importing the
rumaandruma-eventscrate from thematrix-sdk-appservicecrate. This crate was dropped 2 years ago. Metadatawas changed from astructto atrait. It is a supertrait ofOutgoingRequestandIncomingRequest, and its fields are now associated types or constants.- The
authenticationfield of theMetadatastruct is now an associated type namedAuthentication. TheAuthSchemeenum was changed from anenumto atrait. Its variants are now structs implementing theAuthSchemetrait. TheNonevariant was renamed toNoAuthenticationand theServerSignaturesvariant was moved to ruma-federation-api. Theaccess_tokenargument ofOutgoingRequest::try_into_http_request()is renamed toauthentication_inputand is generic over theInputassociated type of theAuthSchemetrait. - The
historyfield of theMetadatastruct is now an associated constant namedPATH_BUILDER. The type of this constant is defined by thePathBuilderassociated type, which must implement thePathBuildertrait. Theconsideringargument ofOutgoingRequest::try_into_http_request()is renamed topath_builder_inputand is generic over theInputassociated type of thePathBuildertrait. TheInputofVersionHistorywas changed from&'_ SupportedVersionstoCow<'_, SupportedVersions>. - The other fields of the
Metadatastruct are now associated constants with the same name converted to uppercase. - The
metadata!macro generates theMetadatatrait implementation for a type namedRequestby default. This type can be changed with an@forsetting.
- The
- The
http_headersmodule is now behind theapicargo feature. OutgoingRequestAppserviceExt::try_into_http_request_with_user_id()is renamed totry_into_http_request_with_identity()and takes anAppserviceUserIdentityinstead of aUserId. This allows to specify a device ID, according to MSC4326.IntoHttpError::NeedsAuthenticationis a newtype variant renamed toAuthenticationthat accepts any error type.- Remove support for the following rules for the
StringEnum,AsRefStrandFromStringderive macros'rename_allattribute, because they either can be replaced by the(prefix = "prefix", rule = "rule")syntax or are unused as far as we know:"PascalCase""SCREAMING-KEBAB-CASE""m.dotted.case""M_MATRIX_ERROR_CASE""m.lowercase""m.snake_case"".m.rule.snake_case""m.role.snake_case"
Bug fixes:
- With the
requestandresponseattribute macros, theContent-Typeheader defaults toapplication/octet-streaminstead ofapplication/jsonif theraw_bodyattribute is set on a field. - Fix the check to make sure that all paths used to build
VersionHistorycontain the same number of variables. It was broken since the syntax was changed from:variableto{variable}.
Improvements:
- Add
org.matrix.msc4380unstable feature support to/versions. - Add
MatrixVersion::V1_16 - Remove support for the
org.matrix.hydra.11room version and the correspondingunstable-hydracargo feature. It should only have been used for development, and room version 12 should be used instead. Metadata::make_endpoint_url()is also available asVersionHistory::make_endpoint_url().PushCondition::ContainsDisplayNameis deprecated, according to MSC4210.- Add
SinglePathas aPathBuilder. It should be used for APIs that don't have a/versionsendpoint and for endpoints that can't be versioned. AuthSchemedata can be extracted from incoming HTTP requests withAuthScheme::extract_authentication().- The
StringEnum,AsRefStrandFromStringderive macros allow to set a custom prefix alongside the rule to rename all the variants, like this:#[ruma_enum(rename_all(prefix = "m.", rule = "snake_case"))]. The previous syntax using#[ruma_enum(rename_all = "snake_case")]still works and assumes that the prefix is empty.
0.16.0
Breaking changes:
PushCondition::applies,ConditionalPushRule::applies,AnyPushRuleRef::applies,AnyPushRule::applies,Ruleset::applies,Ruleset::get_actions,Ruleset::get_matchall became async, to allow for lazy evaluation of push rules.UserIdparsing and deserialization are now compatible with all non-compliant user IDs in the wild by default, due to a clarification in the spec.- The
compat-user-idcargo feature was removed. UserId::validate_historical()andUserId::validate_strict()allow to check for spec compliance.- The
(owned_)user_id!macros always validate against the strict grammar in the spec, regardless of the compat features that are enabled.
- The
(owned_)room_id!macros disallow theNULbyte, due to a clarification in the spec.(owned_)room_alias_id!macros disallow theNULbyte for the localpart, due to a clarification in the spec.MatrixVersiondoes not implementDisplayanymore as it is not correct to convertV1_0to a string. InsteadMatrixVersion::as_str()can be used that only returnsNonefor that same variant.MatrixVersion::(into/from)_partsare no longer exposed as public methods. They were usually used to sortMatrixVersions, now thePartialOrdandOrdimplementations can be used instead.ProtocolandProtocolInitare generic on the protocol instance type.- Add support for endpoints that only allow appservices to call them, renaming
AppserviceTokentoAppserviceTokenOptional, with the new variant takingAppserviceToken's place. - The
redact*functions incanonical_jsontakeRedactionRulesinstead ofRoomVersionId. This avoids undefined behavior for unknown room versions. OutgoingRequest::try_into_http_request(),OutgoingRequestAppserviceExt::try_into_http_request_with_user_id()andMetadata::make_endpoint_url()take aSupportedVersionsinstead of a&[MatrixVersion].- The
metadatamacro allows to specify stable and unstable feature flags for the paths inhistory.VersionHistory::new()takes a&'static [(Option<&'static str>, &'static str)]for the unstable paths and a&'static [(StablePathSelector, &'static str)]for the stable paths.VersionHistory::unstable_paths()returns animpl Iterator<Item = (Option<&'static str>, &'static str)>.VersionHistory::stable_paths()returns animpl Iterator<Item = (StablePathSelector, &'static str)>.VersionHistory::stable_endpoint_for()was renamed toversion_path().VersioningDecision'sStablevariant was renamed toVersionandUnstablewas renamed toFeature.
- The syntax of variables in endpoint paths segments in the
metadatamacro has changed: the variable must now be surrounded by{}instead of being preceded by:. For example/_matrix/client/foo/{bar}. This matches the OpenAPI syntax and the new syntax supported by axum 0.8. JoinRuleand its associated types where imported fromruma-eventsinto theroommodule.space::SpaceRoomJoinRulewas removed and replaced byroom::JoinRuleSummary.directory::PublicRoomJoinRulewas moved and renamed toroom::JoinRuleKind.- It can be constructed with
JoinRule::kind()andJoinRuleSummary::kind().
- It can be constructed with
- Make
PushConditionRoomCtxandPushConditionPowerLevelsCtxnon-exhaustive. - The
versionsfield ofSupportedVersionsis now aBTreeSet<MatrixVersion>, to make sure that the versions are always deduplicated and sorted. NotificationPowerLevelsnow takes aNotificationPowerLevelsKeyfor thekey, an enum that accepts any string.- The
keyfield ofPushCondition::SenderNotificationPermissionuses the same type.
- The
RoomId::new()was renamed toRoomId::new_v1(), as several formats are now supported for this type.StateResolutionVersion::V2now takesStateResolutionV2Rulesas a unit field, to specify tweaks to be used when resolving state with version 2 of the state resolution algorithm.- This field can be accessed with
StateResolutionVersion::v2_rules, returningNoneifstate_resis notStateResolutionVersion::V2. StateResolutionV2Ruleshas the following fields:begin_iterative_auth_checks_with_empty_state_map, to determine whether to begin the first phase of iterative auth checks with an empty state map.consider_conflicted_state_subgraph, to determine whether to include the conflicted state subgraph in the full conflicted state.
- This field can be accessed with
Bug fix:
- Set the
dispositionofRoomVersionRules::MSC2870as unstable.
Improvements:
- Implement the
Zeroizetrait for theBase64type. ProtocolInstancehas aninstance_idfield, due to a clarification in the spec.- The
unstable-unspecifiedcargo feature was removed. - Add
AnyKeyNameas a helper type to useKeyIdAPIs without validating the key name. - Add
IdentityServerBase64PublicKeyas a helper type to decode identity server public keys encoded using standard or URL-safe base64. RoomVersionwas imported from ruma-state-res and renamed toRoomVersionRules, along with the following changes:RoomVersionRules::new()was removed and replaced byRoomVersionId::rules().- The
RoomDispositionenum was renamed toRoomVersionDisposition. - The
event_formatfield was renamed toevent_id_formatand theEventFormatenum was renamed toEventIdFormat. - The tweaks in the authorization rules were extracted into the
AuthorizationRulesstruct, which is available in theauthorizationfield ofRoomVersionRules. - The
special_case_aliases_authfield was renamed tospecial_case_room_aliases. - The
strict_canonicaljsonfield was renamed tostrict_canonical_json. - The
extra_redaction_checksfield was renamed tospecial_case_room_redaction. - The
allow_knockingfield was renamed toknocking. - The
restricted_join_rulesfield was renamed torestricted_join_rule. RedactionRuleswas added under theredactionfield.SignaturesRuleswas added under thesignaturesfield.
RoomVersionIdhas anMSC2870variant for theorg.matrix.msc2870room version defined in MSC2870.- Add
OutgoingRequest::is_supported()andVersionHistory::is_supported()to be able to know if a server advertises support for an endpoint. - Re-export
ID_MAX_BYTESfromruma-identifiers-validation. - Implement
From<PublicRoomsChunk>forRoomSummary. - Add
content_field_redactsfield toRedactionRules, which is used to determine whether thecontentor top-levelredactsfield should be used to determine what event anm.room.redactionevent redacts. - Add
SpaceChildOrderwhich allows to validate theorderof anm.space.childevent. - Add support for room version 12 and its unstable version
org.matrix.hydra.11. - Add
explicitly_privilege_room_creatorsandadditional_room_creatorstoAuthorizationRulesto indicate whether room creators are considered to have "infinite" power level and whether additional room creators can be specified with thecontent.additional_creatorsfield of anm.room.createevent respectively. - Add
RoomPowerLevelsRules, to provide tweaks to how the power level of a user is determined, and add it toPushConditionPowerLevelsCtxvia therulesfield. - Add
room_id_formattoRoomVersionRules, to identify the format to use for room IDs depending on the room version. - Add
RoomId::new_v2()for the new format of room IDs.RoomId::strip_sigil()allows to access the reference hash used in that format. - Add unstable support for in-app-only notifications as per MSC3768 under a new
unstable-msc3768feature. - Add
room_create_event_id_as_room_idtoAuthorizationRulesto indicate whether the reference hash of them.room.createevent is used to construct the room ID. It has other implications, like them.room.createevent not having a room ID, and them.room.createevent not listed in theauth_eventsof a PDU. - Add
require_room_create_room_idandallow_room_create_in_auth_eventstoEventFormatRulesto indicate whether the room ID is required form.room.createevents and whether the event ID of them.room.createis allowed in theauth_events, respectively.
0.15.4
Bug fix:
- Fix
serde::default_on_errordeserialization helper. It was working withserde_json::from_valuebut not other functions likeserde_json::from_(str/slice). It now works with all 3 methods but is limited to deserializing JSON.
0.15.3
Improvements:
- Add
RoomSummarythat represents the summary of a room's state.- Implement
From<RoomSummary>forPublicRoomsChunk
- Implement
- Add
MatrixVersion::V1_15. PublicRoomJoinRulenow includes all possible join rule kinds, due to a clarification in Matrix 1.15.- Add
serde::default_on_error()as a helper to ignore errors during deserialization. - Implement conversions between
PublicRoomJoinRuleandSpaceRoomJoinRule. - Add
FeatureFlagas an enum whose variants are the flags of features supported by Ruma. - Add
SupportedVersions, a type to parse/versionsresponses to get lists of supported versions and features.
0.15.2
Bug fixes:
MatrixVersion::V1_0now also matches Identity Service API versions r0.2.0 to r0.3.0.- Allow configure exhaustive types via
RUMA_UNSTABLE_EXHAUSTIVE_TYPESenvironment variable
Improvements:
MatrixVersionimplementsPartialOrdandOrd. The variants are ordered by release date, with a newer version being greater than an older version.SignaturesimplementsIntoIterator- Implement
PartialEqAsRefStr,Eq,PartialOrdAsRefStr,OrdAsRefStrforruma_common::media::Method. DeviceId::new()generates a string with 10 chars instead of 8.- Add
ignore_invalid_vec_items, to assist deserialization ofVecs, where invalid items should be ignored. - Add
MatrixVersion::V1_14.
0.15.1
Improvements:
- Add
MatrixVersion::V1_13.
0.15.0
Breaking changes:
#[serde(flatten)]on the only body field of a#[request]or#[response]struct is disallowed.#[ruma_api(body)]must be used instead.
Improvements:
- The
ruma_identifiers_storagecompile-timecfgsetting can also be configured by setting theRUMA_IDENTIFIERS_STORAGEenvironment variable at compile time. It has the benefit of not requiring to re-compile all the crates of the dependency chain when the value is changed. - The
unstable-exhaustive-typescargo feature was replaced by theruma_unstable_exhaustive_typescompile-timecfgsetting. Like allcfgsettings, it can be enabled at compile-time with theRUSTFLAGSenvironment variable, or inside.cargo/config.toml. It can also be enabled by setting theRUMA_UNSTABLE_EXHAUSTIVE_TYPESenvironment variable. HttpPusherDataallows to set custom data for the pusher in thedatafield, due to a clarification in the spec.- The
default_payloadfield that was behind theunstable-unspecifiedcargo feature was removed. It can be added manually to the custom data.
- The
0.14.1
Bug fixes:
- The
KeyId::key_namemethod now returns the key name. In 0.14.0,key_namemistakenly returned the algorithm.
0.14.0
Bug fixes:
- The
instance_idfield was removed fromProtocolInstanceInitand is now anOption<String>forProtocolInstance. It made theunstable-unspecifiedfeature non-additive.
Breaking changes:
- Rename the
query_mapattribute of therequestmacro toquery_all, and remove the required bound to implementIntoIterator<Item = (String, String)>. This allows to use a struct or enum as well as a map to represent the list of query parameters. Note that the (de)serialization of the type used must work withserde_html_form. - The
headerattribute for therequestandresponsemacros accepts any type that implementsToStringandFromStr. - The
compat-key-idcargo feature was renamed tocompat-server-signing-key-version. (Owned)KeyNamewas renamed to(Owned)ServerSigningKeyVersionand is now validated according to the set of allowed characters defined in the docs, unless thecompat-server-signing-key-versioncargo feature is enabled.- The bounds on
KeyIdchanged. The algorithm part must implementKeyAlgorithmand the key name part must implementKeyName. - The
(owned_)server_signing_key_idmacros were removed. For compile-time validated construction, useServerSigningKeyId::from_partswith aSigningKeyAlgorithmand theserver_signing_key_versionmacro. - Rename
Signatures::inserttoSignatures::insert_signature.Signatures::insertis now dereferenced toBTreeMap::insert. - Move the
DeviceKeyAlgorithm::SignedCurve25519into the newOneTimeKeyAlgorithmtype. - Add
(Owned)CrossSigningKeyIdand use it instead ofOwnedDeviceKeyIdto identifyCrossSigningKey'skeys. - Add
(Owned)CrossSigningOrDeviceSigningKeyIdand use it instead ofOwnedDeviceKeyIdto identify signing keys inDeviceKeys's andCrossSigningKey'ssignatures. - Use
OwnedDeviceSigningKeyIdinstead ofOwnedDeviceKeyIdto identify signing keys inSignedKey'ssignatures. (Owned)DeviceKeyIdis now a type alias of(Owned)KeyId.- Remove the
(owned_)device_key_idmacro, instead useDeviceKeyId::from_parts.
- Remove the
- Use
CrossSigningOrDeviceSignaturesfor thesignaturesofDeviceKeys. - Remove
SignedKeySignaturesand replace it withDeviceSignatures. - Remove
CrossSigningKeySignaturesand replace it withCrossSigningOrDeviceSignatures.
Improvements:
- Add the
InvalidHeaderValuevariant to theDeserializationErrorstruct, for cases where we receive a HTTP header with an unexpected value. - Implement
Eq/Hash/PartialEqforThirdPartyIdentifier, to check whether aThirdPartyIdentifierhas already been added by another user. - Add
MatrixVersion::V1_11andMatrixVersion::V1_12. - Clarify in the docs of
AuthSchemethat sending an access token via a query parameter is deprecated, according to MSC4126 / Matrix 1.11. - Constructing a Matrix URI for an event with a room alias is deprecated, according to MSC4132 / Matrix 1.11
- Implement
EqandPartialEqforMetadata - Allow constructing
api::error::MatrixErrorBody::NotJsonoutside of this crate. - Improve the API of
Signatures, by implementingDerefandDerefMut, as well asFrom,ExtendandFromIteratorfrom a list of(entity, key_identifier, value)tuples. - Add
(Owned)OneTimeKeyIdand(Owned)OneTimeKeyNameto identify one-time and fallback keys instead of using(Owned)DeviceKeyId. - Add
(Owned)Base64PublicKeyand(Owned)Base64PublicKeyOrDeviceIdto identify cross-signing keys.- Add
(owned_)base_64_public_keyto construct a compile-time validated(Owned)Base64PublicKey.
- Add
0.13.0
Bug fixes:
- Allow to deserialize
Rulesetwith missing fields.
Breaking changes:
- The power levels fields in
PushConditionRoomCtxare grouped in an optionalpower_levelsfield. If the field is missing, push rules that depend on it will never match. However, this allows to match the.m.rule.invite_for_mepush rule because usually theinvite_statedoesn't includem.room.power_levels. - Add support for endpoints that take an optional authentication
- Add support for endpoints that require authentication for appservices
deserialize_as_f64_or_stringhas been extended to also support parsing integers, and renamed todeserialize_as_number_or_stringto reflect that.- The http crate had a major version bump to version 1.1
IntoHttpError::Headernow contains aHeaderSerializationError
Improvements:
- Use the web-time crate to return a
SystemTimethat works under WASM in theMilliSecondsSinceUnixEpoch::to_system_time()method. - Stabilize support for
.m.rule.suppress_editspush rule (MSC3958 / Matrix 1.9) - Add
MatrixVersion::V1_9andV1_10 - Point links to the Matrix 1.10 specification
- Implement
as_str()andAsRef<str>forpush::PredefinedRuleId - Implement
kind()forpush::Predefined{*}RuleId - Implement
CloneforMatrixToUriandMatrixUri
0.12.1
Bug fixes:
- Allow to deserialize
(New)ConditionalPushRulewith a missingconditionsfield.
0.12.0
Bug fixes:
- Set the predefined server-default
.m.rule.tombstonepush rule as enabled by default, as defined in the spec.
Breaking changes:
FlattenedJson::getreturns aFlattenedJsonValueinstead of a string- Remove the
DontNotifyandCoalescevariants ofpush::Actionaccording to MSC3987- Old push rules will still deserialize successfully but the
Coalescevariant will not returntrueforAction::should_notify()anymore
- Old push rules will still deserialize successfully but the
- Removed the
eventsmodule, it is once again its own crate (ruma-events) - Removed
FromandTryFromimplementations forRedactedBecausein favor of named constructors (from_jsonandfrom_raw_event) - Updated room IDs to not require a servername
- Removed
localpartmethod fromRoomIdandRoomOrAliasId - Changed
server_namemethod onRoomIdandRoomOrAliasIdto returnOption<&str>
- Removed
Improvements:
- Allow padding when decoding the
Base64type from a string - 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 PushCondition::EventMatchandFlattenedJsonnow use escaped dotted paths (MSC3873 / Matrix 1.7)- Add support for
event_property_ispush condition (MSC3758 / Matrix 1.7) - Add support for
event_property_containspush condition (MSC3966 / Matrix 1.7) - Add
MatrixVersion::V1_7andMatrixVersion::V1_8 - Add support for room version 11 according to MSC3820 / Matrix 1.8
- Adapt the redaction algorithm in
canonical_json
- Adapt the redaction algorithm in
- Add unstable support for suppress edits push rule (MSC3958)
0.11.3
Bug fixes:
- Move
.m.rule.roomnotifpush rule before.m.rule.tombstonein 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_servernameeven withfeature = "compat"
Improvements:
- Derive
HashforReceiptTypeandReceiptThread - Update
EventContentderive macro to emit new type definitions and type aliases under the same visibility as the input type (this fixes a future- compatibility warning when derivingEventContenton a non-pubtype)
0.11.1
Improvements:
- Make alternate Debug representation of
MilliSecondsSinceUnixEpochandSecondsSinceUnixEpochmore 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::keyandevents::secretmodules - Fix deserialization of
RoomMessageEventContentandRoomEncryptedEventContentwhen there is no relation - Fix deserialization of
StateUnsignedwhen theprev_contentis redacted - Allow to deserialize
PushConditionwith unknown kind - Allow to deserialize
push::Actionwith unknown value - Only percent-encode reserved characters in endpoint URL path
Breaking changes:
- Remove deprecated
EventTypeenum - Remove deprecated constructors for
RoomMessageEventContent - Remove
serde::vec_as_map_of_emptyfrom the public API - Remove the
api::AuthScheme::QueryOnlyAccessTokenvariant, which is no longer used - The
#[ruma_api(header)]attribute of theruma_apimacro 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
nameoptional onSecretStorageKeyEventContent. Default constructor has been adjusted as well to not require this field. - Rename
push::PusherDatatoHttpPusherDataand make theurlfield required - Remove
Ruleset::addand the implementation ofExtend<AnyPushRule>forRuleset - Make
EndpointErrorconstruction infallibleEndpointError::try_from_http_requesthas been replaced byEndpointError::from_http_requestFromHttpResponseError<E>::Servernow containsEinstead ofServerError<E>ServerError<E>has been removedMatrixErroris now an enum with theJsonvariant containing the previous fields
- Change the
ignored_usersfield ofIgnoredUserListEventContentto a map of empty structs, to allow eventual fields to be added, as intended by the spec - Make
SimplePushRuleand associated types generic over the expected type of therule_id - Deduplicate and group relation structs in
events::relation:- Move relation structs under
events::room::messagetoevents::relation - Move common relation structs under
events::room::encryptedtoevents::relationand remove duplicate types - Remove
events::reaction::Relationand useevents::relation::Annotationinstead - Remove
events::key::verification::Relationand useevents::relation::Referenceinstead
- Move relation structs under
- Rename
events::relation::RelationstoBundledRelations - Make the
redacted_becausefield inUnsignedRedactednon-optional and replace parameterlessnewconstructor by one that takes a redaction event (likenew_becausepreviously, which is now removed) - Move the
Unsignedassociated type fromStateEventContenttoOriginalStateEventContentRedacted*EventContents don't have anunsignedtype anymore
- Remove the
serde::urlencodedmodule- Query string (de)serialization is now done by the
serde_html_formcrate
- Query string (de)serialization is now done by the
- Rename
RoomEventTypetoTimelineEventType - Remove
SecretStorageKeyEventContent's implementation ofDeserialize- Use
EventContentFromType::from_partsinstead
- 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::StringEnumderive now also generates aDebugimplementation
Improvements:
- Add
MatrixVersion::V1_4andMatrixVersion::V1_5 - Stabilize default room server ACL push rule
- Stabilize
room_typesindirectory::Filterandroom_typeindirectory::PublicRoomsChunk - Stabilize support for private read receipts
- Add stable support for threads
- Move
Relation::Threadand associated types and methods out ofunstable-msc3440 - Add parameter to
RoomMessageEventContent::make_reply_toto 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::PredefinedRuleIdand associated types as a list of predefined push rule IDs - Add convenience methods to
RulesetRuleset::getto access a push ruleRuleset::insertto add or update user push rulesRuleset::set_enabledto change the enabled state of push rulesRuleset::set_actionsto change the actions of push rules
- Add support for bundled reference relations (MSC3267 / Matrix 1.5)
- Add the
formattedfield onKeyVerificationRequestEventContent(Matrix 1.5) - Add
contentaccessors forAny*StateEventenums - Add the
DebugAsRefStrderive macro toruma_common::serde
0.10.5
Improvements:
- Add support for
#[incoming_derive(!Debug)]to theIncomingderive macro
0.10.4
Bug fixes:
- Fix
MatrixToUriparsing for non-url-encoded room aliases
0.10.3
Bug fixes:
- Fix ruma-common not compiling with the Cargo features
eventsandunstable-msc2677active, andunstable-msc2676inactive
0.10.2
Improvements:
- Add
relationsaccessors to event enum types:AnyMessageLikeEventandAnySyncMessageLikeEventAnyStateEventandAnySyncStateEventAnyTimelineEventandAnySyncTimelineEvent
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,MatrixUriErrorandMxcUriErrorat the crate root - Fix matching of
event_matchcondition- The spec clarified its behavior: https://github.com/matrix-org/matrix-spec-proposals/pull/3690
Breaking changes:
- Add
user_idfield toPushConditionRoomCtx - Remove
PartialEqimplementation onNotificationPowerLevels - Remove
PartialEqimplementation forevents::call::SessionDescription - Use new
events::call::AnswerSessionDescriptionforCallAnswerEventContentandOfferSessionDescriptionforCallInviteEventContent - Use new
VoipVersionIdandVoipIdtypes forevents::callevents - Remove
RoomName/OwnedRoomNameand replace usages withstr/String- Room name size limits were never enforced by servers (Spec change removing the size limit)
- Remove
RoomMessageFeedbackEventand associated types and variants according to MSC3582 - Move
CanonicalJson,CanonicalJsonObjectandCanonicalJsonErrorout of theserdemodule and behind the cargo feature flagcanonical-json - Make identifiers matrix URI constructors generic over owned parameters
- Split
RoomIdmatrix URI constructors between methods with and without routing
- Split
- Allow to add routing servers to
RoomId::matrix_to_event_uri() - Move
receipt::ReceiptTypetoevents::receipt - Make
Cloneas supertrait ofapi::OutgoingRequest - Rename
Any[Sync]RoomEventtoAny[Sync]TimelineEvent RoomMemberEventand related types now have a custom unsigned type including theinvite_room_statefield, instead of theStateUnsignedtype 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::BundledAnnotationto 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_keyanddevice_idfields for encrypted events (MSC3700) - Move the
relationsfield ofevents::unsignedtypes out ofunstable-msc2675 - Deserialize stringified integers for power levels without the
compatfeature - Add
JoinRule::KnockRestricted(MSC3787) - Add
MatrixVersionId::V10(MSC3604) - Add methods to sanitize messages according to the spec behind the
htmlfeature- 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_changefunctions on various member event types
- Prior to this, you couldn't actually do anything with the
0.9.0
Bug fixes:
- Change default
invitepower 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-commonruma-apihas moved intoapi, behind a feature flagruma-eventshas moved intoevents, behind a feature flagruma-identifierstypes are available at the root of the crateruma-serdehas moved intoserde
- The
events::*MessageEventtypes have been renamed to*MessageLikeEvent - Change
events::roommedia types to accept either a plain file or an encrypted file, not both simultaneously - Change
events::roommedia types to useDurationwhere applicable - Move
prev_contentintounsigned - Rename
identifiers::ErrortoIdParseError - Fix the
RoomMessageEventContent::*_reply_plainmethods that now return a message with aformatted_body, according to the spec. Therefore, they only acceptOriginalRoomMessageEvents like their HTML counterparts. - Update the
state_keyfield of state events to be of a different type depending on the content type. You now no longer need to validate manually thatm.room.memberevents 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::allowpublic - Conversion from
RoomPowerLevelstoRoomPowerLevelsEventContent
0.8.0
Breaking changes:
- Update
ruma-identifiersdependency
0.7.0
Breaking changes:
- Update
ruma-identifiersdependency - Use new
Base64type forkeyfield ofSignedKey
0.6.0
Breaking changes:
- Make a few enums non-exhaustive
- Upgrade dependencies
0.5.4
Improvements:
- Add
to_devicemodule containingDeviceIdOrAllDevices
0.5.3
Improvements:
- Add
instance_idfield toProtocolInstance[Init]under theunstable-pre-specfeature
0.5.2
Improvements:
- Add
thirdparty::ThirdPartyIdentifier
0.5.1
Improvements:
- Add
receipt::ReceiptType - Add
MilliSecondsSinceUnixEpochandSecondsSinceUnixEpochtypes - Bump dependency versions
0.5.0
Breaking changes:
- Rename
push::RulesetItertopush::RulesetIntoIter - Change the return type of
push::Ruleset::get_actionsfrom an iterator to a slice
Improvements:
- Add
push::Ruleset::iter()for borrowing iteration of rulesets - Add conversions between
AnyPushRuleandAnyPushRuleRef(AnyPushRule::as_refandAnyPushRuleRef::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::MxcUriinstead ofStringforavatar_urlfield indirectory::PublicRoomsChunk - Use
ruma_identifiers::RoomIdinstead ofStringforroom_idfield inpush::PushConditionRoomCtx - Upgrade ruma-identifiers dependency to 0.19.0
0.3.1
Bug fixes:
- Fix
push::PushCondition::appliesfor empty value and pattern
0.3.0
Breaking changes:
- Update set of conversion trait implementations for enums
- Replace
VecbyIndexSetinpush::Ruleset - Replace
push::AnyPushRulewith an enum (the original struct still exists as justPushRuleinruma-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
thirdpartymodule - 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
IntoIteratorimplementation 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]