feat: add avatar presence handling in OtherProfileScreen for improved scroll behavior
This commit is contained in:
@@ -579,8 +579,11 @@ interface DialogDao {
|
||||
*/
|
||||
@Transaction
|
||||
suspend fun updateDialogFromMessages(account: String, opponentKey: String) {
|
||||
// 📁 Для saved messages dialogKey = account (не "$account:$account")
|
||||
val dialogKey =
|
||||
if (account < opponentKey) "$account:$opponentKey" else "$opponentKey:$account"
|
||||
if (account == opponentKey) account
|
||||
else if (account < opponentKey) "$account:$opponentKey"
|
||||
else "$opponentKey:$account"
|
||||
|
||||
// 1. Получаем последнее сообщение — O(1) по индексу (account, dialog_key, timestamp)
|
||||
val lastMsg = getLastMessageByDialogKey(account, dialogKey) ?: return
|
||||
@@ -624,7 +627,8 @@ interface DialogDao {
|
||||
*/
|
||||
@Transaction
|
||||
suspend fun updateSavedMessagesDialogFromMessages(account: String) {
|
||||
val dialogKey = "$account:$account"
|
||||
// 📁 dialogKey для saved messages = account (не "$account:$account")
|
||||
val dialogKey = account
|
||||
|
||||
val lastMsg = getLastMessageByDialogKey(account, dialogKey) ?: return
|
||||
val existing = getDialog(account, account)
|
||||
|
||||
Reference in New Issue
Block a user