mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Support additional sticker states
Co-authored-by: scott@signal.org Co-authored-by: ken@signal.org
This commit is contained in:
committed by
Scott Nonnenberg
parent
41880cfe66
commit
be5d0837f8
69
app/sql.js
69
app/sql.js
@@ -1193,14 +1193,14 @@ async function updateConversation(data) {
|
||||
|
||||
await db.run(
|
||||
`UPDATE conversations SET
|
||||
json = $json,
|
||||
json = $json,
|
||||
|
||||
active_at = $active_at,
|
||||
type = $type,
|
||||
members = $members,
|
||||
name = $name,
|
||||
profileName = $profileName
|
||||
WHERE id = $id;`,
|
||||
active_at = $active_at,
|
||||
type = $type,
|
||||
members = $members,
|
||||
name = $name,
|
||||
profileName = $profileName
|
||||
WHERE id = $id;`,
|
||||
{
|
||||
$id: id,
|
||||
$json: objectToJSON(data),
|
||||
@@ -1879,8 +1879,46 @@ async function createOrUpdateStickerPack(pack) {
|
||||
);
|
||||
}
|
||||
|
||||
const rows = await db.all('SELECT id FROM sticker_packs WHERE id = $id;', {
|
||||
$id: id,
|
||||
});
|
||||
const payload = {
|
||||
$attemptedStatus: attemptedStatus,
|
||||
$author: author,
|
||||
$coverStickerId: coverStickerId,
|
||||
$createdAt: createdAt || Date.now(),
|
||||
$downloadAttempts: downloadAttempts || 1,
|
||||
$id: id,
|
||||
$installedAt: installedAt,
|
||||
$key: key,
|
||||
$lastUsed: lastUsed || null,
|
||||
$status: status,
|
||||
$stickerCount: stickerCount,
|
||||
$title: title,
|
||||
};
|
||||
|
||||
if (rows && rows.length) {
|
||||
await db.run(
|
||||
`UPDATE sticker_packs SET
|
||||
attemptedStatus = $attemptedStatus,
|
||||
author = $author,
|
||||
coverStickerId = $coverStickerId,
|
||||
createdAt = $createdAt,
|
||||
downloadAttempts = $downloadAttempts,
|
||||
installedAt = $installedAt,
|
||||
key = $key,
|
||||
lastUsed = $lastUsed,
|
||||
status = $status,
|
||||
stickerCount = $stickerCount,
|
||||
title = $title
|
||||
WHERE id = $id;`,
|
||||
payload
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
await db.run(
|
||||
`INSERT OR REPLACE INTO sticker_packs (
|
||||
`INSERT INTO sticker_packs (
|
||||
attemptedStatus,
|
||||
author,
|
||||
coverStickerId,
|
||||
@@ -1907,20 +1945,7 @@ async function createOrUpdateStickerPack(pack) {
|
||||
$stickerCount,
|
||||
$title
|
||||
)`,
|
||||
{
|
||||
$attemptedStatus: attemptedStatus,
|
||||
$author: author,
|
||||
$coverStickerId: coverStickerId,
|
||||
$createdAt: createdAt || Date.now(),
|
||||
$downloadAttempts: downloadAttempts || 1,
|
||||
$id: id,
|
||||
$installedAt: installedAt,
|
||||
$key: key,
|
||||
$lastUsed: lastUsed || null,
|
||||
$status: status,
|
||||
$stickerCount: stickerCount,
|
||||
$title: title,
|
||||
}
|
||||
payload
|
||||
);
|
||||
}
|
||||
async function updateStickerPackStatus(id, status, options) {
|
||||
|
||||
Reference in New Issue
Block a user