|
|
@ -560,8 +560,22 @@ NSString *const OWSReadReceiptManagerAreReadReceiptsEnabled = @"areReadReceiptsE
|
|
|
|
// We don't need to worry about races around this cached value.
|
|
|
|
// We don't need to worry about races around this cached value.
|
|
|
|
if (!self.areReadReceiptsEnabledCached) {
|
|
|
|
if (!self.areReadReceiptsEnabledCached) {
|
|
|
|
// Default to NO.
|
|
|
|
// Default to NO.
|
|
|
|
self.areReadReceiptsEnabledCached = @([self.dbConnection boolForKey:OWSReadReceiptManagerAreReadReceiptsEnabled
|
|
|
|
self.areReadReceiptsEnabledCached =
|
|
|
|
inCollection:OWSReadReceiptManagerCollection]);
|
|
|
|
@([self.dbConnection boolForKey:OWSReadReceiptManagerAreReadReceiptsEnabled
|
|
|
|
|
|
|
|
inCollection:OWSReadReceiptManagerAreReadReceiptsEnabled]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return [self.areReadReceiptsEnabledCached boolValue];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (BOOL)areReadReceiptsEnabledWithTransaction:(YapDatabaseReadTransaction *)transaction
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!self.areReadReceiptsEnabledCached) {
|
|
|
|
|
|
|
|
[self.dbConnection readWithBlock:^(YapDatabaseReadTransaction *_Nonnull transaction) {
|
|
|
|
|
|
|
|
// Default to NO.
|
|
|
|
|
|
|
|
self.areReadReceiptsEnabledCached = [transaction objectForKey:OWSReadReceiptManagerAreReadReceiptsEnabled
|
|
|
|
|
|
|
|
inCollection:OWSReadReceiptManagerAreReadReceiptsEnabled];
|
|
|
|
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return [self.areReadReceiptsEnabledCached boolValue];
|
|
|
|
return [self.areReadReceiptsEnabledCached boolValue];
|
|
|
|