This commit is contained in:
Ali 2021-02-08 19:43:24 +04:00
parent f7bf6f1143
commit 77bd3d6acf
10 changed files with 3029 additions and 3005 deletions

View File

@ -5999,3 +5999,5 @@ Sorry for the inconvenience.";
"PeerInfo.AutoremoveMessages" = "Auto-Delete Messages"; "PeerInfo.AutoremoveMessages" = "Auto-Delete Messages";
"PeerInfo.AutoremoveMessagesDisabled" = "Never"; "PeerInfo.AutoremoveMessagesDisabled" = "Never";
"Conversation.AutoremoveChanged" = "Auto-Delete timer set to %@";

View File

@ -30,7 +30,7 @@ private enum PeerAutoremoveSetupSection: Int32 {
private enum PeerAutoremoveSetupEntry: ItemListNodeEntry { private enum PeerAutoremoveSetupEntry: ItemListNodeEntry {
case header case header
case timeHeader(String) case timeHeader(String)
case timeValue(Int32) case timeValue(Int32, Int32)
case timeComment(String) case timeComment(String)
case globalSwitch(String, Bool) case globalSwitch(String, Bool)
@ -74,8 +74,8 @@ private enum PeerAutoremoveSetupEntry: ItemListNodeEntry {
} else { } else {
return false return false
} }
case let .timeValue(lhsValue): case let .timeValue(lhsValue, lhsMaxValue):
if case let .timeValue(rhsValue) = rhs, lhsValue == rhsValue { if case let .timeValue(rhsValue, rhsMaxValue) = rhs, lhsValue == rhsValue, lhsMaxValue == rhsMaxValue {
return true return true
} else { } else {
return false return false
@ -106,8 +106,8 @@ private enum PeerAutoremoveSetupEntry: ItemListNodeEntry {
return ChatListFilterSettingsHeaderItem(theme: presentationData.theme, text: "", animation: .autoRemove, sectionId: self.section) return ChatListFilterSettingsHeaderItem(theme: presentationData.theme, text: "", animation: .autoRemove, sectionId: self.section)
case let .timeHeader(text): case let .timeHeader(text):
return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section) return ItemListSectionHeaderItem(presentationData: presentationData, text: text, sectionId: self.section)
case let .timeValue(value): case let .timeValue(value, maxValue):
return PeerRemoveTimeoutItem(theme: presentationData.theme, value: value, maxValue: Int32.max, enabled: true, sectionId: self.section, updated: { value in return PeerRemoveTimeoutItem(theme: presentationData.theme, value: value, maxValue: maxValue, enabled: true, sectionId: self.section, updated: { value in
arguments.updateValue(value) arguments.updateValue(value)
}, tag: nil) }, tag: nil)
case let .timeComment(text): case let .timeComment(text):
@ -126,15 +126,25 @@ private struct PeerAutoremoveSetupState: Equatable {
var applyingSetting: Bool = false var applyingSetting: Bool = false
} }
private func peerAutoremoveSetupEntries(peer: Peer?, presentationData: PresentationData, defaultValue: Int32?, defaultGlobalValue: Bool, state: PeerAutoremoveSetupState) -> [PeerAutoremoveSetupEntry] { private func peerAutoremoveSetupEntries(peer: Peer?, presentationData: PresentationData, defaultMyValue: Int32, peerValue: Int32, defaultGlobalValue: Bool, state: PeerAutoremoveSetupState) -> [PeerAutoremoveSetupEntry] {
var entries: [PeerAutoremoveSetupEntry] = [] var entries: [PeerAutoremoveSetupEntry] = []
let value = state.changedValue ?? defaultValue
let globalValue = state.changedGlobalValue ?? defaultGlobalValue let globalValue = state.changedGlobalValue ?? defaultGlobalValue
let resolvedValue: Int32
let resolvedMaxValue: Int32
if peer is TelegramUser {
resolvedValue = state.changedValue ?? defaultMyValue
resolvedMaxValue = peerValue
} else {
resolvedValue = state.changedValue ?? peerValue
resolvedMaxValue = Int32.max
}
//TODO:localize //TODO:localize
entries.append(.header) entries.append(.header)
entries.append(.timeHeader("AUTO-DELETE MESSAGES")) entries.append(.timeHeader("AUTO-DELETE MESSAGES"))
entries.append(.timeValue(value ?? Int32.max)) entries.append(.timeValue(resolvedValue, resolvedMaxValue))
if let channel = peer as? TelegramChannel, case .broadcast = channel.info { if let channel = peer as? TelegramChannel, case .broadcast = channel.info {
entries.append(.timeComment("Automatically delete messages sent in this channel after a certain period of time.")) entries.append(.timeComment("Automatically delete messages sent in this channel after a certain period of time."))
} else { } else {
@ -184,25 +194,25 @@ public func peerAutoremoveSetupScreen(context: AccountContext, peerId: PeerId, c
let signal = combineLatest(context.sharedContext.presentationData, statePromise.get(), context.account.viewTracker.peerView(peerId)) let signal = combineLatest(context.sharedContext.presentationData, statePromise.get(), context.account.viewTracker.peerView(peerId))
|> deliverOnMainQueue |> deliverOnMainQueue
|> map { presentationData, state, view -> (ItemListControllerState, (ItemListNodeState, Any)) in |> map { presentationData, state, view -> (ItemListControllerState, (ItemListNodeState, Any)) in
var defaultValue: Int32 = Int32.max var defaultMyValue: Int32 = Int32.max
var maxValue: Int32 = Int32.max var peerValue: Int32 = Int32.max
var defaultGlobalValue = true var defaultGlobalValue = true
if let cachedData = view.cachedData as? CachedChannelData { if let cachedData = view.cachedData as? CachedChannelData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
defaultValue = value?.myValue ?? Int32.max defaultMyValue = value?.myValue ?? Int32.max
maxValue = value?.peerValue ?? Int32.max peerValue = value?.peerValue ?? Int32.max
defaultGlobalValue = value?.isGlobal ?? true defaultGlobalValue = value?.isGlobal ?? true
} }
} else if let cachedData = view.cachedData as? CachedGroupData { } else if let cachedData = view.cachedData as? CachedGroupData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
defaultValue = value?.myValue ?? Int32.max defaultMyValue = value?.myValue ?? Int32.max
maxValue = value?.peerValue ?? Int32.max peerValue = value?.peerValue ?? Int32.max
defaultGlobalValue = value?.isGlobal ?? true defaultGlobalValue = value?.isGlobal ?? true
} }
} else if let cachedData = view.cachedData as? CachedUserData { } else if let cachedData = view.cachedData as? CachedUserData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
defaultValue = value?.myValue ?? Int32.max defaultMyValue = value?.myValue ?? Int32.max
maxValue = value?.peerValue ?? Int32.max peerValue = value?.peerValue ?? Int32.max
defaultGlobalValue = value?.isGlobal ?? true defaultGlobalValue = value?.isGlobal ?? true
} }
} }
@ -217,35 +227,47 @@ public func peerAutoremoveSetupScreen(context: AccountContext, peerId: PeerId, c
rightNavigationButton = ItemListNavigationButton(content: .none, style: .activity, enabled: true, action: {}) rightNavigationButton = ItemListNavigationButton(content: .none, style: .activity, enabled: true, action: {})
} else { } else {
rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Done), style: .bold, enabled: true, action: { rightNavigationButton = ItemListNavigationButton(content: .text(presentationData.strings.Common_Done), style: .bold, enabled: true, action: {
var value: Int32? var changedValue: Int32?
var globalValue: Bool? var globalValue: Bool?
updateState { state in updateState { state in
var state = state var state = state
state.applyingSetting = true state.applyingSetting = true
value = state.changedValue changedValue = state.changedValue
globalValue = state.changedGlobalValue globalValue = state.changedGlobalValue
return state return state
} }
let resolvedDefaultValue: Int32
if peer is TelegramUser {
resolvedDefaultValue = defaultMyValue
} else {
resolvedDefaultValue = peerValue
}
var updated = false var updated = false
if let value = value, value != defaultValue { if let changedValue = changedValue, changedValue != resolvedDefaultValue {
updated = true updated = true
} }
if let globalValue = globalValue, globalValue != defaultGlobalValue { if let globalValue = globalValue, globalValue != defaultGlobalValue {
updated = true updated = true
} }
if updated { if updated {
let resolvedValue = value ?? defaultValue var resolvedValue: Int32? = changedValue ?? resolvedDefaultValue
if resolvedValue == Int32.max {
resolvedValue = nil
}
let resolvedGlobalValue = globalValue ?? defaultGlobalValue let resolvedGlobalValue = globalValue ?? defaultGlobalValue
let signal = setChatMessageAutoremoveTimeoutInteractively(account: context.account, peerId: peerId, timeout: resolvedValue == Int32.max ? nil : resolvedValue, isGlobal: resolvedGlobalValue) let signal = setChatMessageAutoremoveTimeoutInteractively(account: context.account, peerId: peerId, timeout: resolvedValue, isGlobal: resolvedGlobalValue)
|> deliverOnMainQueue |> deliverOnMainQueue
applyDisposable.set((signal applyDisposable.set((signal
|> deliverOnMainQueue).start(error: { _ in |> deliverOnMainQueue).start(error: { _ in
}, completed: { }, completed: {
dismissImpl?() dismissImpl?()
if resolvedValue != defaultValue { if resolvedValue != resolvedDefaultValue {
completion(.updated(resolvedValue)) completion(.updated(changedValue))
} else { } else {
completion(.unchanged) completion(.unchanged)
} }
@ -254,51 +276,12 @@ public func peerAutoremoveSetupScreen(context: AccountContext, peerId: PeerId, c
dismissImpl?() dismissImpl?()
completion(.unchanged) completion(.unchanged)
} }
/*if let value = value, value != defaultValue {
if peerId.namespace == Namespaces.Peer.CloudGroup {
let signal = convertGroupToSupergroup(account: context.account, peerId: peerId)
|> mapToSignal { upgradedPeerId -> Signal<PeerId?, ConvertGroupToSupergroupError> in
return updateChannelHistoryAvailabilitySettingsInteractively(postbox: context.account.postbox, network: context.account.network, accountStateManager: context.account.stateManager, peerId: upgradedPeerId, historyAvailableForNewMembers: value)
|> `catch` { _ -> Signal<Void, NoError> in
return .complete()
}
|> mapToSignal { _ -> Signal<PeerId?, NoError> in
return .complete()
}
|> then(.single(upgradedPeerId))
|> castError(ConvertGroupToSupergroupError.self)
}
|> deliverOnMainQueue
applyDisposable.set((signal
|> deliverOnMainQueue).start(next: { upgradedPeerId in
if let upgradedPeerId = upgradedPeerId {
upgradedToSupergroup(upgradedPeerId, {
dismissImpl?()
})
}
}, error: { error in
switch error {
case .tooManyChannels:
pushControllerImpl?(oldChannelsController(context: context, intent: .upgrade))
default:
break
}
}))
} else {
applyDisposable.set((updateChannelHistoryAvailabilitySettingsInteractively(postbox: context.account.postbox, network: context.account.network, accountStateManager: context.account.stateManager, peerId: peerId, historyAvailableForNewMembers: value)
|> deliverOnMainQueue).start(completed: {
dismissImpl?()
}))
}
} else {
dismissImpl?()
}*/
}) })
} }
//TODO:localize //TODO:localize
let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text("Auto-Deletion"), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back)) let controllerState = ItemListControllerState(presentationData: ItemListPresentationData(presentationData), title: .text("Auto-Deletion"), leftNavigationButton: leftNavigationButton, rightNavigationButton: rightNavigationButton, backNavigationButton: ItemListBackButton(title: presentationData.strings.Common_Back))
let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: peerAutoremoveSetupEntries(peer: peer, presentationData: presentationData, defaultValue: defaultValue, defaultGlobalValue: defaultGlobalValue, state: state), style: .blocks) let listState = ItemListNodeState(presentationData: ItemListPresentationData(presentationData), entries: peerAutoremoveSetupEntries(peer: peer, presentationData: presentationData, defaultMyValue: defaultMyValue, peerValue: peerValue, defaultGlobalValue: defaultGlobalValue, state: state), style: .blocks)
return (controllerState, (listState, arguments)) return (controllerState, (listState, arguments))
} }

View File

@ -12,6 +12,28 @@ import ItemListUI
import PresentationDataUtils import PresentationDataUtils
import AppBundle import AppBundle
private func mapTimeoutToSliderValue(_ value: Int32) -> CGFloat {
switch value {
case 24 * 60 * 60:
return 0.0
case 7 * 24 * 60 * 60:
return 1.0
default:
return 2.0
}
}
private func mapSliderValueToTimeout(_ value: CGFloat) -> Int32 {
switch value {
case 0.0:
return 24 * 60 * 60
case 1.0:
return 7 * 24 * 60 * 60
default:
return Int32.max
}
}
class PeerRemoveTimeoutItem: ListViewItem, ItemListItem { class PeerRemoveTimeoutItem: ListViewItem, ItemListItem {
let theme: PresentationTheme let theme: PresentationTheme
let value: Int32 let value: Int32
@ -129,21 +151,17 @@ class PeerRemoveTimeoutItemNode: ListViewItemNode, ItemListItemNode {
sliderView.startValue = 0.0 sliderView.startValue = 0.0
sliderView.positionsCount = 3 sliderView.positionsCount = 3
sliderView.useLinesForPositions = true sliderView.useLinesForPositions = true
sliderView.minimumUndottedValue = 2 sliderView.minimumUndottedValue = 0
sliderView.disablesInteractiveTransitionGestureRecognizer = true sliderView.disablesInteractiveTransitionGestureRecognizer = true
if let item = self.item, let params = self.layoutParams { if let item = self.item, let params = self.layoutParams {
sliderView.isUserInteractionEnabled = item.enabled sliderView.isUserInteractionEnabled = item.enabled
let value: CGFloat sliderView.minimumUndottedValue = 0
switch item.value {
case 24 * 60 * 60: sliderView.value = mapTimeoutToSliderValue(item.value)
value = 0.0
case 7 * 24 * 60 * 60: sliderView.minimumUndottedValue = 2 - Int32(mapTimeoutToSliderValue(item.maxValue))
value = 1.0
default:
value = 2.0
}
sliderView.value = value
sliderView.backgroundColor = item.theme.list.itemBlocksBackgroundColor sliderView.backgroundColor = item.theme.list.itemBlocksBackgroundColor
sliderView.backColor = item.theme.list.disclosureArrowColor sliderView.backColor = item.theme.list.disclosureArrowColor
sliderView.trackColor = item.enabled ? item.theme.list.itemAccentColor : item.theme.list.itemDisabledTextColor sliderView.trackColor = item.enabled ? item.theme.list.itemAccentColor : item.theme.list.itemDisabledTextColor

View File

@ -3,27 +3,47 @@ import Postbox
public enum CachedPeerAutoremoveTimeout: Equatable, PostboxCoding { public enum CachedPeerAutoremoveTimeout: Equatable, PostboxCoding {
public struct Value: Equatable, PostboxCoding { public struct Value: Equatable, PostboxCoding {
public var myValue: Int32 public var myValue: Int32?
public var peerValue: Int32 public var peerValue: Int32?
public var isGlobal: Bool public var isGlobal: Bool
public init(myValue: Int32, peerValue: Int32, isGlobal: Bool) { public init(myValue: Int32?, peerValue: Int32?, isGlobal: Bool) {
self.myValue = myValue self.myValue = myValue
self.peerValue = peerValue self.peerValue = peerValue
self.isGlobal = isGlobal self.isGlobal = isGlobal
} }
public init(decoder: PostboxDecoder) { public init(decoder: PostboxDecoder) {
self.myValue = decoder.decodeInt32ForKey("myValue", orElse: 7 * 60 * 60) self.myValue = decoder.decodeOptionalInt32ForKey("myValue")
self.peerValue = decoder.decodeInt32ForKey("peerValue", orElse: 7 * 60 * 60) self.peerValue = decoder.decodeOptionalInt32ForKey("peerValue")
self.isGlobal = decoder.decodeInt32ForKey("isGlobal", orElse: 1) != 0 self.isGlobal = decoder.decodeInt32ForKey("isGlobal", orElse: 1) != 0
} }
public func encode(_ encoder: PostboxEncoder) { public func encode(_ encoder: PostboxEncoder) {
encoder.encodeInt32(self.myValue, forKey: "myValue") if let myValue = self.myValue {
encoder.encodeInt32(self.peerValue, forKey: "peerValue") encoder.encodeInt32(myValue, forKey: "myValue")
} else {
encoder.encodeNil(forKey: "myValue")
}
if let peerValue = self.peerValue {
encoder.encodeInt32(peerValue, forKey: "peerValue")
} else {
encoder.encodeNil(forKey: "peerValue")
}
encoder.encodeInt32(self.isGlobal ? 1 : 0, forKey: "isGlobal") encoder.encodeInt32(self.isGlobal ? 1 : 0, forKey: "isGlobal")
} }
public var effectiveValue: Int32? {
if let myValue = self.myValue, let peerValue = self.peerValue {
return min(myValue, peerValue)
} else if let myValue = self.myValue {
return myValue
} else if let peerValue = self.peerValue {
return peerValue
} else {
return nil
}
}
} }
case unknown case unknown

View File

@ -336,15 +336,15 @@ func enqueueMessages(transaction: Transaction, account: Account, peerId: PeerId,
var messageAutoremoveTimeout: Int32? var messageAutoremoveTimeout: Int32?
if let cachedData = cachedData as? CachedUserData { if let cachedData = cachedData as? CachedUserData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
messageAutoremoveTimeout = value?.peerValue messageAutoremoveTimeout = value?.effectiveValue
} }
} else if let cachedData = cachedData as? CachedGroupData { } else if let cachedData = cachedData as? CachedGroupData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
messageAutoremoveTimeout = value?.peerValue messageAutoremoveTimeout = value?.effectiveValue
} }
} else if let cachedData = cachedData as? CachedChannelData { } else if let cachedData = cachedData as? CachedChannelData {
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
messageAutoremoveTimeout = value?.peerValue messageAutoremoveTimeout = value?.effectiveValue
} }
} }

