Enable user mentions in Rich Text Editor

This commit is contained in:
aringenbach
2023-03-08 15:16:19 +01:00
parent 5b48698587
commit 935e61e1bb
16 changed files with 267 additions and 39 deletions
@@ -16,6 +16,7 @@
import Combine
import Foundation
import WysiwygComposer
struct RoomMembersProviderMember {
var userId: String
@@ -85,6 +86,16 @@ class UserSuggestionService: UserSuggestionServiceProtocol {
currentTextTriggerSubject.send(lastComponent)
}
func processSuggestionPattern(_ suggestionPattern: SuggestionPattern?) {
guard let suggestionPattern, suggestionPattern.key == .at else {
items.send([])
currentTextTriggerSubject.send(nil)
return
}
currentTextTriggerSubject.send("@" + suggestionPattern.text)
}
// MARK: - Private