feat: Add message count query to MessageDao, enhance ChatDetailScreen with auto-focus on reply input, and improve read receipt handling in ChatViewModel

This commit is contained in:
k1ngsterr1
2026-01-13 07:02:01 +05:00
parent 378c68f1eb
commit eb8d24a782
5 changed files with 161 additions and 57 deletions

View File

@@ -145,6 +145,15 @@ interface MessageDao {
""")
fun getMessagesFlow(account: String, dialogKey: String): Flow<List<MessageEntity>>
/**
* Получить количество сообщений в диалоге
*/
@Query("""
SELECT COUNT(*) FROM messages
WHERE account = :account AND dialog_key = :dialogKey
""")
suspend fun getMessageCount(account: String, dialogKey: String): Int
/**
* Получить последние N сообщений диалога
*/