View File

@ -565,19 +565,8 @@ extension CachedPeerAutoremoveTimeout.Value {
if let apiValue = apiValue { if let apiValue = apiValue {
switch apiValue { switch apiValue {
case let .peerHistoryTTLPM(flags, ttlPeriodMy, ttlPeriodPeer): case let .peerHistoryTTLPM(flags, ttlPeriodMy, ttlPeriodPeer):
var anyTtl: Int32? let pmOneSide = flags & (1 << 0) != 0
if let ttlPeriodMy = ttlPeriodMy { self.init(myValue: ttlPeriodMy, peerValue: ttlPeriodPeer, isGlobal: !pmOneSide)
anyTtl = ttlPeriodMy
}
if let ttlPeriodPeer = ttlPeriodPeer {
anyTtl = ttlPeriodPeer
}
if let anyTtl = anyTtl {
let pmOneSide = flags & (1 << 0) != 0
self.init(myValue: ttlPeriodMy ?? anyTtl, peerValue: ttlPeriodPeer ?? anyTtl, isGlobal: !pmOneSide)
} else {
return nil
}
case let .peerHistoryTTL(ttlPeriodPeer): case let .peerHistoryTTL(ttlPeriodPeer):
self.init(myValue: ttlPeriodPeer, peerValue: ttlPeriodPeer, isGlobal: true) self.init(myValue: ttlPeriodPeer, peerValue: ttlPeriodPeer, isGlobal: true)
} }

View File

@ -2876,7 +2876,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
hasBots = true hasBots = true
} }
if case let .known(value) = cachedGroupData.autoremoveTimeout { if case let .known(value) = cachedGroupData.autoremoveTimeout {
autoremoveTimeout = value?.peerValue autoremoveTimeout = value?.effectiveValue
} }
} else if let cachedChannelData = peerView.cachedData as? CachedChannelData { } else if let cachedChannelData = peerView.cachedData as? CachedChannelData {
if let channel = peer as? TelegramChannel, case .group = channel.info { if let channel = peer as? TelegramChannel, case .group = channel.info {
@ -2885,11 +2885,11 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
} }
} }
if case let .known(value) = cachedChannelData.autoremoveTimeout { if case let .known(value) = cachedChannelData.autoremoveTimeout {
autoremoveTimeout = value?.peerValue autoremoveTimeout = value?.effectiveValue
} }
} else if let cachedUserData = peerView.cachedData as? CachedUserData { } else if let cachedUserData = peerView.cachedData as? CachedUserData {
if case let .known(value) = cachedUserData.autoremoveTimeout { if case let .known(value) = cachedUserData.autoremoveTimeout {
autoremoveTimeout = value?.peerValue autoremoveTimeout = value?.effectiveValue
} }
} }
} }
@ -7658,12 +7658,21 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
return return
} }
strongSelf.updateChatPresentationInterfaceState(animated: false, interactive: false, { $0.updatedInterfaceState({ $0.withoutSelectionState() }) }) Queue.mainQueue().after(0.8, {
self?.updateChatPresentationInterfaceState(animated: false, interactive: false, { $0.updatedInterfaceState({ $0.withoutSelectionState() }) })
})
actionSheet.dismissAnimated() actionSheet.dismissAnimated()
let controller = peerAutoremoveSetupScreen(context: strongSelf.context, peerId: peer.id, completion: { updatedValue in let controller = peerAutoremoveSetupScreen(context: strongSelf.context, peerId: peer.id, completion: { updatedValue in
if case let .updated(value) = updatedValue { if case let .updated(value) = updatedValue {
guard let strongSelf = self else {
return
}
if let value = value {
strongSelf.present(UndoOverlayController(presentationData: strongSelf.presentationData, content: .succeed(text: strongSelf.presentationData.strings.Conversation_AutoremoveChanged("\(timeIntervalString(strings: strongSelf.presentationData.strings, value: value))").0), elevatedLayout: false, action: { _ in return false }), in: .current)
}
} }
}) })
strongSelf.chatDisplayNode.dismissInput() strongSelf.chatDisplayNode.dismissInput()

