mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• Refactored the MessageViewModel to be a dumb data types instead of a monolithic query • Refactored the ConversationViewModel due to handle the updated MessageViewModel • Refactored OWSAudioPlayer into Swift • Refactored the OpenGroupManager and OpenGroupManagerCache to be a single actor (CommunityManager), it also holds community state in memory • Removed a bunch of GRDB-specific relationship code (just makes things messy since we have raw SQL elsewhere) • Fixed a bug where the ObservationBuilder could incorrectly run queries in cancelled contexts resulting in potential buggy outputs • Fixed a bug where outgoing voice messages might not be able to be played
43 lines
1.2 KiB
Swift
43 lines
1.2 KiB
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import SessionUtilitiesKit
|
|
|
|
public class SessionEnvironment {
|
|
public static var shared: SessionEnvironment?
|
|
|
|
public let proximityMonitoringManager: OWSProximityMonitoringManager
|
|
public let windowManager: OWSWindowManager
|
|
public var isRequestingPermission: Bool
|
|
|
|
// MARK: - Initialization
|
|
|
|
public init(
|
|
proximityMonitoringManager: OWSProximityMonitoringManager,
|
|
windowManager: OWSWindowManager
|
|
) {
|
|
self.proximityMonitoringManager = proximityMonitoringManager
|
|
self.windowManager = windowManager
|
|
self.isRequestingPermission = false
|
|
|
|
if SessionEnvironment.shared == nil {
|
|
SessionEnvironment.shared = self
|
|
}
|
|
}
|
|
|
|
// MARK: - Functions
|
|
|
|
public static func clearSharedForTests() {
|
|
shared = nil
|
|
}
|
|
}
|
|
|
|
// MARK: - Objective C Support
|
|
|
|
@objc(SMKEnvironment)
|
|
public class SMKEnvironment: NSObject {
|
|
@objc public static let shared: SMKEnvironment = SMKEnvironment()
|
|
|
|
@objc public var windowManager: OWSWindowManager? { SessionEnvironment.shared?.windowManager }
|
|
}
|