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.
		
		
		
		
		
			
		
			
	
	
		
			47 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Swift
		
	
		
		
			
		
	
	
			47 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Swift
		
	
| 
											4 years ago
										 | import Foundation | ||
|  | import SessionUtilitiesKit | ||
| 
											5 years ago
										 | 
 | ||
| 
											5 years ago
										 | @objc | ||
|  | public final class SNMessagingKitConfiguration : NSObject { | ||
| 
											5 years ago
										 |     public let storage: SessionMessagingKitStorageProtocol | ||
|  | 
 | ||
| 
											5 years ago
										 |     @objc public static var shared: SNMessagingKitConfiguration! | ||
| 
											5 years ago
										 | 
 | ||
| 
											5 years ago
										 |     fileprivate init(storage: SessionMessagingKitStorageProtocol) { | ||
| 
											5 years ago
										 |         self.storage = storage | ||
|  |     } | ||
| 
											5 years ago
										 | } | ||
|  | 
 | ||
| 
											5 years ago
										 | public enum SNMessagingKit { // Just to make the external API nice | ||
| 
											4 years ago
										 |     public static func migrations() -> TargetMigrations { | ||
|  |         return TargetMigrations( | ||
|  |             identifier: .messagingKit, | ||
|  |             migrations: [ | ||
|  |                 [ | ||
| 
											4 years ago
										 |                     _001_InitialSetupMigration.self, | ||
|  |                     _002_SetupStandardJobs.self | ||
| 
											4 years ago
										 |                 ], | ||
|  |                 [ | ||
| 
											4 years ago
										 |                     _003_YDBToGRDBMigration.self | ||
| 
											4 years ago
										 |                 ] | ||
|  |             ] | ||
|  |         ) | ||
|  |     } | ||
|  |      | ||
| 
											5 years ago
										 |     public static func configure(storage: SessionMessagingKitStorageProtocol) { | ||
| 
											4 years ago
										 |         // Configure the job executors | ||
|  |         JobRunner.add(executor: DisappearingMessagesJob.self, for: .disappearingMessages) | ||
|  |         JobRunner.add(executor: FailedMessagesJob.self, for: .failedMessages) | ||
|  |         JobRunner.add(executor: FailedAttachmentDownloadsJob.self, for: .failedAttachmentDownloads) | ||
| 
											4 years ago
										 |         JobRunner.add(executor: UpdateProfilePictureJob.self, for: .updateProfilePicture) | ||
|  |         JobRunner.add(executor: RetrieveDefaultOpenGroupRoomsJob.self, for: .retrieveDefaultOpenGroupRooms) | ||
| 
											4 years ago
										 |         JobRunner.add(executor: MessageSendJob.self, for: .messageSend) | ||
|  |         JobRunner.add(executor: MessageReceiveJob.self, for: .messageReceive) | ||
|  |         JobRunner.add(executor: NotifyPushServerJob.self, for: .notifyPushServer) | ||
|  |         JobRunner.add(executor: SendReadReceiptsJob.self, for: .sendReadReceipts) | ||
| 
											4 years ago
										 |         JobRunner.add(executor: AttachmentDownloadJob.self, for: .attachmentDownload) | ||
| 
											4 years ago
										 |          | ||
| 
											5 years ago
										 |         SNMessagingKitConfiguration.shared = SNMessagingKitConfiguration(storage: storage) | ||
| 
											5 years ago
										 |     } | ||
|  | } |