Skip to content

Commit d38f409

Browse files
authored
feat(ffi): Expose method for sending galleries (#5163)
Addendum to #5125 to allow sending galleries from the FFI crate. This is the final PR for galleries (apart from possible enhancements to report the upload status in #5008). This is somewhat lengthy again, apologies. Most of the changes are just wrappers and type mapping, however. So I was hoping that it's relatively straightforward to review in bulk. Happy to try and elaborate on the changes or break them up into smaller commits if that helps, however. --------- Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
1 parent 58b8a25 commit d38f409

File tree

8 files changed

+668
-101
lines changed

8 files changed

+668
-101
lines changed

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Additions:
3232
- Add `Client::observe_account_data_event` and `Client::observe_room_account_data_event` to
3333
subscribe to global and room account data changes.
3434
([#4994](https://github.com/matrix-org/matrix-rust-sdk/pull/4994))
35+
- Add `Timeline::send_gallery` to send MSC4274-style galleries.
36+
([#5163](https://github.com/matrix-org/matrix-rust-sdk/pull/5163))
3537

3638
Breaking changes:
3739

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ release = true
1717
crate-type = ["cdylib", "staticlib"]
1818

1919
[features]
20-
default = ["bundled-sqlite", "matrix-sdk-ui/unstable-msc4274"]
20+
default = ["bundled-sqlite", "unstable-msc4274"]
2121
bundled-sqlite = ["matrix-sdk/bundled-sqlite"]
22+
unstable-msc4274 = ["matrix-sdk-ui/unstable-msc4274"]
2223

2324
[dependencies]
2425
anyhow.workspace = true

bindings/matrix-sdk-ffi/src/event.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ pub enum RoomMessageEventMessageType {
387387
Audio,
388388
Emote,
389389
File,
390+
#[cfg(feature = "unstable-msc4274")]
391+
Gallery,
390392
Image,
391393
Location,
392394
Notice,
@@ -403,6 +405,8 @@ impl From<RumaMessageType> for RoomMessageEventMessageType {
403405
RumaMessageType::Audio { .. } => Self::Audio,
404406
RumaMessageType::Emote { .. } => Self::Emote,
405407
RumaMessageType::File { .. } => Self::File,
408+
#[cfg(feature = "unstable-msc4274")]
409+
RumaMessageType::Gallery { .. } => Self::Gallery,
406410
RumaMessageType::Image { .. } => Self::Image,
407411
RumaMessageType::Location { .. } => Self::Location,
408412
RumaMessageType::Notice { .. } => Self::Notice,

0 commit comments

Comments
 (0)