wip
This commit is contained in:
parent
4061484298
commit
98061025f3
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -51,8 +51,11 @@ Monal/build/*
|
|||
profile
|
||||
*.moved-aside
|
||||
DerivedData
|
||||
|
||||
#
|
||||
Monal/.nvim
|
||||
Monal/buildServer.json
|
||||
Monal/MY_MARKS.txt
|
||||
|
||||
# Pods
|
||||
Monal/Pods
|
||||
|
|
|
@ -39,7 +39,9 @@ static const DDLogLevel ddLogLevel = LOG_LEVEL_STDOUT;
|
|||
#define kBackgroundProcessingTask @"im.monal.process"
|
||||
#define kBackgroundRefreshingTask @"im.monal.refresh"
|
||||
#else
|
||||
#define kAppGroup @"group.monal"
|
||||
// fmodf: 19.11.24 - changed to actual another.im group
|
||||
// #define kAppGroup @"group.monal"
|
||||
#define kAppGroup @"group.another.im.test"
|
||||
#define kMonalOpenURL [NSURL URLWithString:@"monalOpen://"]
|
||||
#define kBackgroundProcessingTask @"im.monal.process"
|
||||
#define kBackgroundRefreshingTask @"im.monal.refresh"
|
||||
|
|
|
@ -130,6 +130,8 @@
|
|||
54F0B81C282316F5003664BD /* RegisterAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54F0B81B282316F5003664BD /* RegisterAccount.swift */; };
|
||||
6E9488F6997650B805476F25 /* Pods_another_im.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F29121F912380F72CCE51747 /* Pods_another_im.framework */; };
|
||||
7D40218FEAB3BA882811A682 /* Pods_Monal.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C40963CED187B2F1B4B88F7 /* Pods_Monal.framework */; };
|
||||
7E6AF38F2CEB9110004328B5 /* MonalXmppWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E6AF38E2CEB9110004328B5 /* MonalXmppWrapper.swift */; };
|
||||
7E6AF3902CEB982F004328B5 /* sworim.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = 2601D9CA0FBF25EF004DB939 /* sworim.sqlite */; };
|
||||
7E995F242CEAC5D2005B30EE /* AnotherIMApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E995F202CEAC5D2005B30EE /* AnotherIMApp.swift */; };
|
||||
7E995F252CEAC5D2005B30EE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E995F222CEAC5D2005B30EE /* ContentView.swift */; };
|
||||
7E995F272CEAC5D2005B30EE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7E995F212CEAC5D2005B30EE /* Assets.xcassets */; };
|
||||
|
@ -594,6 +596,8 @@
|
|||
79A6AA4819B69B5FFFA28236 /* Pods-NotificationService.appstore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NotificationService.appstore.xcconfig"; path = "Target Support Files/Pods-NotificationService/Pods-NotificationService.appstore.xcconfig"; sourceTree = "<group>"; };
|
||||
7D281334DB441077E42E3E89 /* Pods-another.im.appstore-quicksy.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-another.im.appstore-quicksy.xcconfig"; path = "Target Support Files/Pods-another.im/Pods-another.im.appstore-quicksy.xcconfig"; sourceTree = "<group>"; };
|
||||
7D6715099247A9CCC180EE30 /* Pods-MonalUITests.beta.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MonalUITests.beta.xcconfig"; path = "Target Support Files/Pods-MonalUITests/Pods-MonalUITests.beta.xcconfig"; sourceTree = "<group>"; };
|
||||
7E6AF38E2CEB9110004328B5 /* MonalXmppWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MonalXmppWrapper.swift; sourceTree = "<group>"; };
|
||||
7E6E446D2CECB76500505D5C /* another.im.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = another.im.entitlements; sourceTree = "<group>"; };
|
||||
7E995F062CEAC4B8005B30EE /* another.im.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = another.im.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7E995F202CEAC5D2005B30EE /* AnotherIMApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherIMApp.swift; sourceTree = "<group>"; };
|
||||
7E995F212CEAC5D2005B30EE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
|
@ -1375,7 +1379,9 @@
|
|||
7E995F232CEAC5D2005B30EE /* another.im */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7E6E446D2CECB76500505D5C /* another.im.entitlements */,
|
||||
7E995F202CEAC5D2005B30EE /* AnotherIMApp.swift */,
|
||||
7E6AF38E2CEB9110004328B5 /* MonalXmppWrapper.swift */,
|
||||
7E995F212CEAC5D2005B30EE /* Assets.xcassets */,
|
||||
7E995F222CEAC5D2005B30EE /* ContentView.swift */,
|
||||
);
|
||||
|
@ -1927,6 +1933,7 @@
|
|||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
7E6AF3902CEB982F004328B5 /* sworim.sqlite in Resources */,
|
||||
7E995F272CEAC5D2005B30EE /* Assets.xcassets in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -2363,6 +2370,7 @@
|
|||
files = (
|
||||
7E995F242CEAC5D2005B30EE /* AnotherIMApp.swift in Sources */,
|
||||
7E995F252CEAC5D2005B30EE /* ContentView.swift in Sources */,
|
||||
7E6AF38F2CEB9110004328B5 /* MonalXmppWrapper.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -3308,11 +3316,13 @@
|
|||
CLANG_WARN_FRAMEWORK_INCLUDE_PRIVATE_FROM_PUBLIC = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
|
@ -3342,7 +3352,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
@ -3391,12 +3401,14 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -3430,7 +3442,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
@ -3481,12 +3493,14 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -3520,7 +3534,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
@ -3571,12 +3585,14 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -3610,7 +3626,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
@ -3661,12 +3677,14 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -3700,7 +3718,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
@ -3751,12 +3769,14 @@
|
|||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = another.im/another.im.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Egor Mitrofanov (PM89F56B43)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
DEVELOPMENT_ASSET_PATHS = "";
|
||||
DEVELOPMENT_TEAM = K78H7BT98L;
|
||||
DEVELOPMENT_TEAM = U6CKGHL5VR;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -3790,7 +3810,7 @@
|
|||
MARKETING_VERSION = 1.0.0;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = im.narayana.anotherim.ios;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.mitrofanovegor.anotherim;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = iphoneos;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
//
|
||||
// another_imApp.swift
|
||||
// another.im
|
||||
//
|
||||
// Created by Wo It on 18.11.24.
|
||||
// Copyright © 2024 monal-im.org. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct AnotherIMApp: App {
|
||||
@StateObject var wrapper = MonalXmppWrapper()
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ContentView()
|
||||
.environmentObject(wrapper)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
//
|
||||
// ContentView.swift
|
||||
// another.im
|
||||
//
|
||||
// Created by Wo It on 18.11.24.
|
||||
// Copyright © 2024 monal-im.org. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ContentView: View {
|
||||
@EnvironmentObject var wrapper: MonalXmppWrapper
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Image(systemName: "globe")
|
||||
|
@ -17,9 +11,8 @@ struct ContentView: View {
|
|||
Text("Hello, world!")
|
||||
}
|
||||
.padding()
|
||||
.onAppear {
|
||||
print("test")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
ContentView()
|
||||
}
|
||||
|
|
39
Monal/another.im/MonalXmppWrapper.swift
Normal file
39
Monal/another.im/MonalXmppWrapper.swift
Normal file
|
@ -0,0 +1,39 @@
|
|||
import Foundation
|
||||
import monalxmpp
|
||||
|
||||
enum AccountsAvailability {
|
||||
case noAccounts
|
||||
case allDisabled
|
||||
case someEnabled
|
||||
}
|
||||
|
||||
final class MonalXmppWrapper: ObservableObject {
|
||||
@Published var accountsAvailability: AccountsAvailability = .noAccounts
|
||||
|
||||
let xmpp: MLXMPPManager
|
||||
let db: DataLayer
|
||||
|
||||
init() {
|
||||
xmpp = MLXMPPManager.sharedInstance()
|
||||
db = DataLayer.sharedInstance()
|
||||
|
||||
checkAccountsOnLoad()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Accounts
|
||||
private extension MonalXmppWrapper {
|
||||
// Check accounts state on launch
|
||||
func checkAccountsOnLoad() {
|
||||
let enabledAcocunts = db.enabledAccountList()
|
||||
let allAccounts = db.accountList()
|
||||
|
||||
if allAccounts.isEmpty {
|
||||
accountsAvailability = .noAccounts
|
||||
} else if !enabledAcocunts.isEmpty {
|
||||
accountsAvailability = .someEnabled
|
||||
} else {
|
||||
accountsAvailability = .allDisabled
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
<dict>
|
||||
<key>com.apple.security.application-groups</key>
|
||||
<array>
|
||||
<string>group.another.im.test</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
Loading…
Reference in a new issue