Consumer-sweep, facade-addition, and Peer→EnginePeer migrations: - Wave 27: preferencesView consumer sweep - Wave 28: resourceData consumer sweep - Wave 29: resourceStatus consumer sweep - Wave 30: _asStatus() bridge cleanup - Wave 31: unused-import sweep re-run - Wave 32: resourceStatus residue sweep - Wave 33: loadedPeerWithId consumer sweep - Wave 34: FoundPeer.peer Peer -> EnginePeer - Wave 35: SendAsPeer.peer Peer -> EnginePeer - Wave 36: ContactListPeer.peer Peer -> EnginePeer Also includes per-wave specs, implementation plans, outcome logs, and a CLAUDE.md wave-counter update. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
32 lines
1.2 KiB
Swift
32 lines
1.2 KiB
Swift
import Foundation
|
|
import TelegramCore
|
|
import SwiftSignalKit
|
|
import TelegramNotices
|
|
|
|
final class InteractiveChatLinkPreviewsResult {
|
|
let f: (Bool) -> Void
|
|
|
|
init(_ f: @escaping (Bool) -> Void) {
|
|
self.f = f
|
|
}
|
|
}
|
|
|
|
func interactiveChatLinkPreviewsEnabled(accountManager: AccountManager<TelegramAccountManagerTypes>, displayAlert: @escaping (InteractiveChatLinkPreviewsResult) -> Void) -> Signal<Bool, NoError> {
|
|
return ApplicationSpecificNotice.getSecretChatLinkPreviews(accountManager: accountManager)
|
|
|> mapToSignal { value -> Signal<Bool, NoError> in
|
|
if let value = value {
|
|
return .single(value)
|
|
} else {
|
|
return Signal { subscriber in
|
|
Queue.mainQueue().async {
|
|
displayAlert(InteractiveChatLinkPreviewsResult({ result in
|
|
let _ = ApplicationSpecificNotice.setSecretChatLinkPreviews(accountManager: accountManager, value: result).startStandalone()
|
|
subscriber.putNext(result)
|
|
subscriber.putCompletion()
|
|
}))
|
|
}
|
|
return EmptyDisposable
|
|
}
|
|
}
|
|
}
|
|
}
|