[WIP] Gift resale

This commit is contained in:
Ilya Laktyushin
2025-04-12 02:19:32 +04:00
parent da86483d66
commit b130511450
46 changed files with 3554 additions and 196 deletions

View File

@@ -361,14 +361,21 @@ public final class ContextControllerActionsListActionItemNode: HighlightTracking
let inputStateText = ChatTextInputStateText(text: self.item.text, attributes: self.item.entities.compactMap { entity -> ChatTextInputStateTextAttribute? in
if case let .CustomEmoji(_, fileId) = entity.type {
return ChatTextInputStateTextAttribute(type: .customEmoji(stickerPack: nil, fileId: fileId, enableAnimation: true), range: entity.range)
} else if case .Bold = entity.type {
return ChatTextInputStateTextAttribute(type: .bold, range: entity.range)
}
return nil
})
let result = NSMutableAttributedString(attributedString: inputStateText.attributedText())
let result = NSMutableAttributedString(attributedString: inputStateText.attributedText(files: self.item.entityFiles))
result.addAttributes([
.font: titleFont,
.foregroundColor: titleColor
], range: NSRange(location: 0, length: result.length))
for attribute in inputStateText.attributes {
if case .bold = attribute.type {
result.addAttribute(NSAttributedString.Key.font, value: Font.semibold(15.0), range: NSRange(location: attribute.range.lowerBound, length: attribute.range.count))
}
}
attributedText = result
} else {
attributedText = parseMarkdownIntoAttributedString(