View File

@ -1232,10 +1232,10 @@ private func editingItems(data: PeerInfoScreenData?, context: AccountContext, pr
interaction.editingOpenDiscussionGroupSetup() interaction.editingOpenDiscussionGroupSetup()
})) }))
if channel.hasPermission(.changeInfo) { /*if channel.hasPermission(.changeInfo) {
let timeoutString: String let timeoutString: String
if case let .known(value) = (data.cachedData as? CachedChannelData)?.autoremoveTimeout { if case let .known(value) = (data.cachedData as? CachedChannelData)?.autoremoveTimeout {
if let value = value?.peerValue { if let value = value?.effectiveValue {
timeoutString = timeIntervalString(strings: presentationData.strings, value: value) timeoutString = timeIntervalString(strings: presentationData.strings, value: value)
} else { } else {
timeoutString = presentationData.strings.PeerInfo_AutoremoveMessagesDisabled timeoutString = presentationData.strings.PeerInfo_AutoremoveMessagesDisabled
@ -1247,7 +1247,7 @@ private func editingItems(data: PeerInfoScreenData?, context: AccountContext, pr
items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemAutoremove, label: .text(timeoutString), text: presentationData.strings.PeerInfo_AutoremoveMessages, action: { items[.peerSettings]!.append(PeerInfoScreenDisclosureItem(id: ItemAutoremove, label: .text(timeoutString), text: presentationData.strings.PeerInfo_AutoremoveMessages, action: {
interaction.editingOpenAutoremoveMesages() interaction.editingOpenAutoremoveMesages()
})) }))
} }*/
let messagesShouldHaveSignatures: Bool let messagesShouldHaveSignatures: Bool
switch channel.info { switch channel.info {
@ -1353,7 +1353,7 @@ private func editingItems(data: PeerInfoScreenData?, context: AccountContext, pr
/*if channel.hasPermission(.changeInfo) { /*if channel.hasPermission(.changeInfo) {
let timeoutString: String let timeoutString: String
if case let .known(value) = cachedData.autoremoveTimeout { if case let .known(value) = cachedData.autoremoveTimeout {
if let value = value?.peerValue { if let value = value?.effectiveValue {
timeoutString = timeIntervalString(strings: presentationData.strings, value: value) timeoutString = timeIntervalString(strings: presentationData.strings, value: value)
} else { } else {
timeoutString = presentationData.strings.PeerInfo_AutoremoveMessagesDisabled timeoutString = presentationData.strings.PeerInfo_AutoremoveMessagesDisabled