diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4afdd9fa56..e39b0297b6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -44,7 +44,7 @@ serialization_json = "1.6.3" showkase = "1.0.3" appyx = "1.4.0" sqldelight = "2.0.2" -wysiwyg = "2.37.5" +wysiwyg = "2.37.7" telephoto = "0.12.0" # DI diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt index 015677c99c..0e05c3606b 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt @@ -33,17 +33,19 @@ data class Suggestion( ) } -enum class SuggestionType { - Mention, - Command, - Room; +sealed interface SuggestionType { + data object Mention : SuggestionType + data object Command : SuggestionType + data object Room : SuggestionType + data class Custom(val pattern: String) : SuggestionType companion object { fun fromPatternKey(key: PatternKey): SuggestionType { return when (key) { - PatternKey.AT -> Mention - PatternKey.SLASH -> Command - PatternKey.HASH -> Room + PatternKey.At -> Mention + PatternKey.Slash -> Command + PatternKey.Hash -> Room + is PatternKey.Custom -> Custom(key.v1) } } }