Support sending gallery messages behind a feature flag

Adds the ability to send a gallery message (multiple attachments in one message)
via the media upload preview, wired through the timeline controller/proxy to the
SDK's sendGallery. Gated by a `galleryEnabled` developer flag (default off),
matching Element X Android — with the flag off, attachments are sent as
individual messages as before.

Extends the community PR #5601, rebased onto develop. Tracking:
element-hq/element-meta#3201

Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
This commit is contained in:
Mauro Romito
2026-07-21 11:34:44 +02:00
parent 762e5ad0ff
commit 6a2ed331fa
15 changed files with 387 additions and 41 deletions
@@ -162,6 +162,17 @@ struct TimelineControllerMockConfiguration {
return .success(())
}
sendGalleryItemInfosCaptionFormattedCaptionInReplyToEventIDClosure = { [weak self, timelineProxy] itemInfos, caption, formattedCaption, inReplyToEventID in
self?.callbacks.send(.messageSentOrEdited)
if let timelineProxy {
return await timelineProxy.sendGallery(itemInfos: itemInfos,
caption: caption,
formattedCaption: formattedCaption,
inReplyToEventID: inReplyToEventID).mapError(TimelineControllerError.timelineProxyError)
}
return .success(())
}
sendVoiceMessageUrlAudioInfoWaveformRequestHandleClosure = { [weak self, timelineProxy] url, audioInfo, waveform, requestHandle in
self?.callbacks.send(.messageSentOrEdited)
if let timelineProxy {