Skip to content

Commit

Permalink
expose sticker source field
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Antonio Alvarez <[email protected]>

go back to old ruma rev
  • Loading branch information
surakin committed May 31, 2024
1 parent 61440c3 commit 6760efa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,18 @@ once_cell = "1.16.0"
pin-project-lite = "0.2.9"
rand = "0.8.5"
reqwest = { version = "0.12.4", default-features = false }
ruma = { git = "https://github.com/ruma/ruma/", rev = "ee5e6b8c9e9489c88a1ba7411541201b6790d2d2", features = [
ruma = { git = "https://github.com/ruma/ruma", rev = "6cd3af9b865f338f7c4be3666e62b67951f948ce", features = [
"client-api-c",
"compat-upload-signatures",
"compat-user-id",
"compat-arbitrary-length-ids",
"compat-tag-info",
"compat-encrypted-stickers",
"unstable-msc3401",
"unstable-msc3266",
"unstable-msc4075"
] }
ruma-common = { git = "https://github.com/ruma/ruma", rev = "ee5e6b8c9e9489c88a1ba7411541201b6790d2d2" }
ruma-common = { git = "https://github.com/ruma/ruma", rev = "6cd3af9b865f338f7c4be3666e62b67951f948ce" }
serde = "1.0.151"
serde_html_form = "0.2.0"
serde_json = "1.0.91"
Expand Down
6 changes: 3 additions & 3 deletions bindings/matrix-sdk-ffi/src/timeline/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{collections::HashMap, sync::Arc};

use matrix_sdk::{crypto::types::events::UtdCause, room::power_levels::power_level_user_changes};
use matrix_sdk_ui::timeline::{PollResult, TimelineDetails};
use ruma::events::FullStateEventContent;
use ruma::events::{room::MediaSource, FullStateEventContent};
use tracing::warn;

use super::ProfileDetails;
Expand All @@ -38,7 +38,7 @@ impl TimelineItemContent {
TimelineItemContentKind::Sticker {
body: content.body.clone(),
info: (&content.info).into(),
url: content.url.to_string(),
source: Arc::new(MediaSource::from(content.source.clone())),
}
}
Content::Poll(poll_state) => TimelineItemContentKind::from(poll_state.results()),
Expand Down Expand Up @@ -112,7 +112,7 @@ pub enum TimelineItemContentKind {
Sticker {
body: String,
info: ImageInfo,
url: String,
source: Arc<MediaSource>,
},
Poll {
question: String,
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-base/src/media.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub trait MediaEventContent {

impl MediaEventContent for StickerEventContent {
fn source(&self) -> Option<MediaSource> {
Some(MediaSource::Plain(self.url.clone()))
Some(MediaSource::from(self.source.clone()))
}

fn thumbnail_source(&self) -> Option<MediaSource> {
Expand Down

0 comments on commit 6760efa

Please sign in to comment.