diff --git a/ts/session/crypto/MessageEncrypter.ts b/ts/session/crypto/MessageEncrypter.ts index 8b2457961..22ce64ccc 100644 --- a/ts/session/crypto/MessageEncrypter.ts +++ b/ts/session/crypto/MessageEncrypter.ts @@ -32,6 +32,7 @@ export function encrypt( } { const plainText = padPlainTextBuffer(plainTextBuffer); // TODO: Do encryption here? + return { envelopeType: SignalService.Envelope.Type.CIPHERTEXT, cipherText: new Uint8Array(), diff --git a/ts/session/protocols/SessionProtocol.ts b/ts/session/protocols/SessionProtocol.ts index 3f9cf2dc8..ebeac9f37 100644 --- a/ts/session/protocols/SessionProtocol.ts +++ b/ts/session/protocols/SessionProtocol.ts @@ -35,13 +35,13 @@ export async function sendSessionRequest( return Promise.resolve(); } -export async function sessionEstablished(device: string) { +export function sessionEstablished(device: string) { // TODO: this is called when we receive an encrypted message from the other user // Maybe it should be renamed to something else // TODO: This should make `hasSentSessionRequest` return `false` } -export async function shouldProcessSessionRequest( +export function shouldProcessSessionRequest( device: string, messageTimestamp: number ): boolean { @@ -50,7 +50,7 @@ export async function shouldProcessSessionRequest( return false; } -export async function sessionRequestProcessed(device: string) { +export function sessionRequestProcessed(device: string) { // TODO: this is called when we process the session request // This should store the processed timestamp // Again naming is crap so maybe some other name is better diff --git a/ts/session/sending/MessageQueue.ts b/ts/session/sending/MessageQueue.ts index fb9ed0445..5eeaa2426 100644 --- a/ts/session/sending/MessageQueue.ts +++ b/ts/session/sending/MessageQueue.ts @@ -1,5 +1,5 @@ import { MessageQueueInterface } from './MessageQueueInterface'; -import { OutgoingContentMessage, OpenGroupMessage } from '../messages/outgoing'; +import { OpenGroupMessage, OutgoingContentMessage } from '../messages/outgoing'; import { JobQueue } from '../utils/JobQueue'; import { PendingMessageCache } from './PendingMessageCache'; diff --git a/ts/session/sending/MessageQueueInterface.ts b/ts/session/sending/MessageQueueInterface.ts index 06f52cc7e..a231ad02c 100644 --- a/ts/session/sending/MessageQueueInterface.ts +++ b/ts/session/sending/MessageQueueInterface.ts @@ -1,4 +1,4 @@ -import { OutgoingContentMessage, OpenGroupMessage } from '../messages/outgoing'; +import { OpenGroupMessage, OutgoingContentMessage } from '../messages/outgoing'; // TODO: add all group messages here, replace OutgoingContentMessage with them type GroupMessageType = OpenGroupMessage | OutgoingContentMessage; diff --git a/ts/session/sending/PendingMessageCache.ts b/ts/session/sending/PendingMessageCache.ts index 1d722642b..2f10e58a6 100644 --- a/ts/session/sending/PendingMessageCache.ts +++ b/ts/session/sending/PendingMessageCache.ts @@ -4,7 +4,7 @@ import { OutgoingContentMessage } from '../messages/outgoing'; // TODO: We should be able to import functions straight from the db here without going through the window object export class PendingMessageCache { - private cachedMessages: Array = []; + private readonly cachedMessages: Array = []; constructor() { // TODO: We should load pending messages from db here