events: Expose missing url preview image types

`PreviewImage` and `PreviewImageSource` were not properly exposed, making it impossible for anyone to actually use them.
This commit is contained in:
Benjamin Kampmann 2025-02-25 20:22:15 +01:00 committed by June Clementine Strawberry
parent f80d04d6a8
commit 0e84b0ab99
2 changed files with 5 additions and 1 deletions

View file

@ -47,7 +47,7 @@ pub use self::audio::{
UnstableAmplitude, UnstableAudioDetailsContentBlock, UnstableVoiceContentBlock,
};
#[cfg(feature = "unstable-msc4095")]
pub use self::url_preview::UrlPreview;
pub use self::url_preview::{PreviewImage, PreviewImageSource, UrlPreview};
pub use self::{
audio::{AudioInfo, AudioMessageEventContent},
emote::EmoteMessageEventContent,

View file

@ -4,9 +4,13 @@ use crate::room::{EncryptedFile, OwnedMxcUri, UInt};
/// The Source of the PreviewImage.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[allow(clippy::exhaustive_enums)]
pub enum PreviewImageSource {
/// Source of the PreviewImage as encrypted file data
#[serde(rename = "beeper:image:encryption", alias = "matrix:image:encryption")]
EncryptedImage(EncryptedFile),
/// Source of the PreviewImage as a simple MxcUri
#[serde(rename = "og:image", alias = "og:image:url")]
Url(OwnedMxcUri),
}