start expiration timer after attachments downloaded
This commit is contained in:
parent
65f3699093
commit
d7a7abc11e
|
@ -144,6 +144,17 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
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;
|
||||
[self saveWithTransaction:transaction];
|
||||
|
||||
|
|
Loading…
Reference in New Issue