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];
OWSGroupsOutputStream *groupsOutputStream = [OWSGroupsOutputStream streamWithOutputStream:dataOutputStream];
[TSGroupThread enumerateCollectionObjectsUsingBlock:^(id obj, BOOL *stop) {
if (![obj isKindOfClass:[TSGroupThread class]]) {
DDLogVerbose(@"Ignoring non group thread in thread collection: %@", obj);
return;
}
TSGroupModel *group = ((TSGroupThread *)obj).groupModel;
[groupsOutputStream writeGroup:group];
}];
[TSGroupThread
enumerateCollectionObjectsWithTransaction:transaction
usingBlock:^(id obj, BOOL *stop) {
if (![obj isKindOfClass:[TSGroupThread class]]) {
DDLogVerbose(@"Ignoring non group thread in thread collection: %@", obj);
return;
}
TSGroupModel *group = ((TSGroupThread *)obj).groupModel;
[groupsOutputStream writeGroup:group];
}];
[groupsOutputStream flush];
[dataOutputStream close];

View file

@ -81,9 +81,20 @@
+ (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;
/**
* 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;
/**