wip
This commit is contained in:
parent
7ca8af3bdc
commit
e448dc6823
|
@ -30,23 +30,21 @@ final class FileMiddleware {
|
||||||
|
|
||||||
// for outgoing messages with shared attachments
|
// for outgoing messages with shared attachments
|
||||||
for message in messages where message.attachmentLocalPath != nil && message.attachmentRemotePath == nil && message.pending {
|
for message in messages where message.attachmentLocalPath != nil && message.attachmentRemotePath == nil && message.pending {
|
||||||
if wSelf.downloadingMessageIDs.contains(message.id) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
wSelf.downloadingMessageIDs.insert(message.id)
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
store.dispatch(.xmppAction(.xmppSharingTryUpload(message)))
|
store.dispatch(.xmppAction(.xmppSharingTryUpload(message)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// for outgoing messages with shared attachments which are already uploaded
|
// for outgoing messages with shared attachments which are already uploaded
|
||||||
// but have no thumbnail
|
// but have no thumbnail (only for images)
|
||||||
for message in messages where message.attachmentLocalName != nil && message.attachmentRemotePath != nil && message.attachmentThumbnailName == nil && !message.pending && !message.sentError {
|
for message in messages where !message.pending && !message.sentError && message.attachmentType == .image {
|
||||||
|
if message.attachmentLocalName != nil && message.attachmentRemotePath != nil && message.attachmentThumbnailName == nil {
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
// swiftlint:disable:next force_unwrapping
|
// swiftlint:disable:next force_unwrapping
|
||||||
store.dispatch(.fileAction(.createAttachmentThumbnail(messageId: message.id, localName: message.attachmentLocalName!)))
|
store.dispatch(.fileAction(.createAttachmentThumbnail(messageId: message.id, localName: message.attachmentLocalName!)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
promise(.success(.info("FileMiddleware: attachments/shares messages processed")))
|
promise(.success(.info("FileMiddleware: attachments/shares messages processed")))
|
||||||
}.eraseToAnyPublisher()
|
}.eraseToAnyPublisher()
|
||||||
|
|
Loading…
Reference in a new issue