respond to CR

// FREEBIE
This commit is contained in:
Michael Kirk 2017-11-06 11:52:28 -05:00
parent 8ef9e96b91
commit e82a3f3ddf
2 changed files with 22 additions and 9 deletions

View file

@ -49,14 +49,16 @@ NS_ASSUME_NONNULL_BEGIN
[dataOutputStream open]; [dataOutputStream open];
OWSGroupsOutputStream *groupsOutputStream = [OWSGroupsOutputStream streamWithOutputStream:dataOutputStream]; OWSGroupsOutputStream *groupsOutputStream = [OWSGroupsOutputStream streamWithOutputStream:dataOutputStream];
[TSGroupThread enumerateCollectionObjectsUsingBlock:^(id obj, BOOL *stop) { [TSGroupThread
if (![obj isKindOfClass:[TSGroupThread class]]) { enumerateCollectionObjectsWithTransaction:transaction
DDLogVerbose(@"Ignoring non group thread in thread collection: %@", obj); usingBlock:^(id obj, BOOL *stop) {
return; if (![obj isKindOfClass:[TSGroupThread class]]) {
} DDLogVerbose(@"Ignoring non group thread in thread collection: %@", obj);
TSGroupModel *group = ((TSGroupThread *)obj).groupModel; return;
[groupsOutputStream writeGroup:group]; }
}]; TSGroupModel *group = ((TSGroupThread *)obj).groupModel;
[groupsOutputStream writeGroup:group];
}];
[groupsOutputStream flush]; [groupsOutputStream flush];
[dataOutputStream close]; [dataOutputStream close];

View file

@ -81,9 +81,20 @@
+ (instancetype)fetchObjectWithUniqueID:(NSString *)uniqueID NS_SWIFT_NAME(fetch(uniqueId:)); + (instancetype)fetchObjectWithUniqueID:(NSString *)uniqueID NS_SWIFT_NAME(fetch(uniqueId:));
/** /**
* Saves the object with shared readWrite connection. * Saves the object with the shared readWrite connection.
*
* This method will block if another readWrite transaction is open.
*/ */
- (void)save; - (void)save;
/**
* Saves the object with the shared readWrite connection - does not block.
*
* Be mindful that this method may clobber other changes persisted
* while waiting to open the readWrite transaction.
*
* @param completionBlock is called on the main thread
*/
- (void)saveAsyncWithCompletionBlock:(void (^_Nullable)(void))completionBlock; - (void)saveAsyncWithCompletionBlock:(void (^_Nullable)(void))completionBlock;
/** /**