add NSE sources to EX project to easily implement mocking and allow the code to be unit tested

This commit is contained in:
Mauro Romito
2025-11-18 14:37:32 +01:00
committed by Mauro
parent b67b4fef2f
commit 8e52ef363b
12 changed files with 457 additions and 29 deletions
@@ -0,0 +1,24 @@
//
// Copyright 2025 Element Creations Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
// Please see LICENSE files in the repository root for full details.
//
import MatrixRustSDK
struct NSEUserSessionMockConfiguration {
var inviteAvatarsVisibility = InviteAvatars.on
var mediaPreviewVisibility = MediaPreviews.on
var threadsEnabled = true
}
extension NSEUserSessionMock {
convenience init(_ configuration: NSEUserSessionMockConfiguration) {
self.init()
underlyingInviteAvatarsVisibility = configuration.inviteAvatarsVisibility
underlyingMediaPreviewVisibility = configuration.mediaPreviewVisibility
underlyingThreadsEnabled = configuration.threadsEnabled
}
}