Folder improvements

This commit is contained in:
Ali 2020-03-20 19:07:56 +04:00
parent 57406bb292
commit 957726219b
8 changed files with 3588 additions and 3556 deletions

View File

@ -5468,3 +5468,5 @@ Any member of this group will be able to see messages in the channel.";
"SetupUsername.ChangeNameWarningGroup" = "Warning, if you change the name of your group, it will loose its verified status. You will need to send a new application to @verification_bot";
"SetupUsername.ChangeLinkWarningChannel" = "Warning, if you change the short link to your channel, it will loose its verified status. You will need to send a new application to @verification_bot";
"SetupUsername.ChangeLinkWarningGroup" = "Warning, if you change the short link to your group, it will loose its verified status. You will need to send a new application to @verification_bot";
"MuteFor.Forever" = "Mute Forever";

View File

@ -616,7 +616,10 @@ final class ChatListFilterTabContainerNode: ASDisplayNode {
self.scrollNode.layer.removeAllAnimations()
}
func update(size: CGSize, sideInset: CGFloat, filters: [ChatListFilterTabEntry], selectedFilter: ChatListFilterTabEntryId?, isReordering: Bool, isEditing: Bool, transitionFraction: CGFloat, presentationData: PresentationData, transition: ContainedViewLayoutTransition) {
func update(size: CGSize, sideInset: CGFloat, filters: [ChatListFilterTabEntry], selectedFilter: ChatListFilterTabEntryId?, isReordering: Bool, isEditing: Bool, transitionFraction: CGFloat, presentationData: PresentationData, transition proposedTransition: ContainedViewLayoutTransition) {
let isFirstTime = self.currentParams == nil
let transition: ContainedViewLayoutTransition = isFirstTime ? .immediate : proposedTransition
var focusOnSelectedFilter = self.currentParams?.selectedFilter != selectedFilter
let previousScrollBounds = self.scrollNode.bounds
let previousContentWidth = self.scrollNode.view.contentSize.width

View File

@ -480,7 +480,7 @@ final class MutableChatListView {
}
var updateAdditionalItems = false
if let itemIds = transaction.replacedAdditionalChatListItems {
if case .root = self.groupId, self.filterPredicate == nil, let itemIds = transaction.replacedAdditionalChatListItems {
self.additionalItemIds = Set(itemIds)
updateAdditionalItems = true
}

View File

@ -792,7 +792,6 @@ private func editingItems(data: PeerInfoScreenData?, context: AccountContext, pr
if let data = data, let notificationSettings = data.notificationSettings {
let notificationsLabel: String
let soundLabel: String
let notificationSettings = notificationSettings as? TelegramPeerNotificationSettings ?? TelegramPeerNotificationSettings.defaultSettings
if case let .muted(until) = notificationSettings.muteState, until >= Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970) {
if until < Int32.max - 1 {
notificationsLabel = stringForRemainingMuteInterval(strings: presentationData.strings, muteInterval: until)
@ -2148,13 +2147,40 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD
case .call:
self.requestCall()
case .mute:
let muteInterval: Int32?
if let notificationSettings = self.data?.notificationSettings, case .muted = notificationSettings.muteState {
muteInterval = nil
let _ = updatePeerMuteSetting(account: self.context.account, peerId: self.peerId, muteInterval: nil).start()
} else {
muteInterval = Int32.max
let actionSheet = ActionSheetController(presentationData: self.presentationData)
let dismissAction: () -> Void = { [weak actionSheet] in
actionSheet?.dismissAnimated()
}
var items: [ActionSheetItem] = []
let muteValues: [Int32] = [
1 * 60 * 60,
24 * 60 * 60,
Int32.max
]
for delay in muteValues {
let title: String
if delay == Int32.max {
title = self.presentationData.strings.MuteFor_Forever
} else {
title = muteForIntervalString(strings: self.presentationData.strings, value: delay)
}
items.append(ActionSheetButtonItem(title: title, action: {
dismissAction()
let _ = updatePeerMuteSetting(account: self.context.account, peerId: self.peerId, muteInterval: delay).start()
}))
}
actionSheet.setItemGroups([
ActionSheetItemGroup(items: items),
ActionSheetItemGroup(items: [ActionSheetButtonItem(title: self.presentationData.strings.Common_Cancel, action: { dismissAction() })])
])
self.view.endEditing(true)
controller.present(actionSheet, in: .window(.root))
}
let _ = updatePeerMuteSetting(account: self.context.account, peerId: self.peerId, muteInterval: muteInterval).start()
case .more:
guard let data = self.data, let peer = data.peer else {
return

View File

@ -449,12 +449,12 @@ public final class WalletStrings: Equatable {
public var Wallet_SecureStorageReset_Title: String { return self._s[219]! }
public var Wallet_Receive_CommentHeader: String { return self._s[220]! }
public var Wallet_Info_ReceiveGrams: String { return self._s[221]! }
public func Wallet_Updated_MinutesAgo(_ value: Int32) -> String {
public func Wallet_Updated_HoursAgo(_ value: Int32) -> String {
let form = getPluralizationForm(self.lc, value)
let stringValue = walletStringsFormattedNumber(value, self.groupingSeparator)
return String(format: self._ps[0 * 6 + Int(form.rawValue)]!, stringValue)
}
public func Wallet_Updated_HoursAgo(_ value: Int32) -> String {
public func Wallet_Updated_MinutesAgo(_ value: Int32) -> String {
let form = getPluralizationForm(self.lc, value)
let stringValue = walletStringsFormattedNumber(value, self.groupingSeparator)
return String(format: self._ps[1 * 6 + Int(form.rawValue)]!, stringValue)