diff --git a/Gruntfile.js b/Gruntfile.js
index 0ad59c44e..3966d5852 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -90,7 +90,6 @@ module.exports = grunt => {
'libtextsecure/websocket-resources.js',
'libtextsecure/http-resources.js',
'libtextsecure/message_receiver.js',
- 'libtextsecure/outgoing_message.js',
'libtextsecure/sendmessage.js',
'libtextsecure/sync_request.js',
'libtextsecure/contacts_parser.js',
diff --git a/js/models/messages.js b/js/models/messages.js
index 16fc7ea78..f913208fa 100644
--- a/js/models/messages.js
+++ b/js/models/messages.js
@@ -1200,7 +1200,6 @@
e =>
e.number === number &&
(e.name === 'MessageError' ||
- e.name === 'OutgoingMessageError' ||
e.name === 'SendMessageNetworkError' ||
e.name === 'SignedPreKeyRotationError' ||
e.name === 'OutgoingIdentityKeyError')
@@ -1547,7 +1546,6 @@
this.get('errors'),
e =>
e.name === 'MessageError' ||
- e.name === 'OutgoingMessageError' ||
e.name === 'SendMessageNetworkError' ||
e.name === 'SignedPreKeyRotationError'
);
diff --git a/js/modules/metadata/SecretSessionCipher.js b/js/modules/metadata/SecretSessionCipher.js
index 71ef1df69..5f8d38495 100644
--- a/js/modules/metadata/SecretSessionCipher.js
+++ b/js/modules/metadata/SecretSessionCipher.js
@@ -411,7 +411,6 @@ SecretSessionCipher.prototype = {
return cipher.getRemoteRegistrationId();
},
- // Used by outgoing_message.js
closeOpenSessionForDevice(remoteAddress) {
const { SessionCipher } = this;
const signalProtocolStore = this.storage;
diff --git a/js/signal_protocol_store.js b/js/signal_protocol_store.js
index d5b77b9d9..3b045afe5 100644
--- a/js/signal_protocol_store.js
+++ b/js/signal_protocol_store.js
@@ -379,11 +379,6 @@
const sessions = allSessions.filter(session => session.number === number);
return _.pluck(sessions, 'deviceId');
},
- async removeSession(encodedNumber) {
- window.log.info('deleting session for ', encodedNumber);
- delete this.sessions[encodedNumber];
- await window.Signal.Data.removeSessionById(encodedNumber);
- },
async removeAllSessions(number) {
if (number === null || number === undefined) {
throw new Error('Tried to remove sessions for undefined/null number');
diff --git a/libloki/api.js b/libloki/api.js
index 596807898..b4dc91d37 100644
--- a/libloki/api.js
+++ b/libloki/api.js
@@ -9,7 +9,6 @@
GROUP_SYNC_MESSAGES: 1,
CONTACT_SYNC_MESSAGES: 2,
FALLBACK_MESSAGES: 8,
- SESSION_MESSAGE_SENDING: 16,
SESSION_BACKGROUND_MESSAGE: 32,
GROUP_REQUEST_INFO: 64,
// If you add any new flag, be sure it is bitwise safe! (unique and 2 multiples)
@@ -24,12 +23,6 @@
}
};
- function logSessionMessageSending(...args) {
- if (debugFlags & DebugFlagsEnum.SESSION_MESSAGE_SENDING) {
- debugLogFn(...args);
- }
- }
-
function logGroupSync(...args) {
if (debugFlags & DebugFlagsEnum.GROUP_SYNC_MESSAGES) {
debugLogFn(...args);
@@ -119,7 +112,6 @@
const debug = {
logContactSync,
logGroupSync,
- logSessionMessageSending,
logBackgroundMessage,
logGroupRequestInfo,
};
diff --git a/libloki/test/index.html b/libloki/test/index.html
index dc6d74e2e..f18213d6f 100644
--- a/libloki/test/index.html
+++ b/libloki/test/index.html
@@ -23,7 +23,6 @@
-
diff --git a/libtextsecure/errors.js b/libtextsecure/errors.js
index fca487f0a..1b627c3ed 100644
--- a/libtextsecure/errors.js
+++ b/libtextsecure/errors.js
@@ -59,22 +59,6 @@
}
inherit(ReplayableError, OutgoingIdentityKeyError);
- function OutgoingMessageError(number, message, timestamp, httpError) {
- // eslint-disable-next-line prefer-destructuring
- this.number = number.split('.')[0];
-
- ReplayableError.call(this, {
- name: 'OutgoingMessageError',
- message: httpError ? httpError.message : 'no http error',
- });
-
- if (httpError) {
- this.code = httpError.code;
- appendStack(this, httpError);
- }
- }
- inherit(ReplayableError, OutgoingMessageError);
-
function SendMessageNetworkError(number, jsonData, httpError) {
this.number = number;
this.code = httpError.code;
@@ -119,21 +103,6 @@
}
inherit(ReplayableError, EmptySwarmError);
- function PoWError(number, error) {
- // eslint-disable-next-line prefer-destructuring
- this.number = number.split('.')[0];
-
- ReplayableError.call(this, {
- name: 'PoWError',
- message: 'Failed to calculate PoW',
- });
-
- if (error) {
- appendStack(this, error);
- }
- }
- inherit(ReplayableError, PoWError);
-
function DNSResolutionError(message) {
// eslint-disable-next-line prefer-destructuring
@@ -261,10 +230,8 @@
window.textsecure.IncomingIdentityKeyError = IncomingIdentityKeyError;
window.textsecure.OutgoingIdentityKeyError = OutgoingIdentityKeyError;
window.textsecure.ReplayableError = ReplayableError;
- window.textsecure.OutgoingMessageError = OutgoingMessageError;
window.textsecure.MessageError = MessageError;
window.textsecure.SignedPreKeyRotationError = SignedPreKeyRotationError;
- window.textsecure.PoWError = PoWError;
window.textsecure.EmptySwarmError = EmptySwarmError;
window.textsecure.SeedNodeError = SeedNodeError;
window.textsecure.DNSResolutionError = DNSResolutionError;
diff --git a/libtextsecure/index.d.ts b/libtextsecure/index.d.ts
index 9690838b8..191adf711 100644
--- a/libtextsecure/index.d.ts
+++ b/libtextsecure/index.d.ts
@@ -8,10 +8,8 @@ export interface LibTextsecure {
IncomingIdentityKeyError: any;
OutgoingIdentityKeyError: any;
ReplayableError: any;
- OutgoingMessageError: any;
MessageError: any;
SignedPreKeyRotationError: any;
- PoWError: any;
EmptySwarmError: any;
SeedNodeError: any;
DNSResolutionError: any;
diff --git a/libtextsecure/outgoing_message.js b/libtextsecure/outgoing_message.js
index 0dd3ed43a..7f159dee3 100644
--- a/libtextsecure/outgoing_message.js
+++ b/libtextsecure/outgoing_message.js
@@ -580,18 +580,6 @@ OutgoingMessage.prototype = {
this.sendSessionMessage(outgoingObjects);
},
- removeDeviceIdsForNumber(number, deviceIdsToRemove) {
- let promise = Promise.resolve();
- // eslint-disable-next-line no-restricted-syntax, guard-for-in
- for (const j in deviceIdsToRemove) {
- promise = promise.then(() => {
- const encodedNumber = `${number}.${deviceIdsToRemove[j]}`;
- return textsecure.storage.protocol.removeSession(encodedNumber);
- });
- }
- return promise;
- },
-
sendToNumber(number, multiDevice = true) {
return this.reloadDevicesAndSend(number, multiDevice).catch(error => {
if (error.message === 'Identity key changed') {
diff --git a/ts/test/types/Conversation_test.ts b/ts/test/types/Conversation_test.ts
index a220f52bb..def8453d8 100644
--- a/ts/test/types/Conversation_test.ts
+++ b/ts/test/types/Conversation_test.ts
@@ -1,11 +1,7 @@
import { assert } from 'chai';
import * as Conversation from '../../types/Conversation';
-import {
- IncomingMessage,
- OutgoingMessage,
- VerifiedChangeMessage,
-} from '../../types/Message';
+import { IncomingMessage, VerifiedChangeMessage } from '../../types/Message';
describe('Conversation', () => {
describe('createLastMessageUpdate', () => {
@@ -31,7 +27,7 @@ describe('Conversation', () => {
conversationId: 'foo',
sent_at: 666,
timestamp: 666,
- } as OutgoingMessage,
+ } as any,
lastMessageNotificationText: 'New outgoing message',
};
const expected = {
diff --git a/ts/types/Message.ts b/ts/types/Message.ts
index db77b5bad..798c86dfe 100644
--- a/ts/types/Message.ts
+++ b/ts/types/Message.ts
@@ -3,7 +3,7 @@ import { Contact } from './Contact';
import { IndexableBoolean, IndexablePresence } from './IndexedDB';
export type Message = UserMessage | VerifiedChangeMessage;
-export type UserMessage = IncomingMessage | OutgoingMessage;
+export type UserMessage = IncomingMessage;
export type IncomingMessage = Readonly<
{
@@ -27,32 +27,6 @@ export type IncomingMessage = Readonly<
ExpirationTimerUpdate
>;
-export type OutgoingMessage = Readonly<
- {
- type: 'outgoing';
-
- // Required
- attachments: Array;
- delivered: number;
- delivered_to: Array;
- destination: string; // PhoneNumber
- expirationStartTimestamp: number;
- id: string;
- received_at: number;
- sent: boolean;
- sent_to: Array; // Array
-
- // Optional
- body?: string;
- expires_at?: number;
- expireTimer?: number;
- recipients?: Array; // Array
- synced: boolean;
- } & SharedMessageProperties &
- MessageSchemaVersion5 &
- ExpirationTimerUpdate
->;
-
export type VerifiedChangeMessage = Readonly<
{
type: 'verified-change';
@@ -92,7 +66,7 @@ type MessageSchemaVersion6 = Partial<
>;
export const isUserMessage = (message: Message): message is UserMessage =>
- message.type === 'incoming' || message.type === 'outgoing';
+ message.type === 'incoming';
export const hasExpiration = (message: Message): boolean => {
if (!isUserMessage(message)) {