events: Move relations under events::room::message to events::relation
This commit is contained in:
		
							parent
							
								
									a6ba268796
								
							
						
					
					
						commit
						aeaa4af776
					
				| @ -31,6 +31,8 @@ Breaking changes: | |||||||
| * Change the `ignored_users` field of `IgnoredUserListEventContent` to a map of empty structs, to | * Change the `ignored_users` field of `IgnoredUserListEventContent` to a map of empty structs, to | ||||||
|   allow eventual fields to be added, as intended by the spec |   allow eventual fields to be added, as intended by the spec | ||||||
| * Make `SimplePushRule` and associated types generic over the expected type of the `rule_id` | * Make `SimplePushRule` and associated types generic over the expected type of the `rule_id` | ||||||
|  | * Deduplicate and group relation structs in `events::relation`: | ||||||
|  |   * Move relation structs under `events::room::message` to `events::relation` | ||||||
| 
 | 
 | ||||||
| Improvements: | Improvements: | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -13,6 +13,23 @@ use crate::{ | |||||||
|     MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedUserId, PrivOwnedStr, |     MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedUserId, PrivOwnedStr, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | /// Information about the event a [rich reply] is replying to.
 | ||||||
|  | ///
 | ||||||
|  | /// [rich reply]: https://spec.matrix.org/v1.5/client-server-api/#rich-replies
 | ||||||
|  | #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|  | #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] | ||||||
|  | pub struct InReplyTo { | ||||||
|  |     /// The event being replied to.
 | ||||||
|  |     pub event_id: OwnedEventId, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | impl InReplyTo { | ||||||
|  |     /// Creates a new `InReplyTo` with the given event ID.
 | ||||||
|  |     pub fn new(event_id: OwnedEventId) -> Self { | ||||||
|  |         Self { event_id } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /// Summary of all annotations to an event with the given key and type.
 | /// Summary of all annotations to an event with the given key and type.
 | ||||||
| #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] | #[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] | ||||||
| #[cfg(feature = "unstable-msc2677")] | #[cfg(feature = "unstable-msc2677")] | ||||||
| @ -106,6 +123,64 @@ impl BundledReplacement { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /// The content of a [replacement] relation.
 | ||||||
|  | ///
 | ||||||
|  | /// [replacement]: https://spec.matrix.org/v1.5/client-server-api/#event-replacements
 | ||||||
|  | #[derive(Clone, Debug)] | ||||||
|  | #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] | ||||||
|  | pub struct Replacement<C> { | ||||||
|  |     /// The ID of the event being replaced.
 | ||||||
|  |     pub event_id: OwnedEventId, | ||||||
|  | 
 | ||||||
|  |     /// New content.
 | ||||||
|  |     pub new_content: C, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | impl<C> Replacement<C> { | ||||||
|  |     /// Creates a new `Replacement` with the given event ID and new content.
 | ||||||
|  |     pub fn new(event_id: OwnedEventId, new_content: C) -> Self { | ||||||
|  |         Self { event_id, new_content } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | /// The content of a [thread] relation.
 | ||||||
|  | ///
 | ||||||
|  | /// [thread]: https://spec.matrix.org/v1.5/client-server-api/#threading
 | ||||||
|  | #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|  | #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] | ||||||
|  | pub struct Thread { | ||||||
|  |     /// The ID of the root message in the thread.
 | ||||||
|  |     pub event_id: OwnedEventId, | ||||||
|  | 
 | ||||||
|  |     /// A reply relation.
 | ||||||
|  |     ///
 | ||||||
|  |     /// If this event is a reply and belongs to a thread, this points to the message that is being
 | ||||||
|  |     /// replied to, and `is_falling_back` must be set to `false`.
 | ||||||
|  |     ///
 | ||||||
|  |     /// If this event is not a reply, this is used as a fallback mechanism for clients that do not
 | ||||||
|  |     /// support threads. This should point to the latest message-like event in the thread and
 | ||||||
|  |     /// `is_falling_back` must be set to `true`.
 | ||||||
|  |     pub in_reply_to: InReplyTo, | ||||||
|  | 
 | ||||||
|  |     /// Whether the `m.in_reply_to` field is a fallback for older clients or a genuine reply in a
 | ||||||
|  |     /// thread.
 | ||||||
|  |     pub is_falling_back: bool, | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | impl Thread { | ||||||
|  |     /// Convenience method to create a regular `Thread` with the given event ID and latest
 | ||||||
|  |     /// message-like event ID.
 | ||||||
|  |     pub fn plain(event_id: OwnedEventId, latest_event_id: OwnedEventId) -> Self { | ||||||
|  |         Self { event_id, in_reply_to: InReplyTo::new(latest_event_id), is_falling_back: true } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /// Convenience method to create a reply `Thread` with the given event ID and replied-to event
 | ||||||
|  |     /// ID.
 | ||||||
|  |     pub fn reply(event_id: OwnedEventId, reply_to_event_id: OwnedEventId) -> Self { | ||||||
|  |         Self { event_id, in_reply_to: InReplyTo::new(reply_to_event_id), is_falling_back: false } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| /// A bundled thread.
 | /// A bundled thread.
 | ||||||
| #[derive(Clone, Debug, Deserialize, Serialize)] | #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
| #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] | #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] | ||||||
|  | |||||||
| @ -8,8 +8,8 @@ use js_int::UInt; | |||||||
| use ruma_macros::EventContent; | use ruma_macros::EventContent; | ||||||
| use serde::{Deserialize, Serialize}; | use serde::{Deserialize, Serialize}; | ||||||
| 
 | 
 | ||||||
| use super::message::{self, InReplyTo}; | use super::message; | ||||||
| use crate::{OwnedDeviceId, OwnedEventId}; | use crate::{events::relation::InReplyTo, OwnedDeviceId, OwnedEventId}; | ||||||
| 
 | 
 | ||||||
| mod relation_serde; | mod relation_serde; | ||||||
| 
 | 
 | ||||||
| @ -130,9 +130,9 @@ impl<C> From<message::Relation<C>> for Relation { | |||||||
| 
 | 
 | ||||||
| /// The event this relation belongs to [replaces another event].
 | /// The event this relation belongs to [replaces another event].
 | ||||||
| ///
 | ///
 | ||||||
| /// In contrast to [`message::Replacement`](super::message::Replacement), this struct doesn't
 | /// In contrast to [`relation::Replacement`](crate::events::relation::Replacement), this struct
 | ||||||
| /// store the new content, since that is part of the encrypted content of an `m.room.encrypted`
 | /// doesn't store the new content, since that is part of the encrypted content of an
 | ||||||
| /// events.
 | /// `m.room.encrypted` events.
 | ||||||
| ///
 | ///
 | ||||||
| /// [replaces another event]: https://spec.matrix.org/v1.4/client-server-api/#event-replacements
 | /// [replaces another event]: https://spec.matrix.org/v1.4/client-server-api/#event-replacements
 | ||||||
| #[derive(Clone, Debug, Deserialize, Serialize)] | #[derive(Clone, Debug, Deserialize, Serialize)] | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; | |||||||
| use serde_json::Value as JsonValue; | use serde_json::Value as JsonValue; | ||||||
| 
 | 
 | ||||||
| use crate::{ | use crate::{ | ||||||
|  |     events::relation::{InReplyTo, Replacement, Thread}, | ||||||
|     serde::{JsonObject, StringEnum}, |     serde::{JsonObject, StringEnum}, | ||||||
|     OwnedEventId, PrivOwnedStr, |     OwnedEventId, PrivOwnedStr, | ||||||
| }; | }; | ||||||
| @ -591,77 +592,6 @@ pub enum Relation<C> { | |||||||
|     _Custom, |     _Custom, | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /// Information about the event a "rich reply" is replying to.
 |  | ||||||
| #[derive(Clone, Debug, Deserialize, Serialize)] |  | ||||||
| #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] |  | ||||||
| pub struct InReplyTo { |  | ||||||
|     /// The event being replied to.
 |  | ||||||
|     pub event_id: OwnedEventId, |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| impl InReplyTo { |  | ||||||
|     /// Creates a new `InReplyTo` with the given event ID.
 |  | ||||||
|     pub fn new(event_id: OwnedEventId) -> Self { |  | ||||||
|         Self { event_id } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /// The event this relation belongs to [replaces another event].
 |  | ||||||
| ///
 |  | ||||||
| /// [replaces another event]: https://spec.matrix.org/v1.4/client-server-api/#event-replacements
 |  | ||||||
| #[derive(Clone, Debug)] |  | ||||||
| #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] |  | ||||||
| pub struct Replacement<C> { |  | ||||||
|     /// The ID of the event being replaced.
 |  | ||||||
|     pub event_id: OwnedEventId, |  | ||||||
| 
 |  | ||||||
|     /// New content.
 |  | ||||||
|     pub new_content: C, |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| impl<C> Replacement<C> { |  | ||||||
|     /// Creates a new `Replacement` with the given event ID and new content.
 |  | ||||||
|     pub fn new(event_id: OwnedEventId, new_content: C) -> Self { |  | ||||||
|         Self { event_id, new_content } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /// The content of a thread relation.
 |  | ||||||
| #[derive(Clone, Debug, Deserialize, Serialize)] |  | ||||||
| #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] |  | ||||||
| pub struct Thread { |  | ||||||
|     /// The ID of the root message in the thread.
 |  | ||||||
|     pub event_id: OwnedEventId, |  | ||||||
| 
 |  | ||||||
|     /// A reply relation.
 |  | ||||||
|     ///
 |  | ||||||
|     /// If this event is a reply and belongs to a thread, this points to the message that is being
 |  | ||||||
|     /// replied to, and `is_falling_back` must be set to `false`.
 |  | ||||||
|     ///
 |  | ||||||
|     /// If this event is not a reply, this is used as a fallback mechanism for clients that do not
 |  | ||||||
|     /// support threads. This should point to the latest message-like event in the thread and
 |  | ||||||
|     /// `is_falling_back` must be set to `true`.
 |  | ||||||
|     pub in_reply_to: InReplyTo, |  | ||||||
| 
 |  | ||||||
|     /// Whether the `m.in_reply_to` field is a fallback for older clients or a genuine reply in a
 |  | ||||||
|     /// thread.
 |  | ||||||
|     pub is_falling_back: bool, |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| impl Thread { |  | ||||||
|     /// Convenience method to create a regular `Thread` with the given event ID and latest
 |  | ||||||
|     /// message-like event ID.
 |  | ||||||
|     pub fn plain(event_id: OwnedEventId, latest_event_id: OwnedEventId) -> Self { |  | ||||||
|         Self { event_id, in_reply_to: InReplyTo::new(latest_event_id), is_falling_back: true } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     /// Convenience method to create a reply `Thread` with the given event ID and replied-to event
 |  | ||||||
|     /// ID.
 |  | ||||||
|     pub fn reply(event_id: OwnedEventId, reply_to_event_id: OwnedEventId) -> Self { |  | ||||||
|         Self { event_id, in_reply_to: InReplyTo::new(reply_to_event_id), is_falling_back: false } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| /// The format for the formatted representation of a message body.
 | /// The format for the formatted representation of a message body.
 | ||||||
| #[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))] | #[doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/doc/string_enum.md"))] | ||||||
| #[derive(Clone, Debug, PartialEq, Eq, StringEnum)] | #[derive(Clone, Debug, PartialEq, Eq, StringEnum)] | ||||||
|  | |||||||
| @ -11,10 +11,9 @@ use ruma_common::{ | |||||||
|         audio::{Amplitude, AudioContent, AudioEventContent, Waveform, WaveformError}, |         audio::{Amplitude, AudioContent, AudioEventContent, Waveform, WaveformError}, | ||||||
|         file::{EncryptedContentInit, FileContent, FileContentInfo}, |         file::{EncryptedContentInit, FileContent, FileContentInfo}, | ||||||
|         message::MessageContent, |         message::MessageContent, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::{ |         room::{ | ||||||
|             message::{ |             message::{AudioMessageEventContent, MessageType, Relation, RoomMessageEventContent}, | ||||||
|                 AudioMessageEventContent, InReplyTo, MessageType, Relation, RoomMessageEventContent, |  | ||||||
|             }, |  | ||||||
|             JsonWebKeyInit, MediaSource, |             JsonWebKeyInit, MediaSource, | ||||||
|         }, |         }, | ||||||
|         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, |         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, | ||||||
|  | |||||||
| @ -1,12 +1,12 @@ | |||||||
| use assert_matches::assert_matches; | use assert_matches::assert_matches; | ||||||
| use ruma_common::{ | use ruma_common::{ | ||||||
|     device_id, event_id, |     device_id, event_id, | ||||||
|     events::room::{ |     events::{ | ||||||
|         encrypted::{ |         relation::InReplyTo, | ||||||
|  |         room::encrypted::{ | ||||||
|             EncryptedEventScheme, MegolmV1AesSha2ContentInit, Reference, Relation, Replacement, |             EncryptedEventScheme, MegolmV1AesSha2ContentInit, Reference, Relation, Replacement, | ||||||
|             RoomEncryptedEventContent, Thread, |             RoomEncryptedEventContent, Thread, | ||||||
|         }, |         }, | ||||||
|         message::InReplyTo, |  | ||||||
|     }, |     }, | ||||||
| }; | }; | ||||||
| use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | ||||||
|  | |||||||
| @ -8,10 +8,9 @@ use ruma_common::{ | |||||||
|     events::{ |     events::{ | ||||||
|         file::{EncryptedContentInit, FileContentInfo, FileEventContent}, |         file::{EncryptedContentInit, FileContentInfo, FileEventContent}, | ||||||
|         message::MessageContent, |         message::MessageContent, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::{ |         room::{ | ||||||
|             message::{ |             message::{FileMessageEventContent, MessageType, Relation, RoomMessageEventContent}, | ||||||
|                 FileMessageEventContent, InReplyTo, MessageType, Relation, RoomMessageEventContent, |  | ||||||
|             }, |  | ||||||
|             EncryptedFileInit, JsonWebKeyInit, MediaSource, |             EncryptedFileInit, JsonWebKeyInit, MediaSource, | ||||||
|         }, |         }, | ||||||
|         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, |         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, | ||||||
|  | |||||||
| @ -12,10 +12,9 @@ use ruma_common::{ | |||||||
|             ThumbnailFileContentInfo, |             ThumbnailFileContentInfo, | ||||||
|         }, |         }, | ||||||
|         message::MessageContent, |         message::MessageContent, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::{ |         room::{ | ||||||
|             message::{ |             message::{ImageMessageEventContent, MessageType, Relation, RoomMessageEventContent}, | ||||||
|                 ImageMessageEventContent, InReplyTo, MessageType, Relation, RoomMessageEventContent, |  | ||||||
|             }, |  | ||||||
|             JsonWebKeyInit, MediaSource, |             JsonWebKeyInit, MediaSource, | ||||||
|         }, |         }, | ||||||
|         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, |         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, | ||||||
|  | |||||||
| @ -8,8 +8,9 @@ use ruma_common::{ | |||||||
|     events::{ |     events::{ | ||||||
|         location::{AssetType, LocationContent, LocationEventContent, ZoomLevel, ZoomLevelError}, |         location::{AssetType, LocationContent, LocationEventContent, ZoomLevel, ZoomLevelError}, | ||||||
|         message::MessageContent, |         message::MessageContent, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::message::{ |         room::message::{ | ||||||
|             InReplyTo, LocationMessageEventContent, MessageType, Relation, RoomMessageEventContent, |             LocationMessageEventContent, MessageType, Relation, RoomMessageEventContent, | ||||||
|         }, |         }, | ||||||
|         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, |         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, | ||||||
|     }, |     }, | ||||||
|  | |||||||
| @ -9,9 +9,8 @@ use ruma_common::{ | |||||||
|         emote::EmoteEventContent, |         emote::EmoteEventContent, | ||||||
|         message::{MessageContent, MessageEventContent, Text}, |         message::{MessageContent, MessageEventContent, Text}, | ||||||
|         notice::NoticeEventContent, |         notice::NoticeEventContent, | ||||||
|         room::message::{ |         relation::InReplyTo, | ||||||
|             EmoteMessageEventContent, InReplyTo, MessageType, Relation, RoomMessageEventContent, |         room::message::{EmoteMessageEventContent, MessageType, Relation, RoomMessageEventContent}, | ||||||
|         }, |  | ||||||
|         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, |         AnyMessageLikeEvent, MessageLikeEvent, MessageLikeUnsigned, OriginalMessageLikeEvent, | ||||||
|     }, |     }, | ||||||
|     room_id, |     room_id, | ||||||
|  | |||||||
| @ -2,7 +2,10 @@ use assert_matches::assert_matches; | |||||||
| use assign::assign; | use assign::assign; | ||||||
| use ruma_common::{ | use ruma_common::{ | ||||||
|     event_id, |     event_id, | ||||||
|     events::room::message::{InReplyTo, MessageType, Relation, RoomMessageEventContent}, |     events::{ | ||||||
|  |         relation::{InReplyTo, Replacement, Thread}, | ||||||
|  |         room::message::{MessageType, Relation, RoomMessageEventContent}, | ||||||
|  |     }, | ||||||
| }; | }; | ||||||
| use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | ||||||
| 
 | 
 | ||||||
| @ -67,8 +70,6 @@ fn reply_serialize() { | |||||||
| 
 | 
 | ||||||
| #[test] | #[test] | ||||||
| fn replacement_serialize() { | fn replacement_serialize() { | ||||||
|     use ruma_common::events::room::message::Replacement; |  | ||||||
| 
 |  | ||||||
|     let content = assign!( |     let content = assign!( | ||||||
|         RoomMessageEventContent::text_plain("<text msg>"), |         RoomMessageEventContent::text_plain("<text msg>"), | ||||||
|         { |         { | ||||||
| @ -148,8 +149,6 @@ fn replacement_deserialize() { | |||||||
| 
 | 
 | ||||||
| #[test] | #[test] | ||||||
| fn thread_plain_serialize() { | fn thread_plain_serialize() { | ||||||
|     use ruma_common::events::room::message::Thread; |  | ||||||
| 
 |  | ||||||
|     let content = assign!( |     let content = assign!( | ||||||
|         RoomMessageEventContent::text_plain("<text msg>"), |         RoomMessageEventContent::text_plain("<text msg>"), | ||||||
|         { |         { | ||||||
| @ -200,8 +199,6 @@ fn thread_plain_serialize() { | |||||||
| 
 | 
 | ||||||
| #[test] | #[test] | ||||||
| fn thread_reply_serialize() { | fn thread_reply_serialize() { | ||||||
|     use ruma_common::events::room::message::Thread; |  | ||||||
| 
 |  | ||||||
|     let content = assign!( |     let content = assign!( | ||||||
|         RoomMessageEventContent::text_plain("<text msg>"), |         RoomMessageEventContent::text_plain("<text msg>"), | ||||||
|         { |         { | ||||||
|  | |||||||
| @ -11,10 +11,9 @@ use ruma_common::{ | |||||||
|         file::{EncryptedContentInit, FileContent, FileContentInfo}, |         file::{EncryptedContentInit, FileContent, FileContentInfo}, | ||||||
|         image::{ThumbnailContent, ThumbnailFileContent, ThumbnailFileContentInfo}, |         image::{ThumbnailContent, ThumbnailFileContent, ThumbnailFileContentInfo}, | ||||||
|         message::MessageContent, |         message::MessageContent, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::{ |         room::{ | ||||||
|             message::{ |             message::{MessageType, Relation, RoomMessageEventContent, VideoMessageEventContent}, | ||||||
|                 InReplyTo, MessageType, Relation, RoomMessageEventContent, VideoMessageEventContent, |  | ||||||
|             }, |  | ||||||
|             JsonWebKeyInit, MediaSource, |             JsonWebKeyInit, MediaSource, | ||||||
|         }, |         }, | ||||||
|         video::{VideoContent, VideoEventContent}, |         video::{VideoContent, VideoEventContent}, | ||||||
|  | |||||||
| @ -10,10 +10,9 @@ use ruma_common::{ | |||||||
|     events::{ |     events::{ | ||||||
|         audio::AudioContent, |         audio::AudioContent, | ||||||
|         file::{FileContent, FileContentInfo}, |         file::{FileContent, FileContentInfo}, | ||||||
|  |         relation::InReplyTo, | ||||||
|         room::{ |         room::{ | ||||||
|             message::{ |             message::{AudioMessageEventContent, MessageType, Relation, RoomMessageEventContent}, | ||||||
|                 AudioMessageEventContent, InReplyTo, MessageType, Relation, RoomMessageEventContent, |  | ||||||
|             }, |  | ||||||
|             MediaSource, |             MediaSource, | ||||||
|         }, |         }, | ||||||
|         voice::{VoiceContent, VoiceEventContent}, |         voice::{VoiceContent, VoiceEventContent}, | ||||||
|  | |||||||
| @ -1,7 +1,10 @@ | |||||||
| use assert_matches::assert_matches; | use assert_matches::assert_matches; | ||||||
| use ruma_common::{ | use ruma_common::{ | ||||||
|     event_id, |     event_id, | ||||||
|     events::room::message::{InReplyTo, MessageType, Relation, RoomMessageEventContent}, |     events::{ | ||||||
|  |         relation::InReplyTo, | ||||||
|  |         room::message::{MessageType, Relation, RoomMessageEventContent}, | ||||||
|  |     }, | ||||||
| }; | }; | ||||||
| use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user