mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 19:09:56 +00:00
37 lines
1.0 KiB
Swift
37 lines
1.0 KiB
Swift
import Foundation
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
import SwiftSignalKitMac
|
|
#else
|
|
import Postbox
|
|
import SwiftSignalKit
|
|
#endif
|
|
|
|
final class SynchronizeLocalizationUpdatesOperation: Coding {
|
|
init() {
|
|
}
|
|
|
|
init(decoder: Decoder) {
|
|
}
|
|
|
|
func encode(_ encoder: Encoder) {
|
|
}
|
|
}
|
|
|
|
func addSynchronizeLocalizationUpdatesOperation(modifier: Modifier) {
|
|
let tag: PeerOperationLogTag = OperationLogTags.SynchronizeLocalizationUpdates
|
|
let peerId = PeerId(namespace: 0, id: 0)
|
|
|
|
var topLocalIndex: Int32?
|
|
modifier.operationLogEnumerateEntries(peerId: peerId, tag: tag, { entry in
|
|
topLocalIndex = entry.tagLocalIndex
|
|
return false
|
|
})
|
|
|
|
if let topLocalIndex = topLocalIndex {
|
|
let _ = modifier.operationLogRemoveEntry(peerId: peerId, tag: tag, tagLocalIndex: topLocalIndex)
|
|
}
|
|
|
|
modifier.operationLogAddEntry(peerId: peerId, tag: tag, tagLocalIndex: .automatic, tagMergedIndex: .automatic, contents: SynchronizeLocalizationUpdatesOperation())
|
|
}
|