mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fixed a few job migration issues Fixed an issue with the closed group key pair management (wasn't storing keys correctly) Refactored the OWSSound (now Preferences.Sound) Added the logic for the AttachmentDownloadJob and enabled jobs to be cascade deleted via interactions Optimised the HomeViewModel database observation query (fetch specific columns so changes outside those don't trigger updates) Updated to the latest GRDB (ran into a deadlock which should be fixed in a newer version)
63 lines
1.5 KiB
Objective-C
63 lines
1.5 KiB
Objective-C
|
|
#import <Foundation/Foundation.h>
|
|
#import "OWSWindowManager.h"
|
|
#import <SessionMessagingKit/SessionMessagingKit-Swift.h>
|
|
#import "OWSPreferences.h"
|
|
|
|
static Environment *sharedEnvironment = nil;
|
|
|
|
@interface Environment ()
|
|
|
|
@property (nonatomic) OWSAudioSession *audioSession;
|
|
@property (nonatomic) OWSPreferences *preferences;
|
|
@property (nonatomic) id<OWSProximityMonitoringManager> proximityMonitoringManager;
|
|
@property (nonatomic) OWSWindowManager *windowManager;
|
|
|
|
@end
|
|
|
|
#pragma mark -
|
|
|
|
@implementation Environment
|
|
|
|
+ (Environment *)shared
|
|
{
|
|
return sharedEnvironment;
|
|
}
|
|
|
|
+ (void)setShared:(Environment *)environment
|
|
{
|
|
// The main app environment should only be set once.
|
|
//
|
|
// App extensions may be opened multiple times in the same process,
|
|
// so statics will persist.
|
|
|
|
sharedEnvironment = environment;
|
|
}
|
|
|
|
+ (void)clearSharedForTests
|
|
{
|
|
sharedEnvironment = nil;
|
|
}
|
|
|
|
- (instancetype)initWithAudioSession:(OWSAudioSession *)audioSession
|
|
preferences:(OWSPreferences *)preferences
|
|
proximityMonitoringManager:(id<OWSProximityMonitoringManager>)proximityMonitoringManager
|
|
windowManager:(OWSWindowManager *)windowManager
|
|
{
|
|
self = [super init];
|
|
|
|
if (!self) {
|
|
return self;
|
|
}
|
|
|
|
_audioSession = audioSession;
|
|
_preferences = preferences;
|
|
_proximityMonitoringManager = proximityMonitoringManager;
|
|
_windowManager = windowManager;
|
|
_isRequestingPermission = false;
|
|
|
|
return self;
|
|
}
|
|
|
|
@end
|