mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix gallery source in channel replies
This commit is contained in:
parent
c009655abf
commit
b35ede7462
@ -249,10 +249,17 @@ public func chatMessageGalleryControllerData(context: AccountContext, chatLocati
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var openChatLocation = chatLocation ?? .peer(id: message.id.peerId)
|
||||||
|
var openChatLocationContextHolder = chatLocationContextHolder ?? Atomic<ChatLocationContextHolder?>(value: nil)
|
||||||
|
if chatLocation?.peerId != message.id.peerId {
|
||||||
|
openChatLocation = .peer(id: message.id.peerId)
|
||||||
|
openChatLocationContextHolder = Atomic<ChatLocationContextHolder?>(value: nil)
|
||||||
|
}
|
||||||
|
|
||||||
return .gallery(startState
|
return .gallery(startState
|
||||||
|> deliverOnMainQueue
|
|> deliverOnMainQueue
|
||||||
|> map { startState in
|
|> map { startState in
|
||||||
let gallery = GalleryController(context: context, source: source ?? (standalone ? .standaloneMessage(message) : .peerMessagesAtId(messageId: message.id, chatLocation: chatLocation ?? .peer(id: message.id.peerId), chatLocationContextHolder: chatLocationContextHolder ?? Atomic<ChatLocationContextHolder?>(value: nil))), invertItemOrder: reverseMessageGalleryOrder, streamSingleVideo: stream, fromPlayingVideo: autoplayingVideo, landscape: landscape, timecode: startState.timecode, playbackRate: startState.rate, synchronousLoad: synchronousLoad, replaceRootController: { [weak navigationController] controller, ready in
|
let gallery = GalleryController(context: context, source: source ?? (standalone ? .standaloneMessage(message) : .peerMessagesAtId(messageId: message.id, chatLocation: openChatLocation, chatLocationContextHolder: openChatLocationContextHolder)), invertItemOrder: reverseMessageGalleryOrder, streamSingleVideo: stream, fromPlayingVideo: autoplayingVideo, landscape: landscape, timecode: startState.timecode, playbackRate: startState.rate, synchronousLoad: synchronousLoad, replaceRootController: { [weak navigationController] controller, ready in
|
||||||
navigationController?.replaceTopController(controller, animated: false, ready: ready)
|
navigationController?.replaceTopController(controller, animated: false, ready: ready)
|
||||||
}, baseNavigationController: navigationController, actionInteraction: actionInteraction)
|
}, baseNavigationController: navigationController, actionInteraction: actionInteraction)
|
||||||
gallery.temporaryDoNotWaitForReady = autoplayingVideo
|
gallery.temporaryDoNotWaitForReady = autoplayingVideo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user