no message

This commit is contained in:
Peter 2018-09-20 22:32:04 +01:00
parent 92b501ae13
commit f45ddf449d
2 changed files with 4 additions and 4 deletions

View File

@ -328,7 +328,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
if statusUpdated { if statusUpdated {
if let image = media as? TelegramMediaImage { if let image = media as? TelegramMediaImage {
if message.flags.isSending { if message.flags.isSending {
updatedStatusSignal = combineLatest(chatMessagePhotoStatus(account: account, photoReference: .message(message: MessageReference(message), media: image)), account.pendingMessageManager.pendingMessageStatus(message.id)) updatedStatusSignal = combineLatest(chatMessagePhotoStatus(account: account, messageId: message.id, photoReference: .message(message: MessageReference(message), media: image)), account.pendingMessageManager.pendingMessageStatus(message.id))
|> map { resourceStatus, pendingStatus -> MediaResourceStatus in |> map { resourceStatus, pendingStatus -> MediaResourceStatus in
if let pendingStatus = pendingStatus { if let pendingStatus = pendingStatus {
var progress = pendingStatus.progress var progress = pendingStatus.progress
@ -341,7 +341,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
} }
} }
} else { } else {
updatedStatusSignal = chatMessagePhotoStatus(account: account, photoReference: .message(message: MessageReference(message), media: image)) updatedStatusSignal = chatMessagePhotoStatus(account: account, messageId: message.id, photoReference: .message(message: MessageReference(message), media: image))
} }
} else if let file = media as? TelegramMediaFile { } else if let file = media as? TelegramMediaFile {
updatedStatusSignal = combineLatest(messageMediaFileStatus(account: account, messageId: message.id, file: file), account.pendingMessageManager.pendingMessageStatus(message.id)) updatedStatusSignal = combineLatest(messageMediaFileStatus(account: account, messageId: message.id, file: file), account.pendingMessageManager.pendingMessageStatus(message.id))

View File

@ -1424,9 +1424,9 @@ func internalMediaGridMessageVideo(postbox: Postbox, videoReference: FileMediaRe
} }
} }
func chatMessagePhotoStatus(account: Account, photoReference: ImageMediaReference) -> Signal<MediaResourceStatus, NoError> { func chatMessagePhotoStatus(account: Account, messageId: MessageId, photoReference: ImageMediaReference) -> Signal<MediaResourceStatus, NoError> {
if let largestRepresentation = largestRepresentationForPhoto(photoReference.media) { if let largestRepresentation = largestRepresentationForPhoto(photoReference.media) {
return account.postbox.mediaBox.resourceStatus(largestRepresentation.resource) return account.telegramApplicationContext.fetchManager.fetchStatus(category: .image, location: .chat(messageId.peerId), locationKey: .messageId(messageId), resource: largestRepresentation.resource)
} else { } else {
return .never() return .never()
} }