Various fixes

This commit is contained in:
Ilya Laktyushin 2021-03-01 18:19:12 +04:00
parent c767cc94e0
commit ebd41831c1
4 changed files with 8 additions and 5 deletions

View File

@ -50,7 +50,10 @@ final class BotPaymentFieldItemNode: BotPaymentItemNode, UITextFieldDelegate {
switch contentType {
case .generic:
break
case .name, .address:
case .name:
self.textField.textField.autocorrectionType = .no
self.textField.textField.keyboardType = .asciiCapable
case .address:
self.textField.textField.autocorrectionType = .no
case .phoneNumber:
self.textField.textField.keyboardType = .phonePad

View File

@ -55,9 +55,9 @@ public func stringForMediumDate(timestamp: Int32, strings: PresentationStrings,
let separator = dateTimeFormat.dateSeparator
switch dateTimeFormat.dateFormat {
case .monthFirst:
dateString = String(format: "%d%@%d%@%02d", month, separator, day, separator, year - 100)
dateString = String(format: "%02d%@%02d%@%02d", month, separator, day, separator, year - 100)
case .dayFirst:
dateString = String(format: "%d%@%02d%@%02d", day, separator, month, separator, year - 100)
dateString = String(format: "%02d%@%02d%@%02d", day, separator, month, separator, year - 100)
}
let timeString = stringForShortTimestamp(hours: Int32(timeinfo.tm_hour), minutes: Int32(timeinfo.tm_min), dateTimeFormat: dateTimeFormat)

View File

@ -21,7 +21,7 @@ func chatHistoryEntriesForView(location: ChatLocation, view: MessageHistoryView,
if id == cachedChannelAdminRanksEntryId(peerId: peerId), let data = data as? CachedChannelAdminRanks {
adminRanks = data.ranks
}
} else if case let .peer(_, peer) = additionalEntry, let channel = peer as? TelegramChannel {
} else if case let .peer(_, peer) = additionalEntry, let channel = peer as? TelegramChannel, !channel.flags.contains(.isGigagroup) {
if let defaultBannedRights = channel.defaultBannedRights, defaultBannedRights.flags.contains(.banSendStickers) {
stickersEnabled = false
}

View File

@ -892,7 +892,7 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState
}
var clearCacheAsDelete = false
if message.id.peerId.namespace == Namespaces.Peer.CloudChannel && !isMigrated {
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info, !isMigrated {
var views: Int = 0
for attribute in message.attributes {
if let attribute = attribute as? ViewCountMessageAttribute {