From 8fb9ef52d8166a2ea3384421b4fef06ffc1334cf Mon Sep 17 00:00:00 2001 From: fmodf Date: Mon, 30 Sep 2024 15:24:38 +0200 Subject: [PATCH] wip --- ConversationsClassic/AppData/Store/AttachmentsStore.swift | 2 +- ConversationsClassic/AppData/Store/MessagesStore.swift | 2 +- ConversationsClassic/AppData/Store/SettingsStore.swift | 5 ++--- .../View/Main/Conversation/ConversationSettingsScreen.swift | 4 +--- project.yml | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ConversationsClassic/AppData/Store/AttachmentsStore.swift b/ConversationsClassic/AppData/Store/AttachmentsStore.swift index 25aa63b..05b1b24 100644 --- a/ConversationsClassic/AppData/Store/AttachmentsStore.swift +++ b/ConversationsClassic/AppData/Store/AttachmentsStore.swift @@ -245,7 +245,7 @@ private extension AttachmentsStore { } chatCancellable = ValueObservation.tracking(Chat - .filter(Column("bareJid") == roster.bareJid && Column("contactBareJid") == roster.contactBareJid) + .filter(Column("account") == roster.bareJid && Column("participant") == roster.contactBareJid) .fetchOne ) .publisher(in: Database.shared.dbQueue, scheduling: .immediate) diff --git a/ConversationsClassic/AppData/Store/MessagesStore.swift b/ConversationsClassic/AppData/Store/MessagesStore.swift index 104493c..c5bff93 100644 --- a/ConversationsClassic/AppData/Store/MessagesStore.swift +++ b/ConversationsClassic/AppData/Store/MessagesStore.swift @@ -76,7 +76,7 @@ private extension MessagesStore { } chatCancellable = ValueObservation.tracking(Chat - .filter(Column("bareJid") == roster.bareJid && Column("contactBareJid") == roster.contactBareJid) + .filter(Column("account") == roster.bareJid && Column("participant") == roster.contactBareJid) .fetchOne ) .publisher(in: Database.shared.dbQueue, scheduling: .immediate) diff --git a/ConversationsClassic/AppData/Store/SettingsStore.swift b/ConversationsClassic/AppData/Store/SettingsStore.swift index 44b12c8..5755d68 100644 --- a/ConversationsClassic/AppData/Store/SettingsStore.swift +++ b/ConversationsClassic/AppData/Store/SettingsStore.swift @@ -33,15 +33,14 @@ extension SettingsStore { private extension SettingsStore { func subscribe() { chatCancellable = ValueObservation.tracking(Chat - .filter(Column("bareJid") == roster.bareJid && Column("contactBareJid") == roster.contactBareJid) + .filter(Column("account") == roster.bareJid && Column("participant") == roster.contactBareJid) .fetchOne ) .publisher(in: Database.shared.dbQueue, scheduling: .immediate) .receive(on: DispatchQueue.main) .sink { _ in } receiveValue: { [weak self] chat in - guard let self = self else { return } - self.chat = chat + self?.chat = chat } } } diff --git a/ConversationsClassic/View/Main/Conversation/ConversationSettingsScreen.swift b/ConversationsClassic/View/Main/Conversation/ConversationSettingsScreen.swift index 1f8176b..92afb15 100644 --- a/ConversationsClassic/View/Main/Conversation/ConversationSettingsScreen.swift +++ b/ConversationsClassic/View/Main/Conversation/ConversationSettingsScreen.swift @@ -35,9 +35,7 @@ struct ConversationSettingsScreen: View { controlType: .switcher(isOn: Binding( get: { settingsStore.chat?.encrypted ?? false }, set: { new in - Task { - try? await settingsStore.chat?.setEncrypted(new) - } + settingsStore.setSecured(new) } )) ) diff --git a/project.yml b/project.yml index d375abd..88a0438 100644 --- a/project.yml +++ b/project.yml @@ -56,7 +56,7 @@ targets: # UIUserInterfaceStyle: Light CFBundleDisplayName: Conversations CFBundleShortVersionString: "1.0.0" - CFBundleVersion: "5" + CFBundleVersion: "6" sources: - path: ConversationsClassic excludes: