feat: Enhance account handling and message delivery status updates; improve UI feedback for saved messages

This commit is contained in:
k1ngsterr1
2026-01-18 18:12:45 +05:00
parent 61995e9286
commit b8aba7714c
4 changed files with 87 additions and 81 deletions

View File

@@ -549,6 +549,7 @@ interface DialogDao {
COALESCE(
(SELECT delivered FROM messages
WHERE account = :account
AND from_me = 1
AND ((from_public_key = :opponentKey AND to_public_key = :account)
OR (from_public_key = :account AND to_public_key = :opponentKey))
ORDER BY timestamp DESC LIMIT 1),
@@ -557,6 +558,7 @@ interface DialogDao {
COALESCE(
(SELECT read FROM messages
WHERE account = :account
AND from_me = 1
AND ((from_public_key = :opponentKey AND to_public_key = :account)
OR (from_public_key = :account AND to_public_key = :opponentKey))
ORDER BY timestamp DESC LIMIT 1),
@@ -639,22 +641,8 @@ interface DialogDao {
) AS verified,
1 AS i_have_sent,
1 AS last_message_from_me,
COALESCE(
(SELECT delivered FROM messages
WHERE account = :account
AND from_public_key = :account
AND to_public_key = :account
ORDER BY timestamp DESC LIMIT 1),
0
) AS last_message_delivered,
COALESCE(
(SELECT read FROM messages
WHERE account = :account
AND from_public_key = :account
AND to_public_key = :account
ORDER BY timestamp DESC LIMIT 1),
0
) AS last_message_read
1 AS last_message_delivered,
1 AS last_message_read
WHERE EXISTS (
SELECT 1 FROM messages
WHERE account = :account