feat: Simplify message query conditions in DialogDao for improved clarity and performance
This commit is contained in:
@@ -550,8 +550,8 @@ interface DialogDao {
|
|||||||
(SELECT delivered FROM messages
|
(SELECT delivered FROM messages
|
||||||
WHERE account = :account
|
WHERE account = :account
|
||||||
AND from_me = 1
|
AND from_me = 1
|
||||||
AND ((from_public_key = :opponentKey AND to_public_key = :account)
|
AND from_public_key = :account
|
||||||
OR (from_public_key = :account AND to_public_key = :opponentKey))
|
AND to_public_key = :opponentKey
|
||||||
ORDER BY timestamp DESC LIMIT 1),
|
ORDER BY timestamp DESC LIMIT 1),
|
||||||
0
|
0
|
||||||
) AS last_message_delivered,
|
) AS last_message_delivered,
|
||||||
@@ -559,8 +559,8 @@ interface DialogDao {
|
|||||||
(SELECT read FROM messages
|
(SELECT read FROM messages
|
||||||
WHERE account = :account
|
WHERE account = :account
|
||||||
AND from_me = 1
|
AND from_me = 1
|
||||||
AND ((from_public_key = :opponentKey AND to_public_key = :account)
|
AND from_public_key = :account
|
||||||
OR (from_public_key = :account AND to_public_key = :opponentKey))
|
AND to_public_key = :opponentKey
|
||||||
ORDER BY timestamp DESC LIMIT 1),
|
ORDER BY timestamp DESC LIMIT 1),
|
||||||
0
|
0
|
||||||
) AS last_message_read
|
) AS last_message_read
|
||||||
|
|||||||
Reference in New Issue
Block a user