Финальная версия синхронизации
This commit is contained in:
@@ -70,10 +70,8 @@ export function useDialogFiber() {
|
||||
}
|
||||
await runQuery(
|
||||
"INSERT INTO accounts_sync_times (account, last_sync) VALUES (?, ?) " +
|
||||
"ON CONFLICT(account) DO UPDATE SET last_sync = CASE " +
|
||||
"WHEN excluded.last_sync > last_sync THEN excluded.last_sync " +
|
||||
"ELSE last_sync END",
|
||||
[publicKey, timestamp]
|
||||
"ON CONFLICT(account) DO UPDATE SET last_sync = ?",
|
||||
[publicKey, timestamp, timestamp]
|
||||
);
|
||||
};
|
||||
|
||||
@@ -580,6 +578,7 @@ export function useDialogFiber() {
|
||||
const messageId = packet.getMessageId();
|
||||
await runQuery(`UPDATE messages SET delivered = ?, timestamp = ? WHERE message_id = ? AND account = ?`, [DeliveredMessageState.DELIVERED, Date.now(), messageId, publicKey]);
|
||||
updateDialog(packet.getToPublicKey());
|
||||
updateSyncTime(Date.now());
|
||||
log("Delivery packet received msg id " + messageId);
|
||||
addOrUpdateDialogCache(packet.getToPublicKey(), getDialogCache(packet.getToPublicKey()).map((message) => {
|
||||
if (message.message_id == messageId) {
|
||||
|
||||
Reference in New Issue
Block a user