decrypt/encrypt with libsignal-client, remove libsignal-protocol-javascript
This commit is contained in:
parent
37ff4a1df4
commit
86d2a4b5dd
60 changed files with 2508 additions and 28714 deletions
|
@ -53,6 +53,7 @@ import {
|
|||
StickerPackType,
|
||||
StickerType,
|
||||
UnprocessedType,
|
||||
UnprocessedUpdateType,
|
||||
} from './Interface';
|
||||
import Server from './Server';
|
||||
import { MessageModel } from '../models/messages';
|
||||
|
@ -1304,11 +1305,14 @@ async function saveUnprocesseds(
|
|||
async function updateUnprocessedAttempts(id: string, attempts: number) {
|
||||
await channels.updateUnprocessedAttempts(id, attempts);
|
||||
}
|
||||
async function updateUnprocessedWithData(id: string, data: UnprocessedType) {
|
||||
async function updateUnprocessedWithData(
|
||||
id: string,
|
||||
data: UnprocessedUpdateType
|
||||
) {
|
||||
await channels.updateUnprocessedWithData(id, data);
|
||||
}
|
||||
async function updateUnprocessedsWithData(
|
||||
array: Array<{ id: string; data: UnprocessedType }>
|
||||
array: Array<{ id: string; data: UnprocessedUpdateType }>
|
||||
) {
|
||||
await channels.updateUnprocessedsWithData(array);
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ export type SessionType = {
|
|||
conversationId: string;
|
||||
deviceId: number;
|
||||
record: string;
|
||||
version?: number;
|
||||
};
|
||||
export type SignedPreKeyType = {
|
||||
confirmed: boolean;
|
||||
|
@ -128,6 +129,14 @@ export type UnprocessedType = {
|
|||
decrypted?: string;
|
||||
};
|
||||
|
||||
export type UnprocessedUpdateType = {
|
||||
source?: string;
|
||||
sourceUuid?: string;
|
||||
sourceDevice?: string;
|
||||
serverTimestamp?: number;
|
||||
decrypted?: string;
|
||||
};
|
||||
|
||||
export type DataInterface = {
|
||||
close: () => Promise<void>;
|
||||
removeDB: () => Promise<void>;
|
||||
|
@ -210,10 +219,10 @@ export type DataInterface = {
|
|||
updateUnprocessedAttempts: (id: string, attempts: number) => Promise<void>;
|
||||
updateUnprocessedWithData: (
|
||||
id: string,
|
||||
data: UnprocessedType
|
||||
data: UnprocessedUpdateType
|
||||
) => Promise<void>;
|
||||
updateUnprocessedsWithData: (
|
||||
array: Array<{ id: string; data: UnprocessedType }>
|
||||
array: Array<{ id: string; data: UnprocessedUpdateType }>
|
||||
) => Promise<void>;
|
||||
getUnprocessedById: (id: string) => Promise<UnprocessedType | undefined>;
|
||||
saveUnprocesseds: (
|
||||
|
|
|
@ -53,6 +53,7 @@ import {
|
|||
StickerPackType,
|
||||
StickerType,
|
||||
UnprocessedType,
|
||||
UnprocessedUpdateType,
|
||||
} from './Interface';
|
||||
|
||||
declare global {
|
||||
|
@ -3517,7 +3518,7 @@ async function updateUnprocessedAttempts(
|
|||
}
|
||||
async function updateUnprocessedWithData(
|
||||
id: string,
|
||||
data: UnprocessedType
|
||||
data: UnprocessedUpdateType
|
||||
): Promise<void> {
|
||||
const db = getInstance();
|
||||
const { source, sourceUuid, sourceDevice, serverTimestamp, decrypted } = data;
|
||||
|
@ -3543,7 +3544,7 @@ async function updateUnprocessedWithData(
|
|||
});
|
||||
}
|
||||
async function updateUnprocessedsWithData(
|
||||
arrayOfUnprocessed: Array<{ id: string; data: UnprocessedType }>
|
||||
arrayOfUnprocessed: Array<{ id: string; data: UnprocessedUpdateType }>
|
||||
): Promise<void> {
|
||||
const db = getInstance();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue