CR: use id for hashvalue, make clearer that we don't expect to use incrementing ID's for uniqueId

pull/1/head
Michael Kirk 7 years ago
parent 7cf53293da
commit 03aba93985

@ -45,7 +45,7 @@ public class MediaGalleryItem: Equatable, Hashable {
// MARK: Hashable
public var hashValue: Int {
return attachmentStream.hashValue
return attachmentStream.uniqueId?.hashValue ?? attachmentStream.hashValue
}
}

@ -172,8 +172,8 @@ NSString *NSStringFromOWSInteractionType(OWSInteractionType value)
}
- (void)saveWithTransaction:(YapDatabaseReadWriteTransaction *)transaction {
OWSAssertDebug(self.uniqueId);
if (!self.uniqueId) {
OWSFailDebug(self.uniqueId);
self.uniqueId = [OWSPrimaryStorage getAndIncrementMessageIdWithTransaction:transaction];
}

Loading…
Cancel
Save