Rename detectPermalinks to addMatrixEntityPermalinkAttributesTo and move code around

This commit is contained in:
Stefan Ceriu
2025-08-21 13:01:57 +03:00
committed by Doug
parent 84068fb926
commit 549a8de6a9
3 changed files with 45 additions and 19 deletions
@@ -493,7 +493,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
attributedString = NSMutableAttributedString(string: string, attributes: [.link: URL(string: urlString) as Any])
}
attributedStringBuilder.detectPermalinks(attributedString)
attributedStringBuilder.addMatrixEntityPermalinkAttributesTo(attributedString)
// In RTE mentions don't need to be handled as links
attributedString.removeAttribute(.link, range: NSRange(location: 0, length: attributedString.length))
@@ -606,7 +606,7 @@ final class ComposerToolbarViewModel: ComposerToolbarViewModelType, ComposerTool
attributedString.addAttribute(.MatrixAllUsersMention, value: true, range: match.range)
}
attributedStringBuilder.detectPermalinks(attributedString)
attributedStringBuilder.addMatrixEntityPermalinkAttributesTo(attributedString)
state.bindings.plainComposerText = attributedString
}