mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
fb74fa7332
commit
43cd8a4144
@ -231,7 +231,11 @@ final class ChatListNoticeItemNode: ItemListRevealOptionsItemNode {
|
|||||||
let title: String
|
let title: String
|
||||||
let text: String
|
let text: String
|
||||||
if peers.count == 1, let peer = peers.first {
|
if peers.count == 1, let peer = peers.first {
|
||||||
title = item.strings.ChatList_BirthdaySingleTitle(peer.compactDisplayTitle).string
|
var peerName = peer.compactDisplayTitle
|
||||||
|
if peerName.count > 20 {
|
||||||
|
peerName = peerName.prefix(20).trimmingCharacters(in: .whitespacesAndNewlines) + "\u{2026}"
|
||||||
|
}
|
||||||
|
title = item.strings.ChatList_BirthdaySingleTitle(peerName).string
|
||||||
text = item.strings.ChatList_BirthdaySingleText
|
text = item.strings.ChatList_BirthdaySingleText
|
||||||
} else {
|
} else {
|
||||||
title = item.strings.ChatList_BirthdayMultipleTitle(Int32(peers.count))
|
title = item.strings.ChatList_BirthdayMultipleTitle(Int32(peers.count))
|
||||||
|
@ -862,6 +862,9 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
|||||||
if let file = content.file, !file.isAnimated, file.isVideo {
|
if let file = content.file, !file.isAnimated, file.isVideo {
|
||||||
canFullscreen = true
|
canFullscreen = true
|
||||||
}
|
}
|
||||||
|
if content.type == "photo", let _ = content.image {
|
||||||
|
canEdit = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ public func stringForCompactBirthday(_ birthday: TelegramBirthday, strings: Pres
|
|||||||
|
|
||||||
let calendar = Calendar.current
|
let calendar = Calendar.current
|
||||||
if let birthDate = calendar.date(from: dateComponents) {
|
if let birthDate = calendar.date(from: dateComponents) {
|
||||||
if let age = calendar.dateComponents([.year], from: birthDate, to: Date()).year {
|
if let age = calendar.dateComponents([.year], from: birthDate, to: Date()).year, age > 0 {
|
||||||
components.append("(\(strings.UserInfo_Age(Int32(age))))")
|
components.append("(\(strings.UserInfo_Age(Int32(age))))")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,6 +235,12 @@ private final class TokenNode: ASDisplayNode {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
self.titleNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
self.titleNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
|
} else {
|
||||||
|
if isSelected {
|
||||||
|
self.selectedBackgroundNode.alpha = 1.0
|
||||||
|
} else {
|
||||||
|
self.selectedBackgroundNode.alpha = 0.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.titleNode.attributedText = NSAttributedString(string: token.title, font: Font.regular(14.0), textColor: self.isSelected ? self.theme.selectedTextColor : self.theme.primaryTextColor)
|
self.titleNode.attributedText = NSAttributedString(string: token.title, font: Font.regular(14.0), textColor: self.isSelected ? self.theme.selectedTextColor : self.theme.primaryTextColor)
|
||||||
|
@ -2696,16 +2696,10 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
if let self {
|
if let self {
|
||||||
if value {
|
if value {
|
||||||
if let data = self.data?.cachedData as? CachedUserData {
|
if let data = self.data?.cachedData as? CachedUserData {
|
||||||
if data.birthday == nil {
|
if data.birthday == nil && self.state.updatingBirthDate == nil {
|
||||||
self.state = self.state.withUpdatingBirthDate(TelegramBirthday(day: 1, month: 1, year: nil))
|
self.state = self.state.withUpdatingBirthDate(TelegramBirthday(day: 1, month: 1, year: nil))
|
||||||
} else {
|
|
||||||
self.state = self.state.withUpdatingBirthDate(nil)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if self.state.updatingBirthDate != .some(nil) {
|
|
||||||
self.state = self.state.withUpdatingBirthDate(nil)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
self.state = self.state.withIsEditingBirthDate(value)
|
self.state = self.state.withIsEditingBirthDate(value)
|
||||||
|
|
||||||
@ -11070,7 +11064,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
hasBirthdayToday = true
|
hasBirthdayToday = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasBirthdayToday {
|
if hasBirthdayToday, let age = ageForBirthday(birthday), age > 0 {
|
||||||
Queue.mainQueue().after(0.3) {
|
Queue.mainQueue().after(0.3) {
|
||||||
var birthdayItemFrame: CGRect?
|
var birthdayItemFrame: CGRect?
|
||||||
if let section = self.regularSections[InfoSection.peerInfo] {
|
if let section = self.regularSections[InfoSection.peerInfo] {
|
||||||
|
@ -1301,6 +1301,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
|||||||
mediaReference = AnyMediaReference.standalone(media: image)
|
mediaReference = AnyMediaReference.standalone(media: image)
|
||||||
} else if let file = media as? TelegramMediaFile {
|
} else if let file = media as? TelegramMediaFile {
|
||||||
mediaReference = AnyMediaReference.standalone(media: file)
|
mediaReference = AnyMediaReference.standalone(media: file)
|
||||||
|
} else if let webpage = media as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content {
|
||||||
|
if let image = content.image {
|
||||||
|
mediaReference = AnyMediaReference.standalone(media: image)
|
||||||
|
} else if let file = content.file {
|
||||||
|
mediaReference = AnyMediaReference.standalone(media: file)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user