Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @HiltViewModel
- class ChatViewModel @Inject constructor(
- private val repository: GirlsRepositoryImpl
- ): ViewModel() {
- /* private val _girlBotReply = MutableLiveData<String?>()
- val girlBotReply: LiveData<String?> = _girlBotReply*/
- fun getGirlfriendBotReply(botId: String, message: KitMessage) {
- viewModelScope.launch(Dispatchers.IO) {
- val botReplyMessage = repository.getGirlfriendBotReply(botId, message)
- //_girlBotReply.postValue(botReplyMessage)
- uploadGirlBotReply.postValue(botReplyMessage)
- }
- }
- fun saveDialogListOfMessagesById(dialogId: String, lastMessage: KitMessage) {
- repository.saveDialogLastMessagesById(dialogId, lastMessage, {
- })
- }
- fun getDialogListOfMessagesById(dialogId: String) : List<KitMessage> =
- repository.getDialogListOfMessagesById(dialogId)
- private val _messages = SingleLiveEvent<KitMessage>()
- val dialogMessages: LiveData<KitMessage> = _messages
- fun setDialogMessages(lastMessage: KitMessage) {
- _messages.value = lastMessage
- }
- val uploadGirlBotReply = SingleLiveEvent<String?>()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement