mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
remove @ if not needed (#2126)
This commit is contained in:
@@ -21,6 +21,9 @@ struct PlainMentionBuilder: MentionBuilderProtocol {
|
|||||||
func handleAllUsersMention(for attributedString: NSMutableAttributedString, in range: NSRange) { }
|
func handleAllUsersMention(for attributedString: NSMutableAttributedString, in range: NSRange) { }
|
||||||
|
|
||||||
func handleUserMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, userID: String) {
|
func handleUserMention(for attributedString: NSMutableAttributedString, in range: NSRange, url: URL, userID: String) {
|
||||||
|
guard !attributedString.attributedSubstring(from: range).string.hasPrefix("@") else {
|
||||||
|
return
|
||||||
|
}
|
||||||
attributedString.insert(NSAttributedString(string: "@"), at: range.location)
|
attributedString.insert(NSAttributedString(string: "@"), at: range.location)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user