events: Change rich_reply.md to not require specific symbols to be in scope

… for intra-doc links.
This commit is contained in:
Jonas Platte 2023-11-08 16:19:12 +01:00
parent e37918c9b8
commit 37c93d57e5
No known key found for this signature in database
GPG key ID: AAA7A61F696C3E0C
2 changed files with 6 additions and 6 deletions

View file

@ -1,8 +1,7 @@
<!-- Keep this comment so the content is always included as a new paragraph -->
This function requires an [`OriginalRoomMessageEvent`] since it creates a permalink to
the previous message, for which the room ID is required. If you want to reply to an
[`OriginalSyncRoomMessageEvent`], you have to convert it first by calling
[`.into_full_event()`][crate::OriginalSyncMessageLikeEvent::into_full_event].
[`OriginalSyncRoomMessageEvent`], you have to convert it first by calling [`.into_full_event()`].
If the message was edited, the previous message should be the original message that was edited,
with the content of its replacement, to allow the fallback to be accurate at the time it is added.
@ -11,4 +10,9 @@ It is recommended to enable the `html` feature when using this method as this wi
clean up nested [rich reply fallbacks] in chains of replies. This uses [`sanitize_html()`]
internally, with [`RemoveReplyFallback::Yes`].
[`OriginalRoomMessageEvent`]: crate::room::message::OriginalRoomMessageEvent
[`OriginalSyncRoomMessageEvent`]: crate::room::message::OriginalSyncRoomMessageEvent
[`.into_full_event()`]: crate::OriginalSyncMessageLikeEvent::into_full_event
[rich reply fallbacks]: https://spec.matrix.org/latest/client-server-api/#fallbacks-for-rich-replies
[`sanitize_html()`]: ruma_html::sanitize_html
[`RemoveReplyFallback::Yes`]: ruma_html::RemoveReplyFallback::Yes

View file

@ -1,11 +1,7 @@
use as_variant::as_variant;
use ruma_common::{serde::Raw, OwnedEventId, OwnedUserId, RoomId, UserId};
#[cfg(doc)]
use ruma_html::{sanitize_html, RemoveReplyFallback};
use serde::{Deserialize, Serialize};
#[cfg(doc)]
use super::OriginalSyncRoomMessageEvent;
use super::{
AddMentions, ForwardThread, MessageType, OriginalRoomMessageEvent, Relation,
RoomMessageEventContent,