start expiration timer after attachments downloaded

pull/411/head
Ryan ZHAO 4 years ago
parent 65f3699093
commit d7a7abc11e

@ -144,6 +144,17 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
BOOL isAllAttachmentDownloaded = YES;
for (NSString *attachmentId in self.attachmentIds) {
TSAttachment *attachment = [TSAttachment fetchObjectWithUniqueID:attachmentId transaction:transaction];
isAllAttachmentDownloaded = isAllAttachmentDownloaded && attachment.isDownloaded;
if (!isAllAttachmentDownloaded) break;
}
if (!isAllAttachmentDownloaded) {
return;
}
_read = YES; _read = YES;
[self saveWithTransaction:transaction]; [self saveWithTransaction:transaction];

Loading…
Cancel
Save