Fixed the build errors caused by removing the old 'syncConfiguration' function

pull/856/head
Morgan Pretty 2 years ago
parent 8f3dcbc6be
commit 14174e3fbd

@ -343,12 +343,7 @@ final class NewClosedGroupVC: BaseVC, UITableViewDataSource, UITableViewDelegate
} }
}, },
receiveValue: { thread in receiveValue: { thread in
Storage.shared.writeAsync { db in ConfigurationSyncJob.enqueue()
try? MessageSender
.syncConfiguration(db, forceSyncNow: true)
.sinkUntilComplete()
}
self?.presentingViewController?.dismiss(animated: true, completion: nil) self?.presentingViewController?.dismiss(animated: true, completion: nil)
SessionApp.presentConversation(for: thread.id, action: .compose, animated: false) SessionApp.presentConversation(for: thread.id, action: .compose, animated: false)
} }

@ -1562,13 +1562,7 @@ extension ConversationVC:
.sinkUntilComplete( .sinkUntilComplete(
receiveCompletion: { result in receiveCompletion: { result in
switch result { switch result {
case .finished: case .finished: break
Storage.shared.writeAsync { db in
try MessageSender
.syncConfiguration(db, forceSyncNow: true)
.sinkUntilComplete() // FIXME: It's probably cleaner to do this inside addOpenGroup(...)
}
case .failure(let error): case .failure(let error):
let errorModal: ConfirmationModal = ConfirmationModal( let errorModal: ConfirmationModal = ConfirmationModal(
info: ConfirmationModal.Info( info: ConfirmationModal.Info(

@ -295,9 +295,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
appVersion.lastAppVersion != appVersion.currentAppVersion appVersion.lastAppVersion != appVersion.currentAppVersion
) )
{ {
try MessageSender ConfigurationSyncJob.enqueue(db)
.syncConfiguration(db, forceSyncNow: true)
.sinkUntilComplete()
} }
} }
} }

@ -1,6 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import UIKit import UIKit
import Combine
import AVFoundation import AVFoundation
import GRDB import GRDB
import SessionUIKit import SessionUIKit
@ -189,12 +190,6 @@ final class JoinOpenGroupVC: BaseVC, UIPageViewControllerDataSource, UIPageViewC
self?.showError(title: title, message: message) self?.showError(title: title, message: message)
case .finished: case .finished:
Storage.shared.writeAsync { db in
try MessageSender
.syncConfiguration(db, forceSyncNow: true)
.sinkUntilComplete() // FIXME: It's probably cleaner to do this inside addOpenGroup(...)
}
self?.presentingViewController?.dismiss(animated: true, completion: nil) self?.presentingViewController?.dismiss(animated: true, completion: nil)
if shouldOpenCommunity { if shouldOpenCommunity {

@ -275,6 +275,9 @@ public final class OpenGroupManager {
.flatMap { response -> Future<Void, Error> in .flatMap { response -> Future<Void, Error> in
Future<Void, Error> { resolver in Future<Void, Error> { resolver in
dependencies.storage.write { db in dependencies.storage.write { db in
// Enqueue a config sync job (have a newly added open group to sync)
ConfigurationSyncJob.enqueue(db)
// Store the capabilities first // Store the capabilities first
OpenGroupManager.handleCapabilities( OpenGroupManager.handleCapabilities(
db, db,

Loading…
Cancel
Save