mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-05-05 12:07:28 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
30
submodules/Emoji/Package.swift
Normal file
30
submodules/Emoji/Package.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
// swift-tools-version:5.5
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Emoji",
|
||||
platforms: [.macOS(.v10_12)],
|
||||
products: [
|
||||
// Products define the executables and libraries a package produces, and make them visible to other packages.
|
||||
.library(
|
||||
name: "Emoji",
|
||||
targets: ["Emoji"]),
|
||||
],
|
||||
dependencies: [
|
||||
// Dependencies declare other packages that this package depends on.
|
||||
// .package(url: /* package url */, from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
// Targets can depend on other targets in this package, and on products in packages this package depends on.
|
||||
.target(
|
||||
name: "Emoji",
|
||||
dependencies: [
|
||||
|
||||
],
|
||||
path: ".",
|
||||
exclude: ["BUILD"]),
|
||||
]
|
||||
)
|
||||
@@ -24,6 +24,7 @@ let package = Package(
|
||||
.package(name: "Reachability", path: "../Reachability"),
|
||||
.package(name: "DarwinDirStat", path: "../Utils/DarwinDirStat"),
|
||||
.package(name: "EncryptionProvider", path: "../EncryptionProvider"),
|
||||
.package(name: "Emoji", path: "../Emoji"),
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
|
||||
@@ -38,6 +39,7 @@ let package = Package(
|
||||
.product(name: "NetworkLogging", package: "NetworkLogging", condition: nil),
|
||||
.product(name: "DarwinDirStat", package: "DarwinDirStat", condition: nil),
|
||||
.product(name: "Reachability", package: "Reachability", condition: nil),
|
||||
.product(name: "Emoji", package: "Emoji", condition: nil),
|
||||
.product(name: "EncryptionProvider", package: "EncryptionProvider", condition: nil)],
|
||||
path: "Sources"),
|
||||
]
|
||||
|
||||
@@ -628,7 +628,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
let descriptionText: String
|
||||
if let performer = performer {
|
||||
descriptionText = performer
|
||||
} else if let size = arguments.file.size {
|
||||
} else if let size = arguments.file.size, size > 0 && size != .max {
|
||||
descriptionText = dataSizeString(size, formatting: DataSizeStringFormatting(chatPresentationData: arguments.presentationData))
|
||||
} else {
|
||||
descriptionText = ""
|
||||
@@ -656,7 +656,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
descriptionString = candidateDescriptionString
|
||||
} else if !isVoice {
|
||||
let descriptionText: String
|
||||
if let size = arguments.file.size {
|
||||
if let size = arguments.file.size, size > 0 && size != .max {
|
||||
descriptionText = dataSizeString(size, formatting: DataSizeStringFormatting(chatPresentationData: arguments.presentationData))
|
||||
} else {
|
||||
descriptionText = ""
|
||||
@@ -1468,7 +1468,7 @@ final class ChatMessageInteractiveFileNode: ASDisplayNode {
|
||||
if let fetchStatus = fetchStatus {
|
||||
switch fetchStatus {
|
||||
case let .Fetching(_, progress):
|
||||
if let size = file.size {
|
||||
if let size = file.size, size > 0 && size != .max {
|
||||
let compactString = dataSizeString(Int(Float(size) * progress), forceDecimal: true, formatting: DataSizeStringFormatting(chatPresentationData: presentationData))
|
||||
let descriptionFont = Font.with(size: floor(presentationData.fontSize.baseDisplaySize * 13.0 / 17.0), design: .regular, weight: .regular, traits: [.monospacedNumbers])
|
||||
downloadingStrings = ("\(compactString) / \(dataSizeString(size, forceDecimal: true, formatting: DataSizeStringFormatting(chatPresentationData: presentationData)))", compactString, descriptionFont)
|
||||
|
||||
Reference in New Issue
Block a user