Integrate mentions in the composer (#1799)

* Integrate mentions in the composer:

    - Add `MentionSpanProvider`.
    - Add custom colors needed for mentions.
    - Use the span provider to render mentions in the composer.
    - Allow selecting users from the mentions suggestions to insert a mention.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-11-20 18:14:02 +01:00 committed by GitHub
parent 004804a7c8
commit a8fbb882f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 465 additions and 61 deletions

View file

@ -133,13 +133,15 @@ object PermalinkParser {
}
private fun String.getViaParameters(): List<String> {
return UrlQuerySanitizer(this)
.parameterList
.filter {
it.mParameter == "via"
}
.map {
URLDecoder.decode(it.mValue, "UTF-8")
}
return runCatching {
UrlQuerySanitizer(this)
.parameterList
.filter {
it.mParameter == "via"
}
.map {
URLDecoder.decode(it.mValue, "UTF-8")
}
}.getOrDefault(emptyList())
}
}