mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Further improvements for backup import/export
This commit is contained in:
@@ -117,10 +117,12 @@ export type CallDetails = Readonly<{
|
||||
callId: string;
|
||||
peerId: AciString | string;
|
||||
ringerId: AciString | string | null;
|
||||
startedById: AciString | string | null;
|
||||
mode: CallMode;
|
||||
type: CallType;
|
||||
direction: CallDirection;
|
||||
timestamp: number;
|
||||
endedTimestamp: number | null;
|
||||
}>;
|
||||
|
||||
export type CallLogEventTarget = Readonly<{
|
||||
@@ -147,7 +149,10 @@ export type CallHistoryDetails = CallDetails &
|
||||
status: CallStatus;
|
||||
}>;
|
||||
|
||||
export type CallHistoryGroup = Omit<CallHistoryDetails, 'callId' | 'ringerId'> &
|
||||
export type CallHistoryGroup = Omit<
|
||||
CallHistoryDetails,
|
||||
'callId' | 'ringerId' | 'startedById' | 'endedTimestamp'
|
||||
> &
|
||||
Readonly<{
|
||||
children: ReadonlyArray<{
|
||||
callId: string;
|
||||
@@ -200,10 +205,12 @@ export const callDetailsSchema = z.object({
|
||||
callId: z.string(),
|
||||
peerId: z.string(),
|
||||
ringerId: ringerIdSchema,
|
||||
startedById: aciSchema.or(z.null()),
|
||||
mode: callModeSchema,
|
||||
type: callTypeSchema,
|
||||
direction: callDirectionSchema,
|
||||
timestamp: z.number(),
|
||||
endedTimestamp: z.number().or(z.null()),
|
||||
}) satisfies z.ZodType<CallDetails>;
|
||||
|
||||
export const callEventDetailsSchema = callDetailsSchema.extend({
|
||||
|
||||
@@ -169,7 +169,7 @@ export async function createPacksFromBackup(
|
||||
|
||||
id,
|
||||
key,
|
||||
status: 'known' as const,
|
||||
status: 'installed' as const,
|
||||
})
|
||||
);
|
||||
|
||||
@@ -187,11 +187,15 @@ export async function getStickerPacksForBackup(): Promise<
|
||||
const uninstalled = new Set(
|
||||
(await DataReader.getUninstalledStickerPacks()).map(({ id }) => id)
|
||||
);
|
||||
for (const { id, key } of stickerPacks) {
|
||||
for (const { id, key, status } of stickerPacks) {
|
||||
if (uninstalled.has(id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (status === 'known' || status === 'ephemeral') {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.push({ id, key });
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user