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

@ -2876,7 +2876,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
hasBots = true
}
if case let .known(value) = cachedGroupData.autoremoveTimeout {
autoremoveTimeout = value?.peerValue
autoremoveTimeout = value?.effectiveValue
}
} else if let cachedChannelData = peerView.cachedData as? CachedChannelData {
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 {
autoremoveTimeout = value?.peerValue
autoremoveTimeout = value?.effectiveValue
}
} else if let cachedUserData = peerView.cachedData as? CachedUserData {
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
}
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()
let controller = peerAutoremoveSetupScreen(context: strongSelf.context, peerId: peer.id, completion: { updatedValue in
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()