47 KiB
Changelog
Unreleased
Bug fixes:
- Export
AnyRedactionEvent.
0.33.0
Breaking changes:
PossiblyRedactedRoomMemberEventContentis no longer a type alias forRoomMemberEventContent. It would previously fail to deserialize if thethird_party_invitefield was redacted as thedisplay_namefield was required but it is removed during redaction.- The
canonical-jsonfeature was removed. The code that was behind it is no longer gated behind a cargo feature. - The
Replystruct variant ofmessage::Relation,encrypted::RelationandRelationWithoutReplacementis now a tuple variant containing a non-exhaustive struct. - The
(Any)FullStateEventContentenums were renamed to(Any)StateEventContentChangeto reflect better the purpose of those enums. The method to accessAnyStateEventContentChangeonAny(Sync)StateEventis calledcontent_change(). - The
content()method onAny(Sync)StateEventreturns anAnyPossiblyRedactedStateEventContent. RequestActiondoesn't implement(Partial)Eqand(Partial)Ordanymore and itsRequestvariant contains a non-exhaustive struct instead of aSecretName.SecretEncryptedDatais now a non-constructible struct rather than an enum, that should always be used asRaw<SecretEncryptedData>. Because there is no indicator in the data for which algorithm was used for encrypting it, it won't be possible to determine reliably which algorithm is matched during deserialization when more algorithms are added. This type should be.cast()from and to other types when the algorithm is known from external data. The previousAesHmacSha2EncryptedDatavariant is now a separate struct.- Some fields of
EncryptedFileare now grouped by version in a newEncryptedFileInfoenum. This allows to support custom encryption algorithms and to hide fields that should be set to a constant value to have a stricter validation during construction and deserialization. Now that there are fewer fields, this type can be constructed withEncryptedFile::new().- Similarly, the
hashesfield uses a stricterEncryptedFileHashesmap type to ensure that a decoded hash has the appropriate format for the algorithm in the key. EncryptedFileInit,JsonWebKeyandJsonWebKeyInitwere removed.- The same changes were applied to the unstable
EncryptedContent.
- Similarly, the
- Remove support for the
m.room.aliasesevent type. It was removed from the specification in Matrix Client-Server API r0.6.1.m.room.canonical_aliasshould be used instead. - The
redacted_becausefield ofRedactedUnsignedis now aRaw<AnyRedactionEvent>. It is an enum that allows to deserialize other event types thanm.room.redaction.- Add unstable support for
m.room.memberinredacted_because, according to MSC4293.
- Add unstable support for
Bug fixes:
- Fix a double
msgtypein am.locationevent. - Do not serialize
nameinSecretStorageKeyEventContentwhen its value isNone.
Improvements:
- Support
m.key_backupaccount data from MSC4287 via aKeyBackupEventContentstruct. - Add
AnyPossiblyRedactedStateEventContent, an enum containing all the possibly redacted state event contents.- Add
AnyStrippedStateEvent::content()to access only the content of the event.
- Add
- Implement
From<(Redacted)*EventContent> for PossiblyRedacted*EventContentfor all state events. - Implement
RedactContent for PossiblyRedacted*EventContentfor all state events. - Add support for the recently used emoji account data, according to MSC4356 / Matrix 1.18.
- Stabilize support for invite blocking, according to MSC4380 / Matrix 1.18.
Since the format of the account data changed, the previous event content
struct as well as its variants in
AnyGlobalAccountDataEvent(Content)are now prefixed withUnstable. The newInvitePermissionConfigEventContentstruct uses the new format with adefault_actionfield instead ofblock_all. - Add support for to-device event for pushing secrets, according to MSC4385.
- Add support for video/audio call intent according to MSC4075 as part of the
RtcNotificationEventContentnewcall_intentfield. - Add
AnySyncTimelineEvent::is_redacted()helper. - Add
PossiblyRedactedSpace(Child/Parent)EventContent::is_valid()to check the validity of the event content according to the Matrix specification. - Add a convenience
event_type()helper on event structs which allows to access the event type from the inner*EventContenttype without requiring to have a trait in scope. It is added to the following structs:EphemeralRoomEventGlobalAccountDataEventInitialStateEventOriginalMessageLikeEventOriginalStateEventOriginalSyncMessageLikeEventOriginalSyncStateEventRedactedMessageLikeEventRedactedStateEventRedactedSyncMessageLikeEventRedactedSyncStateEventRoomAccountDataEventStrippedStateEventSyncEphemeralRoomEventToDeviceEvent
- Add support for reading
m.call.intentinside rtc membership events, seeMembershipData::call_intent(). - Stabilize the
is_animatedflag for image messages and sticker events, according to MSC4230 / Matrix 1.18. - Add support for the
m.room.policystate event, according to MSC4284 / Matrix 1.18. - Add support for MSC4293
redact_eventsfield toRoomMemberEventContent, gated behindunstable-msc4293.
0.32.1
Improvements:
- Add list of state event types recommended by the spec for servers to transfer upon room upgrade.
0.32.0
Breaking changes:
- Upgrade
js_optionto v0.2.0 - The following structs are now marked as non-exhaustive:
GlobalAccountDataEvent,RoomAccountDataEvent,(Sync)EphemeralRoomEvent,Original(Sync)MessageLikeEvent,Redacted(Sync)MessageLikeEvent,Original(Sync)StateEvent,Redacted(Sync)StateEvent,StrippedStateEvent,Original(Sync)RoomRedactionEvent,Redacted(Sync)RoomRedactionEvent,InitialStateEvent,ToDeviceEvent,DecryptedMegolmV1Event,OlmV1Keys. Some of them can only be constructed through deserialization.InitialStateEvent::new()takes astate_key. For events with an empty state key,InitialStateEvent::with_empty_state_key()can be used instead.
- Remove the deprecated
RoomMessageEventContent::set_mentions(). - The
OrdandPartialOrdimplementations of the*EventTypeenums are now ordered using the string representations of the variants. It used to be ordered using the variants declaration order. - The
criterioncargo feature used for benchmarks was renamed to__criterion, to make it obvious that it is private.
Improvements:
- Add unstable support for the
m.invite_permission_configaccount data event which blocks invites to a user, wholesale: (MSC4380). - Add support for the room account data
m.space_orderevent which powers top level space ordering as per MSC3230. - Add
m.rtc.notificationevent support and deprecate the (non MSC conformant)m.call.notifyevent. - Add
dm.filament.do_not_disturbaccount data event as per MSC4359. RoomMemberUnsignedhas aknock_room_statefield. This is the equivalent toinvite_room_statebut after a knock rather than an invite.- The
unstable-msc4362feature is renamed (previouslyunstable-msc3414). - The unstable prefix for
encrypt_state_eventsinRoomEncryptionEventContentis renamed toio.element.msc4362.(previouslyio.element.msc3414.).
0.31.0
Breaking changes:
- Zeroize the secret key contained in JsonWebKey if the struct gets dropped. This change means you can no longer move any fields out of the struct.
- Reply fallbacks are not generated anymore, according to MSC2781 / Matrix 1.13.
As a result, the following methods of
RoomMessageEventContent(WithoutRelation)were simplified:make_reply_toandmake_reply_to_rawhave been merged intomake_reply_to. It takes aReplyMetadata, that can be virtually constructed from any event and includes built-in conversions for room message events.make_for_threadalso takes aReplyMetadatainstead of a room message event.make_replacementdoes not take the replied-to message anymore.
RoomThirdPartyInviteEventContentusesIdentityServerBase64PublicKeyinstead ofBase64for thepublic_keyfields, to avoid deserialization errors when public keys encoded using URL-safe base64 are encountered.- The
msgtypeis no longer serialized inAudioMessageEventContent,EmoteMessageEventContent,FileMessageEventContent,ImageMessageEventContent,LocationMessageEventContent,NoticeMessageEventContent,ServerNoticeMessageEventContent,TextMessageEventContent,VideoMessageEventContentandKeyVerificationRequestEventContent. Instead themsgtypeis now serialized on the variants ofMessageType. RedactContent::redact()andFullStateEventContent::redact()take aRedactionRulesinstead ofRoomVersionId. This avoids undefined behavior for unknown room versions.- Add the
sender_device_keysfield toDecryptedOlmV1Event, according to MSC4147. signedinThirdPartyInviteis now wrapped inside aRawbecause it is signed so we need the full raw JSON to verify the signature.PresenceEventContentdoesn't implementEventContentandStaticEventContentanymore. They are not useful whenPresenceEventcan only contain one type.- The
EventContentmacro now requires thekindattribute. - The
EventContenttrait was removed.- The
event_typemethod is now available on the per-kind*EventContenttraits. - For an event content type to automatically implement
EventContentFromTypeit must now match the boundStaticEventContent + DeserializeOwned.
- The
- The
BundledThread::latest_eventfield is now anAnySyncMessageLikeEventinstead ofAnyMessageLikeEvent, to reflect that it may not always include aroom_idfield (if the owning event came from sync, for instance), which can usually be obtained from the surrounding context. - The
(Original)(Sync)RedactEventevents take aRedactionRulesinstead ofRoomVersionIdfor theirredacts()method. This avoids unexpected behavior for unknown room versions. SpaceChildEventContentnow usesOwnedSpaceChildOrderfor theorderfield. This is a type with strong validation according to the rules of the spec. If its deserialization fails, this field is set toNoneto ignore it, as recommended in the spec.StaticEventContenthas a new associated typeIsPrefixto identify event types where only the prefix is statically-known.AnyEphemeralRoomEventwas removed. There is no reason to use it, onlyAnySyncEphemeralRoomEventcan be received via/sync.- The
redacted_becausefield ofRedactedUnsignedis wrapped inRaw. It avoids to fail deserialization of the whole event if only deserialization of this field fails. It is also more forward-compatible in case events other thanm.room.redactionare used here in the future. - Add
UserPowerLeveland return it instead ofIntforRoomPowerLevels::for_user. - Remove
impl From<(Redacted)RoomPowerLevelsEventContent> for RoomPowerLevelsand replace them withnew, asRoomPowerLevelsnow additionally needsRoomPowerLevelsRulesto specify additional rules required to determine the power level of a user.- This function also now takes a new
RoomPowerLevelsSourcetype, to also allowRoomPowerLevelsto be constructed without(Redacted)RoomPowerLevelsEventContent, for when rooms have nom.room.power_levelsstate.
- This function also now takes a new
- Change
impl From<RoomPowerLevels> for RoomPowerLevelsEventContentto aTryFromimplementation. Theusersfield is now validated against the creators of the room, depending on theRoomPowerLevelsRules. - Remove
Defaultimplementation forRoomPowerLevelsEventContentand makenewtakeAuthorizationRulesas a parameter. - The
event_idfield ofPreviousRoomis now optional and deprecated. It has been removed in new room versions so clients should not rely on it. They can obtain it by requesting them.room.tombstoneevent in the state of the predecessor. - The
sender_keyfield ofRequestedKeyInfois now optional. It was deprecated in Matrix 1.3. - Add
m.rtc.declinesupport (unstable_MSC4310).
Bug fixes:
- When calling
membership_change()for aMembershipStatechange fromKnocktoJoin,MembershipChange::Joinedis returned instead ofError, since this change is legal in some cases.
Improvements:
- Add
RoomLanguageEventContentand derived state events to specify language of a room. - Don't print out the secret key contained in JsonWebKey and JsonWebKeyInit in
their
Debugimplementations. - Remove the
pdumodule and the correspondingunstable-pducargo feature. As far as we know, it was not used anywhere outside of the tests of ruma-state-res. - The
EventContentandevent_enum!macros support declaring the same type for both global and room account data. The syntax to use for theEventContentmacro iskind = GlobalAccountData + RoomAccountData. - The
(Unstable)MediaPreviewConfigEventContenttypes are also declared as room account data: they implementRoomAccountDataEventContentand have variants in theAnyRoomAccountDataEvent*andRoomAccountDataEventTypeenums. TheMediaPreviewConfigEventandUnstableMediaPreviewConfigEventtype aliases are renamed toGlobalMediaPreviewConfigEventandGlobalUnstableMediaPreviewConfigEvent, respectively. - The fields of
MediaPreviewConfigEventContentare now optional. It allows to differentiate whether the room account data is unset or explicitly set to the default value. This allows in turn to know whether the room account data should override the global account data or not.MediaPreviewConfigEventContent::new()doesn't take any arguments and creates an empty config. The fields can be set with a builder pattern, e.g.MediaPreviewConfigEventContent::new().media_previews(Some(MediaPreviews::Off)).MediaPreviewConfigEventContent::merge_global_and_room_config()can be used to get the current config for a room.
m.space.childevents can be sorted with the algorithm defined in the spec by using the newSpaceChildOrdtrait andSpaceChildOrdHelpertype, andHierarchySpaceChildEventspecifically now implementsOrdusing the aforementioned trait.- Implement types for encrypted state events, according to MSC3414.
- Add
additional_creatorsfield toRoomCreateEventContent, used to optionally specify additional creators of a room. - The state key type
CallMemberStateKeyform.call.memberstate events changed to allow any postfix for state keys. Thedevice_id()method is not available anymore. Use the event content instead. - Add unstable support for events with the same format as
SyncStateEventinStrippedStateEvent, according to MSC4319.
0.30.5
Bug fixes:
- If the
sender_keyanddevice_idfields ofMegolmV1AesSha2Contentare missing during deserialization, they default to an empty string. They are optional since Matrix 1.3. - If the
sender_keyfield ofRequestedKeyInfois missing during deserialization, it defaults to an empty string. It is optional since Matrix 1.3. - Fix the deserialization of
RedactedRoomJoinRulesEventContent.
0.30.4
Bug fixes:
- Implement
StaticEventContentfor a few event types generated manually:RedactedCallMemberEventContent,PossiblyRedactedPolicyRuleRoomEventContent,PossiblyRedactedPolicyRuleServerEventContent,PossiblyRedactedPolicyRuleUserEventContent,RedactedRoomAliasesEventContent,RedactedRoomMemberEventContent.
Improvements:
- Add support for the
m.room_key_bundleto-device event, which was introduced in MSC4268. - Add support for the
m.room_key.withheldto-device event, which was introduced in Matrix 1.1. - Fix and stabilize support for rich text in room topics, according to Matrix 1.15.
- With the
compat-lax-room-create-desercargo feature, thepredecessorfield ofRoomCreateEventContentis ignored during deserialization if it has an invalid format. - With the
compat-lax-room-topic-desercargo feature, thetopic_blockfield ofRoomTopicEventContent(namedm.topicin the JSON source) is ignored during deserialization if it has an invalid format.
0.30.3
Improvements:
- Add support for ThumbHash as an alternative to BlurHash for MSC2448 in
ImageInfoandVideoInfo. - Add implementation of MSC 4278
using
MediaPreviewConfigEventContentfor the stable version andMediaPreviewConfigEventContentfor the unstable one, both are only implemented asGlobalAccountDataevents as of right now. - Add unstable support for rich text in room topics, according to MSC3765.
0.30.2
Bug fixes:
RelationType::Replacementis now properly encoded/decoded asm.replaceinstead ofm.replacement.
Improvements:
- Add
RECOMMENDED_STRIPPED_STATE_EVENT_TYPESconstant for servers to filter/get recommended stripped state events. - Add unstable support for gallery
msgtypeas per MSC4274. - Invalid Objects inside the
allowarray ofRestrictedare now ignored, meaning thatJoinRuleswill not fail to deserialize if there are invalid restricted join conditions
0.30.1
Bug fixes:
make_replacementnow correctly sets the mentions on the plain replacement event, when the edited event had no initial mentions.
Improvements:
- Add unstable support for the
is_animatedflag for images, according to MSC4230. - Add unstable support for MSC2545 for image packs.
- Add
is_redacted()accessor toAny(Sync){MessageLike/State}Eventevent enums to know if an event is redacted without needing to clone its content.
0.30.0
Breaking changes:
- Take newly introduced
DirectUserIdentifier(str)as a key forDirectEventContent. This change allows to have an email or MSISDN phone number as a key for example, which can be used when issuing invites through third-party systems.DirectUserIdentifiercan easily be converted to anUserId.
Improvements:
- Add unstable support for MSC4171 for the m.member_hints state event.
- 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.
0.29.1
Bug fixes:
- Markdown text constructors now detect even more markdown syntax like removed whitespace at the end or beginning of a line to decide if the text should be sent as HTML.
Improvements:
- Add unstable support for MSC4059 for bundling link previews in chat text messages
0.29.0
Bug fixes:
- Fix missing
relates_tofield onStickerEventContent - Fix deserialization of
AnyGlobalAccountDataEventfor variants with a type fragment. - Fix serialization of
room::message::Relationandroom::encrypted::Relationwhich could cause duplicaterel_typekeys. Restrictedno longer fails to deserialize when theallowfield is missing- Markdown text constructors now also detect markdown syntax like backslash escapes and entity references to decide if the text should be sent as HTML.
- Markdown text with only inline syntax generates HTML that is not wrapped
inside a
<p>element anymore, as recommended by the spec.
Improvements:
- Add support for encrypted stickers as sent by several bridges under the flag
compat-encrypted-stickers - Add unstable support for MSC3489
m.beacon&m.beacon_infoevents (unstable typesorg.matrix.msc3489.beacon&org.matrix.msc3489.beacon_info) - Stabilize support for muting in VoIP calls, according to Matrix 1.11
- All the root
Any*EventContenttypes now have aEventContentFromTypeimplementations automatically derived by theevent_enum!macro. CallMemberEventContentnow supports two different formats: Session memberships and Legacy memberships. The new format (Session) is required to reliably display the call member count (reliable call member events).CallMemberEventContentis now an enum to model the two different formats.CallMemberStateKey(instead ofOwnedUserId) is now used as the state key type forCallMemberEventContent. This guarantees correct formatting of the event key.- Add helpers for captions on audio, file, image and video messages.
- Add helpers for filenames on audio, file, image and video messages.
- Stabilize support for the
m.marked_unreadroom account data according to Matrix 1.12. The unstablecom.famedly.marked_unreadroom account data is still available behind theunstable-msc2867cargo feature to be able to migrate data from the unstable to the stable prefix.
Breaking changes:
StickerEventContent::urlwas replaced byStickerEventContent::sourcewhich is aStickerMediaSource- Use
ServerSignaturesfor thesignaturesofRoomV1Pdu,RoomV3PduandSignedContent.
0.28.1
Improvements:
- Implement
make_for_threadandmake_replacementforRoomMessageEventContentWithoutRelation RoomMessageEventContent::set_mentionsis deprecated and replaced byadd_mentionsthat should be called beforemake_replacement.
0.28.0
Bug fixes:
- The
MembershipState::InvitetoMembershipState::Knockmembership change now returnsMembershipChange::Error, due to a spec clarification
Breaking changes:
- The properties of
SecretStorageV1AesHmacSha2Propertiesare nowOptional. - Remove
event_idmethods from relation types - The required power level is different whether the user wants to redact their
own event or an event from another user:
RoomPowerLevels::user_can_redactis split intouser_can_redact_own_eventanduser_can_redact_event_of_other,PowerLevelAction::Redactis split intoRedactOwnandRedactOther.
- Use
OwnedRoomIdinstead ofStringfor thestate_keyfield ofHierarchySpaceChildEvent - The
sdp_midandsdp_m_line_indexfields ofCandidateare now optional, for better compatibility with the WebRTC specification.
Improvements:
- Don't fail event content parsing on invalid relation
- We previously already accepted custom or slightly malformed relations
- Now, even invalid / missing
rel_typeandevent_idare accepted
- Implement
From<RoomPowerLevels>forruma_common::push::PushConditionPowerLevelsCtx - Add methods on
PowerLevelsto check if some actions are permitted based on the target user's power level. - Add unstable support for manually marking rooms as unread through MSC2867
and the room account data
m.marked_unreadevent (unstable typecom.famedly.marked_unread) - Implement
From<JoinRule>forSpaceRoomJoinRule - Add
filenameandformattedfields to media event contents to support media captions as per MSC2530 / Matrix 1.10 - Add support for multi-stream VoIP, according to MSC3077 / Matrix 1.10
- Add unstable support for muting in VoIP calls, according to MSC3291
0.27.11
- Add unstable support for
m.call.notifyevents (unstable typeorg.matrix.msc4075.call.notify)
0.27.10
Deprecations:
- Deprecate
event_idmethods onRelationtypes- They will be removed in the next breaking-change release
- Please open an issue if you are currently using them
0.27.9
Bug fixes:
- Fix the name of the fallback text field for extensible events in
RoomMessageEventContentWithoutRelation::make_reply_to_raw()
0.27.8
Improvements:
- Export the
UnstableAmplitudetype from theroom::messagemodule under theunstable-msc3245-v1-compatfeature; it was previously unnameable
0.27.7
Improvements:
- Remove invalid
non_exhaustiveattribute oncall::member::MembershipInit
0.27.6
Improvements:
- Add unstable support for
m.call.memberevents (unstable typeorg.matrix.msc3401.call.member)
0.27.5
Improvements:
- Add the Ruma logo to the documentation as a favicon / sidebar logo
0.27.4
Improvements:
- Add
Thread::without_fallbackas a constructor that initializes the minimal set of required fields
0.27.3
Improvements:
- Improve compatibility of unstable voice messages
0.27.2
Improvements:
- Added constructors for
UnstableAudioDetailsContentBlockandUnstableVoiceContentBlock
0.27.1
Improvements:
- Calling
make_reply_toormake_reply_to_rawwithAddMentions::Yesno longer adds people mentioned in the original message to mentions (only the sender of the original message) - Add convenience constructors like
text_plaintoRoomMessageEventContentWithoutRelation- These are the same that are already available on
RoomMessageEventContent
- These are the same that are already available on
- Add methods on
RoomMessageEventWithoutRelationthat were previously only available onRoomMessageEventContent:make_reply_tomake_reply_to_rawadd_mentions
0.27.0
The crate was split out of ruma-common again after ruma-common 0.11.3.
Bug fixes:
- Parse
m.tagorderas a f64 value or a stringified f64 value, if thecompat-tag-infofeature is enabled.
Breaking changes:
- Rename the
keyfield in theSecretStorageDefaultKeyEventContenttokey_id. - Make
in_reply_tofield ofThreadoptional- It was wrong to be mandatory, the spec was unclear
- Remove
AnswerSessionDescriptionandOfferSessionDescriptiontypes, useSessionDescriptioninstead.- Remove
SessionDescriptionType, use aStringinstead. A clarification in MSC2746 / Matrix 1.7 explains that thetypefield 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
reasonfield inCallHangupEventContentis now required and defaults toReason::UserHangup(MSC2746 / Matrix 1.7) - The
Replacementrelation forRoomMessageEventContentnow takes aRoomMessageEventContentWithoutRelationinstead of aMessageType - Make the
redactsfield ofOriginal(Sync)RoomRedactionEventoptional to handle the format where theredactskey is moved inside thecontent, as introduced in room version 11, according to MSC2174 / MSC3820 / Matrix 1.8RoomRedactionEventContent::new()was renamed tonew_v1(), andwith_reason()is no longer a constructor but a builder-type method
- Make the
creatorfield ofRoomCreateEventContentoptional and deprecate it, as it was removed in room version 11, according to MSC2175 / MSC3820 / Matrix 1.8RoomCreateEventContent::new()was renamed tonew_v1()RedactedRoomCreateEventContentis now a typedef overRoomCreateEventContent
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.
- Move the HTML functions in
events::room::message::sanitizeto the ruma-html crate- The
unstable-sanitizecargo feature was renamed tohtml
- The
- Make
viarequired inSpace(Child|Parent)EventContentaccording to a spec clarification - Make
namerequired inRoomNameEventContent, the wording of the spec was confusing - Rename
SecretEncryptionAlgorithmtoSecretStorageEncryptionAlgorithmand itsSecretStorageV1AesHmacSha2variant toV1AesHmacSha2. This variant is also a tuple variant instead of a struct variant
Improvements:
- Add
InitialStateEvent::{new, to_raw, to_raw_any} - Add a convenience method to construct
RoomEncryptionEventContentwith the recommended defaults. - Add
FullStateEventContent::redact - Add new methods for
RoomPowerLevels:user_can_banuser_can_inviteuser_can_kickuser_can_redactuser_can_send_messageuser_can_send_stateuser_can_trigger_room_notification
- Add
MessageType::sanitizebehind thehtmlfeature - 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
- Add support for room version 11 according to MSC3820 / Matrix 1.8
- Add preserved fields to match the new redaction algorithm, according to
MSC2176 / MSC3821, for the following types:
RedactedRoomRedactionEventContent,RedactedRoomPowerLevelsEventContent,RedactedRoomMemberEventContent
- Add preserved fields to match the new redaction algorithm, according to
MSC2176 / MSC3821, for the following types:
- Add
RoomMessageEventContent::make_reply_to_rawto build replies to any event - Add support for custom
SecretStorageEncryptionAlgorithm
0.26.1
Deprecation of the crate. It is now part of ruma-common 0.9.0.
0.26.0
Breaking changes:
- Bump versions of
ruma-common,ruma-identifiers
0.25.0
Breaking changes:
- Remove
RedactedStrippedStateEvent- It was not used anywhere since stripped state events are never actually redacted
- Use
Box<RawJsonValue>instead ofJsonValuefor PDUcontentfield - Require
room::message::MessageTypeto always contain a body- The
newconstructor now also has a body parameter
- The
- Rename
*ToDeviceEventContentstructs toToDevice*Content - Remove unneeded redacted event content enums
- Update
replyandhtml_replytypes toimpl DisplayonRoomMessageEventContent's reply constructors - Remove the
custommodule, which has been redundant for a while- If you are still using it and are unclear on the upgrade path, please get in touch
Improvements:
-
Add
is_allowedtoRoomServerAclEventContent -
Add
room::message::MessageType::bodyaccessor method -
Implement
Redactfor event structs (in addition toAnyevent enums) -
Add
room::message::RoomMessageEventContent::{body, msgtype}accessor methods -
Move
room::message::MessageType::VerificationRequestout ofunstable-pre-spec -
Move MSC implementations from
unstable-pre-specto per-msc features:unstable-msc2448 unstable-msc2675 unstable-msc2676 unstable-msc2677
0.24.6
Improvements:
- Add (unstable) support for MSC3083
0.24.5
Improvements:
- Add
Fromimplementations for event and event content enums - It's now an error for a
room::message::Relationto beReplaceswithout there beingnew_content- Previously, this used to set the relation to
None
- Previously, this used to set the relation to
- Unsupported relations are now deserialized to
relates_to: Some(_)instead ofNone- It's not possible to inspect the inner value though
0.24.4
Improvements:
- Add a workaround for synapse putting
prev_contentin unsigned (only active if thecompatfeature is enabled)
0.24.3
Improvements:
- Add unstable support for
m.secret.requestandm.secret.sendevents
0.24.2
Improvements:
- Add missing constructor and
Fromimplementation forEncryptedToDeviceEventContent
0.24.1
Breaking changes:
room::name::NameEventContentnow uses a customRoomNameBoxtype for itsnamefield and makes it public, in response the constructor andnameaccessor had their types updated too- Replace
InvalidEventby a more specificFromStringErrorfor room name validation - Remove unused
FromStrError - Remove deprecated method
room::name::NameEventContent::name - Make
encrypted::EncryptedToDeviceEventContentits own type instead of a type alias forEncryptedEventContent- It doesn't have the
relates_tofieldEncryptedEventContenthas
- It doesn't have the
- Upgrade dependencies
Improvements:
- Add the
StaticEventContenttrait for abstracting over event content struct types (with a type known at compile-time)
0.24.0
Yanked, was released too early missing another important breaking change.
0.23.3
Improvements:
- Add unstable blurhash field to member event content struct
- Add constructors for the unstable spaces parent and child event content types
Bug fixes:
- Remove
new_contentfrom the plain-text part ofm.encryptedevents- It is supposed to go into the encrypted payload, but we expected it in the plain-text part before.
- This is technically a breaking change but since that can only be observed behind an unstable feature and this change doesn't break matrix-sdk, it's made in a point release.
0.23.2
Bug fixes:
- Fix reaction event (de)serialization (was broken in 0.23.0)
0.23.1
Improvements:
- Allow the macros exported by ruma-events to be used by crates that depend on matrix-sdk, but not (directly) on ruma or ruma-events
0.23.0
Breaking changes:
- Rename
key::verification::AcceptMethod::{MSasV1 => SasV1} - As above, drop
Mprefix fromkey::verification::VerificationMethodvariants- Additionally, fix the name of the QR code one (
QrScanShowV1toQrCodeScanV1)
- Additionally, fix the name of the QR code one (
- Remove
room::power_level::NotificationPowerLevels, now found inruma_common::power_levels(orruma::power_levels) - Remove
Customvariant from event enums. If you were using this, please get in touch. - Remove
Customvariant fromkey::verification::accept::AcceptMethodandkey::verification::start::StartMethod. - Rename
relationfield in some events torelates_to - All events that support relations now have their own
Relationtypes (theroom::relationshipsmodule has been removed)- The
room::encryptionrelation type can represent any kind of relation and hasFromimplementations so any other relation can be converted to it
- The
Improvements:
- Add types for decrypted
m.room.encryptionevent payloads (DecryptedOlmV1Event,DecryptedMegolmV1Event)- Currently, these don't have corresponding enums (and they might never get ones), instead to
represent a decrypted event payload with an unknown event type use
AnyMessageEventContentfor the generic parameter
- Currently, these don't have corresponding enums (and they might never get ones), instead to
represent a decrypted event payload with an unknown event type use
0.22.2
Improvements:
- Add unstable support for
m.space.childandm.space.parentevents
0.22.1
Bug fixes:
- Fix serialized format of
DummyEventContent
0.22.0
Breaking changes:
-
Change the structure of
StartEventContentso that we can access transaction ids without the need to understand the concrete method. -
Change
get_message_eventslimit field type fromOption<UInt>toUInt -
Add
alt_aliasestoCanonicalAliasEventContent -
Replace
formatandformatted_bodyfields inTextMessageEventContent,NoticeMessageEventContentandEmoteMessageEventContentwithformatted: FormattedBody -
Rename
override_rulesinpush_rules::Rulesettooverride_ -
Change
push_rules::PushConditionvariants from newtype variants with separate inner types to struct variants- This change removes the types
EventMatchCondition,RoomMemberCountConditionandSenderNotificationPermissionCondition
- This change removes the types
-
Add PDU types:
pdu::{Pdu, PduStub} -
presence::PresenceStatehas been moved. Import it fromrumaorruma-common. -
EventJsonhas been moved and renamed. Import it fromrumaorruma-common. -
The
in_reply_tofield ofroom::message::RelatesTois now optional -
Use
ruma_identifiers::{ServerName, ServerKeyId}insignaturesfields ofpdu::RoomV1Pdu, RoomV1PduStub, RoomV3Pdu, RoomV3PduStub}androom::member::SignedContent. -
Remove the
EventType::Customvariant. You can still check for custom event types by going through.as_str(). This ensures that new event types doesn't break existing code. -
Remove the implementations of
From<EventType>andFrom<key::verification::cancel::CancelCode>forString. Use theDisplayorToStringimplementations for those types instead. -
Remove
PduStub,RoomV1PduStubandRoomV3PduStubtypes -
Use
ruma_identifiers::MxcUriinstead ofStringforavatar_url,thumbnail_urlorurlfields in the following types:presence::PresenceEventContent, room::{ avatar::{AvatarEventContent, ImageInfo}, member::MemberEventContent, message::{ AudioMessageEventContent, FileMessageEventContent, ImageMessageEventContent, VideoMessageEventContent } EncryptedFile, ImageInfo, }, sticker::StickerEventContent -
Add
tag::TagNametype and use it fortag::Tags -
Move
FullyReadfromEphemeralRoomenum toRoomAccountDataenum -
Split
Basicenum intoGlobalAccountDataandRoomAccountDataenums- Remove
DummyEvent,DummyEventContent,RoomKeyEvent,RoomKeyEventContent
- Remove
-
Remove
BasicEventContenttrait and derive -
Make most of the types in this crate non-exhaustive
Improvements:
- Add
room::MessageFormatandroom::FormattedBody - Skip serialization of optional values on
room::encryption::EncryptionEventContent - Rename
TextMessageEventContent::new_plaintoplain(the old name is still available, but deprecated) - Add more constructors for types in
room::message:TextMessageEventContent::htmlNoticeMessageEventContent::plainNoticeMessageEventContent::htmlMessageEventContent::text_plainMessageEventContent::text_htmlMessageEventContent::notice_plainMessageEventContent::notice_html
- Add policy rule entities:
policy::rule::roompolicy::rule::serverpolicy::rule::user
- Add policy rule recommendation:
Recommendation::Ban
0.21.3
Bug fixes:
- Fix
m.room.messageevent serialization
Improvements:
- Skip serialization of
federatefield inroom::create::CreateEventContentif it istrue(the default value) room::power_levels::PowerLevelsEventContentnow implementsDefault
0.21.2
Improvements:
- Update dependencies
0.21.1
Improvements:
- Add
EventJson::into_json
0.21.0
Breaking changes:
- Replace
EventResultwith a new construct,EventJson- Instead of only capturing the json value if deserialization failed, we now
now always capture it. To improve deserialization performance at the same
time, we no longer use
serde_json::Valueinternally and instead deserialize events asBox<serde_json::value::RawValue>.EventJsonis simply a wrapper around that owned value type that additionally holds a generic argument: the type as which clients will usually want to deserialize the raw value.
- Instead of only capturing the json value if deserialization failed, we now
now always capture it. To improve deserialization performance at the same
time, we no longer use
- Add
struct UnsignedDataand update allunsignedfields types fromBTreeMap<String, Value>to this new type.- To access any additional fields of the
unsignedproperty of an event, deserialize theEventJsonto another type that captures the field(s) you are interested in.
- To access any additional fields of the
- Add fields
formatandformatted_bodytoroom::message::NoticeMessageEventContent - Remove
room::message::MessageType - Remove useless
algorithmfields from encrypted event content structs - Remove
PartialEqimplementations for most types- Since we're now using
serde_json::value::RawValue, deriving no longer works
- Since we're now using
- Update the representation of
push_rules::Tweak - Raise minimum supported Rust version to 1.40.0
0.20.0
Improvements:
- Update ruma-identifiers to 0.16.0
0.19.0
Breaking changes:
- Update ruma-identifiers to 0.15.1
- Change timestamps, including
origin_server_rsfromUInttoSystemTime - Change all usages of
HashMaptoBTreeMap- To support this,
EventTypenow implementsPartialOrdandOrd
- To support this,
0.18.0
Breaking changes:
- Update unsigned field's type from
Option<Value>toMap<String, Value>
Improvements:
- Add a convenience constructor to create a plain-text
TextMessageEventContent - Add
m.dummyevents to the to-device event collection
0.17.0
Breaking changes:
collections::onlyno longer exports arawsubmodule. It was never meant to be exported in the first place.- Renamed
stripped::{StrippedState => AnyStrippedStateEvent, StrippedStateContent => StrippedStateEvent}
Improvements:
- Added
to_devicemodule with to-device variants of events (as found in theto_devicesection of a sync response) - Added a helper method for computing the membership change from a
MemberEvent
Bug fixes:
- Fixed missing
m.inm.relates_tofield of room messages - Fixed (de)serialization of encrypted events using
m.olm.v1.curve25519-aes-sha2
0.16.0
Breaking changes:
TryFromRaw::try_from_raw's signature has been simplified. The previous signature was a relict that was no longer sensible.- All remaining non-optional
room_idevent fields (not event content fields) have been made optional
Improvements:
NameEvents are now validated properly and will be rejected if thenamefield is longer than 255 bytes.
0.15.1
Bug fixes:
- Deserialization of custom events as part of the types from
ruma_events::collections::{all, only}was implemented (this was missing after the big fallible deserializion rewrite in 0.15.0)
0.15.0
Improvements:
ruma-eventsnow exports a new type,EventResult- For any event or event content type
Tinside a larger type that should support deserialization you can useEventResult<T>instead - Conceptually, it is the same as
Result<T, InvalidEvent> InvalidEventcan represent either a deserialization error (the event's structure did not match) or a validation error (some additional constraints defined in the matrix spec were violated)- It also contains the original value that was attempted to be deserialized into
Tinserde_json::Valueform
- It also contains the original value that was attempted to be deserialized into
- For any event or event content type
Breaking changes:
- The
FromStrimplementations for event types were removed (they were the previous implementation of fallible deserialization, but were never integrated in ruma-client-api because they didn't interoperate well with serde derives)
0.14.0
Breaking changes:
- Updated to ruma-identifiers 0.14.0.
Improvements:
- ruma-events is now checked against the RustSec advisory database.
0.13.0
Breaking changes:
- Events and their content types no longer implement
Deserializeand instead implementFromStrandTryFrom<&str>, which take a&strof JSON data and return a newInvalidEventtype on error. - Integers are now represented using the
IntandUInttypes from thejs_intcrate to ensure they are within the JavaScript-interoperable range mandated by the Matrix specification. - Some event types have new fields or new default values for previous fields to bring them up to date with version r0.5.0 of the client-server specification.
- Some event types no longer have public fields and instead use a constructor function to perform validations not represented by the type system.
- All enums now include a "nonexhaustive" variant to prevent exhaustive pattern matching. This will
change to use the
#[nonexhaustive]attribute when it is stabilized. ParseErrorhas been renamedFromStrError.
New features:
- This release brings ruma-events completely up to date with version r0.5.0 of the client-server
specification. All previously supported events have been updated as necessary and the following
events have newly added support:
- m.dummy
- m.forwarded_room_key
- m.fully_read
- m.ignored_user_list
- m.key.verification.accept
- m.key.verification.cancel
- m.key.verification.key
- m.key.verification.mac
- m.key.verification.request
- m.key.verification.start
- m.push_rules
- m.key.encrypted
- m.key.encryption
- m.key.server_acl
- m.key.tombstone
- m.room_key
- m.room_key_request
- m.sticker
Improvements:
- Improved documentation for the crate and for many types.
- Added many new tests.
- rustfmt and clippy are now used to ensure consistent formatting and improved code quality.
0.12.0
Improvements:
- ruma-events now runs on stable Rust, requiring version 1.34 or higher.
Bug fixes:
CanonicalAliasEventandNameEventnow allow content being absent, null, or empty, as per the spec.
0.11.1
Breaking changes:
RoomIdis now optional in certain places where it may be absent, notably the responses of the/syncAPI endpoint.- A
senderfield has been added to theStrippedStateContenttype.
Improvements:
- Depend on serde's derive feature rather than serde_derive directly for simplified imports.
- Update to Rust 2018 idioms.
0.11.0
Breaking changes:
- The presence event has been modified to match the latest version of the spec. The spec was corrected to match the behavior of the Synapse homeserver.
Improvements:
- Dependencies have been updated to the latest versions.
0.10.0
Breaking changes:
- The
EventType, and collections enums have new variants to support new events. - The
extra_contentmethod has been removed from the Event trait. - The
user_idmethod from theRoomEventtrait has been renamedsenderto match the specification. - The
origin_server_tsvalue is now required for room events and is supported via a neworigin_server_tsmethod on theRoomEventtrait. MemberEventContenthas a newis_directfield.FileMessageEventContenthas a newfilenamefield.- File and thumbnail info have been moved from several message types to dedicated
FileInfo,ImageInfo, andThumbnailInfotypes. LocationMessageEventContenthas a new info field.PresenceEventContent'scurrently_activefield has changed frombooltoOption.TypingEventContentcontains a vector ofUserIds instead ofEventIds.- Height and width fields named
handwin the spec now use the full namesheightandwidthfor their struct field names, but continue to serialize to the single-letter names.
New features:
- ruma-events now supports all events according to r0.3.0 of the Matrix client-server specification.
- Added new event:
m.room.pinned_events. - Added new event:
m.direct.
Bug fixes:
- Several places where struct fields used the wrong key when serialized to JSON have been corrected.
- Fixed grammar issues in documentation.
0.9.0
Improvements:
- Added default values for various power level attributes.
- Removed Serde trait bounds on
StrippedStateContent's generic parameter. - Updated to version 0.4 of ruma-signatures.
0.8.0
Breaking changes
- Updated serde to the 1.0 series.
0.7.0
Bug fixes:
- Make the
federatefield optional when creating a room.
0.6.0
Breaking changes:
- Updated ruma-identifiers to the 0.9 series.
0.5.0
Breaking changes:
- Updated ruma-identifiers to the 0.8 series.
0.4.1
Improvements:
- Relaxed version constraints on dependent crates to allow updating to new patch level versions.
0.4.0
Breaking changes:
- Updated serde to the 0.9 series.
The public API remains the same.
0.3.0
Improvements:
ruma_events::presence::PresenceStatenow implementsDisplayandFromStr.
0.2.0
Improvements:
- Added missing "stripped" versions of some state events.
- All "stripped" versions of state events are now serializable.
0.1.0
Initial release.