mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[WIP] Monoforums
This commit is contained in:
@@ -781,10 +781,6 @@ private final class ChatEmptyNodeCloudChatContent: ASDisplayNode, ChatEmptyNodeC
|
||||
insets.top = -9.0
|
||||
imageSpacing = 4.0
|
||||
titleSpacing = 5.0
|
||||
case .postSuggestions:
|
||||
insets.top = 10.0
|
||||
imageSpacing = 5.0
|
||||
titleSpacing = 5.0
|
||||
case .hashTagSearch:
|
||||
break
|
||||
}
|
||||
@@ -846,7 +842,7 @@ private final class ChatEmptyNodeCloudChatContent: ASDisplayNode, ChatEmptyNodeC
|
||||
}
|
||||
|
||||
self.businessLink = link
|
||||
case .hashTagSearch, .postSuggestions:
|
||||
case .hashTagSearch:
|
||||
titleString = ""
|
||||
strings = []
|
||||
}
|
||||
@@ -1303,10 +1299,7 @@ public final class ChatEmptyNodePremiumRequiredChatContent: ASDisplayNode, ChatE
|
||||
let starsString = presentationStringsFormattedNumber(Int32(amount), interfaceState.dateTimeFormat.groupingSeparator)
|
||||
let rawText: String
|
||||
|
||||
if case let .customChatContents(customChatContents) = interfaceState.subject, case .postSuggestions = customChatContents.kind {
|
||||
//TODO:localize
|
||||
rawText = "\(peerTitle) charges $ \(starsString) per message suggestion."
|
||||
} else if self.isPremiumDisabled {
|
||||
if self.isPremiumDisabled {
|
||||
rawText = interfaceState.strings.Chat_EmptyStatePaidMessagingDisabled_Text(peerTitle, " $ \(starsString)").string
|
||||
} else {
|
||||
rawText = interfaceState.strings.Chat_EmptyStatePaidMessaging_Text(peerTitle, " $ \(starsString)").string
|
||||
@@ -1369,14 +1362,7 @@ public final class ChatEmptyNodePremiumRequiredChatContent: ASDisplayNode, ChatE
|
||||
contentsHeight += iconTextSpacing
|
||||
|
||||
let iconComponent: AnyComponent<Empty>
|
||||
if case let .customChatContents(customChatContents) = interfaceState.subject, case .postSuggestions = customChatContents.kind {
|
||||
iconComponent = AnyComponent(
|
||||
BundleIconComponent(
|
||||
name: "Chat/Empty Chat/PostSuggestions",
|
||||
tintColor: serviceColor.primaryText
|
||||
)
|
||||
)
|
||||
} else {
|
||||
do {
|
||||
iconComponent = AnyComponent(
|
||||
LottieComponent(
|
||||
content: LottieComponent.AppBundleContent(name: "PremiumRequired"),
|
||||
@@ -1447,7 +1433,6 @@ private enum ChatEmptyNodeContentType: Equatable {
|
||||
case topic
|
||||
case premiumRequired
|
||||
case starsRequired(Int64)
|
||||
case postSuggestions(Int64)
|
||||
}
|
||||
|
||||
private final class EmptyAttachedDescriptionNode: HighlightTrackingButtonNode {
|
||||
@@ -1816,12 +1801,8 @@ public final class ChatEmptyNode: ASDisplayNode {
|
||||
case let .emptyChat(emptyType):
|
||||
if case .customGreeting = emptyType {
|
||||
contentType = .greeting
|
||||
} else if case let .customChatContents(customChatContents) = interfaceState.subject {
|
||||
if case let .postSuggestions(postSuggestions) = customChatContents.kind {
|
||||
contentType = .postSuggestions(postSuggestions.value)
|
||||
} else {
|
||||
contentType = .cloud
|
||||
}
|
||||
} else if case .customChatContents = interfaceState.subject {
|
||||
contentType = .cloud
|
||||
} else if case .replyThread = interfaceState.chatLocation {
|
||||
if case .topic = emptyType {
|
||||
contentType = .topic
|
||||
@@ -1908,8 +1889,6 @@ public final class ChatEmptyNode: ASDisplayNode {
|
||||
node = ChatEmptyNodePremiumRequiredChatContent(context: self.context, interaction: self.interaction, stars: nil)
|
||||
case let .starsRequired(stars):
|
||||
node = ChatEmptyNodePremiumRequiredChatContent(context: self.context, interaction: self.interaction, stars: stars)
|
||||
case let .postSuggestions(stars):
|
||||
node = ChatEmptyNodePremiumRequiredChatContent(context: self.context, interaction: self.interaction, stars: stars)
|
||||
}
|
||||
self.content = (contentType, node)
|
||||
self.addSubnode(node)
|
||||
@@ -1921,7 +1900,7 @@ public final class ChatEmptyNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
switch contentType {
|
||||
case .peerNearby, .greeting, .premiumRequired, .starsRequired, .cloud, .postSuggestions:
|
||||
case .peerNearby, .greeting, .premiumRequired, .starsRequired, .cloud:
|
||||
self.isUserInteractionEnabled = true
|
||||
default:
|
||||
self.isUserInteractionEnabled = false
|
||||
|
||||
Reference in New Issue
Block a user