Add receive support for pin/unpin message

This commit is contained in:
Jamie
2025-12-04 12:47:19 -08:00
committed by GitHub
parent 1b03cc4b9b
commit efe2c8de71
24 changed files with 861 additions and 97 deletions

View File

@@ -0,0 +1,17 @@
// Copyright 2025 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { WritableDB } from '../Interface.std.js';
import { sql } from '../util.std.js';
export default function updateToSchemaVersion1570(db: WritableDB): void {
const [query] = sql`
-- We only need the 'messageId' column
ALTER TABLE pinnedMessages DROP COLUMN messageSentAt;
ALTER TABLE pinnedMessages DROP COLUMN messageSenderAci;
-- We dont need to know who pinned the message
ALTER TABLE pinnedMessages DROP COLUMN pinnedByAci;
`;
db.exec(query);
}

View File

@@ -133,6 +133,7 @@ import updateToSchemaVersion1540 from './1540-partial-expiring-index.std.js';
import updateToSchemaVersion1550 from './1550-has-link-preview.std.js';
import updateToSchemaVersion1560 from './1560-pinned-messages.std.js';
import updateToSchemaVersion1561 from './1561-cleanup-polls.std.js';
import updateToSchemaVersion1570 from './1570-pinned-messages-updates.std.js';
import { DataWriter } from '../Server.node.js';
@@ -1625,6 +1626,7 @@ export const SCHEMA_VERSIONS: ReadonlyArray<SchemaUpdateType> = [
{ version: 1560, update: updateToSchemaVersion1560 },
// 1561, 1551, and 1541 all refer to the same migration
{ version: 1561, update: updateToSchemaVersion1561 },
{ version: 1570, update: updateToSchemaVersion1570 },
];
export class DBVersionFromFutureError extends Error {