Feature/mentions (#197)

* mention initial implementation

* Message conservation
This commit is contained in:
Francisco Hola
2025-08-05 23:32:16 +02:00
committed by GitHub
parent 7ee0e8f2f4
commit 325ce1730d
5 changed files with 243 additions and 4 deletions
@@ -83,6 +83,8 @@ class ChatViewModel(
val hasUnreadPrivateMessages = state.hasUnreadPrivateMessages
val showCommandSuggestions: LiveData<Boolean> = state.showCommandSuggestions
val commandSuggestions: LiveData<List<CommandSuggestion>> = state.commandSuggestions
val showMentionSuggestions: LiveData<Boolean> = state.showMentionSuggestions
val mentionSuggestions: LiveData<List<String>> = state.mentionSuggestions
val favoritePeers: LiveData<Set<String>> = state.favoritePeers
val peerSessionStates: LiveData<Map<String, String>> = state.peerSessionStates
val peerFingerprints: LiveData<Map<String, String>> = state.peerFingerprints
@@ -351,6 +353,16 @@ class ChatViewModel(
return commandProcessor.selectCommandSuggestion(suggestion)
}
// MARK: - Mention Autocomplete
fun updateMentionSuggestions(input: String) {
commandProcessor.updateMentionSuggestions(input, meshService)
}
fun selectMentionSuggestion(nickname: String, currentText: String): String {
return commandProcessor.selectMentionSuggestion(nickname, currentText)
}
// MARK: - BluetoothMeshDelegate Implementation (delegated)
override fun didReceiveMessage(message: BitchatMessage) {