mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Business improvements
This commit is contained in:
parent
fad672e352
commit
f2412ff329
@ -307,7 +307,7 @@ public enum ResolvedUrl {
|
||||
case boost(peerId: PeerId?, status: ChannelBoostStatus?, myBoostStatus: MyBoostStatus?)
|
||||
case premiumGiftCode(slug: String)
|
||||
case premiumMultiGift(reference: String?)
|
||||
case messageLink(link: TelegramResolvedMessageLink)
|
||||
case messageLink(link: TelegramResolvedMessageLink?)
|
||||
}
|
||||
|
||||
public enum ResolveUrlResult {
|
||||
|
@ -182,9 +182,17 @@ final class BusinessLinkListItemComponent: Component {
|
||||
}
|
||||
|
||||
let asyncLayout = TextNodeWithEntities.asyncLayout(self.text)
|
||||
let filteredEntities = component.link.entities.filter { entity in
|
||||
switch entity.type {
|
||||
case .CustomEmoji:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
let textString = stringWithAppliedEntities(
|
||||
component.link.message.isEmpty ? "No text" : component.link.message,
|
||||
entities: component.link.entities,
|
||||
entities: filteredEntities,
|
||||
baseColor: component.theme.list.itemSecondaryTextColor,
|
||||
linkColor: component.theme.list.itemSecondaryTextColor,
|
||||
baseQuoteTintColor: nil,
|
||||
|
@ -341,7 +341,7 @@ final class BusinessLinksSetupScreenComponent: Component {
|
||||
let iconSize = self.icon.update(
|
||||
transition: .immediate,
|
||||
component: AnyComponent(LottieComponent(
|
||||
content: LottieComponent.AppBundleContent(name: "MapEmoji"),
|
||||
content: LottieComponent.AppBundleContent(name: "MessageLinkEmoji"),
|
||||
loop: false
|
||||
)),
|
||||
environment: {},
|
||||
|
BIN
submodules/TelegramUI/Resources/Animations/MessageLinkEmoji.tgs
Normal file
BIN
submodules/TelegramUI/Resources/Animations/MessageLinkEmoji.tgs
Normal file
Binary file not shown.
@ -55,6 +55,15 @@ func serviceTasksForChatPresentationIntefaceState(context: AccountContext, chatP
|
||||
}
|
||||
|
||||
func inputContextQueriesForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState) -> [ChatPresentationInputQuery] {
|
||||
if case let .customChatContents(customChatContents) = chatPresentationInterfaceState.subject {
|
||||
switch customChatContents.kind {
|
||||
case .quickReplyMessageInput:
|
||||
break
|
||||
case .businessLinkSetup:
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
let inputState = chatPresentationInterfaceState.interfaceState.effectiveInputState
|
||||
let inputString: NSString = inputState.inputText.string as NSString
|
||||
var result: [ChatPresentationInputQuery] = []
|
||||
|
@ -3189,11 +3189,11 @@ private final class ChatRateTranscriptionContextItemNode: ASDisplayNode, Context
|
||||
self.textNode.maximumNumberOfLines = 1
|
||||
|
||||
self.upButtonImageNode = ASImageNode()
|
||||
self.upButtonImageNode.image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ThumbsUp"), color: presentationData.theme.contextMenu.primaryColor, backgroundColor: nil)
|
||||
self.upButtonImageNode.image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ThumbsDown"), color: presentationData.theme.contextMenu.primaryColor, backgroundColor: nil)
|
||||
self.upButtonImageNode.isUserInteractionEnabled = false
|
||||
|
||||
self.downButtonImageNode = ASImageNode()
|
||||
self.downButtonImageNode.image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ThumbsDown"), color: presentationData.theme.contextMenu.primaryColor, backgroundColor: nil)
|
||||
self.downButtonImageNode.image = generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/ThumbsUp"), color: presentationData.theme.contextMenu.primaryColor, backgroundColor: nil)
|
||||
self.downButtonImageNode.isUserInteractionEnabled = false
|
||||
|
||||
self.upButtonNode = HighlightableButtonNode()
|
||||
|
@ -2022,7 +2022,7 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate, Ch
|
||||
var leftInset = leftInset
|
||||
|
||||
var textInputBackgroundWidthOffset: CGFloat = 0.0
|
||||
var attachmentButtonX: CGFloat = hideOffset.x + leftInset + 2.0 - UIScreenPixel
|
||||
var attachmentButtonX: CGFloat = hideOffset.x + leftInset + leftMenuInset + 2.0 - UIScreenPixel
|
||||
if !displayMediaButton {
|
||||
attachmentButtonX = -40.0
|
||||
let inputFieldAdditionalWidth = 40.0 - 4.0
|
||||
|
@ -1059,15 +1059,20 @@ func openResolvedUrlImpl(
|
||||
}
|
||||
})
|
||||
case let .messageLink(link):
|
||||
if let navigationController = navigationController {
|
||||
context.sharedContext.navigateToChatController(NavigateToChatControllerParams(
|
||||
navigationController: navigationController,
|
||||
context: context,
|
||||
chatLocation: .peer(link.peer),
|
||||
updateTextInputState: ChatTextInputState(inputText: chatInputStateStringWithAppliedEntities(link.message, entities: link.entities)),
|
||||
activateInput: .text,
|
||||
keepStack: .always
|
||||
))
|
||||
if let link {
|
||||
if let navigationController = navigationController {
|
||||
context.sharedContext.navigateToChatController(NavigateToChatControllerParams(
|
||||
navigationController: navigationController,
|
||||
context: context,
|
||||
chatLocation: .peer(link.peer),
|
||||
updateTextInputState: ChatTextInputState(inputText: chatInputStateStringWithAppliedEntities(link.message, entities: link.entities)),
|
||||
activateInput: .text,
|
||||
keepStack: .always
|
||||
))
|
||||
}
|
||||
} else {
|
||||
//TODO:localize
|
||||
present(textAlertController(context: context, updatedPresentationData: updatedPresentationData, title: nil, text: "Link expired.", actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1000,7 +1000,7 @@ private func resolveInternalUrl(context: AccountContext, url: ParsedInternalUrl)
|
||||
|> then(context.engine.peers.resolveMessageLink(slug: slug)
|
||||
|> mapToSignal { result -> Signal<ResolveInternalUrlResult, NoError> in
|
||||
guard let result else {
|
||||
return .single(.result(nil))
|
||||
return .single(.result(.messageLink(link: nil)))
|
||||
}
|
||||
var customEmojiIds: [Int64] = []
|
||||
for entity in result.entities {
|
||||
|
Loading…
x
Reference in New Issue
Block a user