mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-11 13:59:13 +00:00
remove @ if not needed (#2126)
This commit is contained in:
parent
bec6cdac05
commit
053e134a54
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user