From 67434c2d0b6d38fe2a3ce8141fad79b16236dd94 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Fri, 17 Apr 2020 15:34:03 -0500 Subject: [PATCH] Made the displayText a property of a Status. --- .../Account/FeedProvider/Twitter/TwitterStatus.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Frameworks/Account/FeedProvider/Twitter/TwitterStatus.swift b/Frameworks/Account/FeedProvider/Twitter/TwitterStatus.swift index 31d22f06d..b675d1be7 100644 --- a/Frameworks/Account/FeedProvider/Twitter/TwitterStatus.swift +++ b/Frameworks/Account/FeedProvider/Twitter/TwitterStatus.swift @@ -37,9 +37,8 @@ final class TwitterStatus: Codable { return "\(userURL)/status/\(idStr)" } - func renderAsText() -> String? { - let statusToRender = retweetedStatus != nil ? retweetedStatus! : self - if let text = statusToRender.fullText, let displayRange = statusToRender.displayTextRange, displayRange.count > 1, + var displayText: String? { + if let text = fullText, let displayRange = displayTextRange, displayRange.count > 1, let startIndex = text.index(text.startIndex, offsetBy: displayRange[0], limitedBy: text.endIndex), let endIndex = text.index(text.startIndex, offsetBy: displayRange[1], limitedBy: text.endIndex) { return String(text[startIndex.. String? { + let statusToRender = retweetedStatus != nil ? retweetedStatus! : self + return statusToRender.displayText + } + func renderAsHTML() -> String? { return nil }