mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			30 lines
		
	
	
		
			823 B
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			30 lines
		
	
	
		
			823 B
		
	
	
	
		
			Matlab
		
	
| 
											8 years ago
										 | // | ||
|  | //  Copyright (c) 2017 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
| 
											9 years ago
										 | 
 | ||
|  | #import "OWS100RemoveTSRecipientsMigration.h" | ||
|  | #import <YapDatabase/YapDatabaseTransaction.h> | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
|  | // Increment a similar constant for every future DBMigration | ||
|  | static NSString *const OWS100RemoveTSRecipientsMigrationId = @"100"; | ||
|  | 
 | ||
|  | @implementation OWS100RemoveTSRecipientsMigration | ||
|  | 
 | ||
|  | + (NSString *)migrationId | ||
|  | { | ||
|  |     return OWS100RemoveTSRecipientsMigrationId; | ||
|  | } | ||
|  | 
 | ||
|  | - (void)runUpWithTransaction:(YapDatabaseReadWriteTransaction *)transaction | ||
|  | { | ||
|  |     NSUInteger legacyRecipientCount = [transaction numberOfKeysInCollection:@"TSRecipient"]; | ||
|  |     DDLogWarn(@"Removing %lu objects from TSRecipient collection", (unsigned long)legacyRecipientCount); | ||
|  |     [transaction removeAllObjectsInCollection:@"TSRecipient"]; | ||
|  | } | ||
|  | 
 | ||
|  | @end | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_END |