Skip to content

Commit b8ae210

Browse files
authored
feat(ffi): Add reply_params to GalleryUploadParameters (#5173)
Looks like I forgot adding this in #5163, sorry. Everything below the FFI layer was already prepared for replies. Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
1 parent a3225e5 commit b8ae210

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Additions:
3434
([#4994](https://github.com/matrix-org/matrix-rust-sdk/pull/4994))
3535
- Add `Timeline::send_gallery` to send MSC4274-style galleries.
3636
([#5163](https://github.com/matrix-org/matrix-rust-sdk/pull/5163))
37+
- Add `reply_params` to `GalleryUploadParameters` to allow sending galleries as (threaded) replies.
38+
([#5173](https://github.com/matrix-org/matrix-rust-sdk/pull/5173))
3739

3840
Breaking changes:
3941

bindings/matrix-sdk-ffi/src/timeline/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ mod galleries {
13911391
use crate::{
13921392
error::RoomError,
13931393
ruma::{AudioInfo, FileInfo, FormattedBody, ImageInfo, Mentions, VideoInfo},
1394-
timeline::{build_thumbnail_info, Timeline},
1394+
timeline::{build_thumbnail_info, ReplyParameters, Timeline},
13951395
};
13961396

13971397
#[derive(uniffi::Record)]
@@ -1402,6 +1402,8 @@ mod galleries {
14021402
formatted_caption: Option<FormattedBody>,
14031403
/// Optional intentional mentions to be sent with the gallery.
14041404
mentions: Option<Mentions>,
1405+
/// Optional parameters for sending the media as (threaded) reply.
1406+
reply_params: Option<ReplyParameters>,
14051407
}
14061408

14071409
#[derive(uniffi::Enum)]
@@ -1586,7 +1588,8 @@ mod galleries {
15861588
let mut gallery_config = GalleryConfig::new()
15871589
.caption(params.caption)
15881590
.formatted_caption(formatted_caption)
1589-
.mentions(params.mentions.map(Into::into));
1591+
.mentions(params.mentions.map(Into::into))
1592+
.reply(params.reply_params.map(|p| p.try_into()).transpose()?);
15901593

15911594
for item_info in item_infos {
15921595
gallery_config = gallery_config.add_item(item_info.try_into()?);

0 commit comments

Comments
 (0)