diff --git a/Gruntfile.js b/Gruntfile.js index d09285c67..a3b1251af 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -75,7 +75,6 @@ module.exports = grunt => { src: [ 'libtextsecure/errors.js', 'libtextsecure/libsignal-protocol.js', - 'libtextsecure/protocol_wrapper.js', 'libtextsecure/crypto.js', 'libtextsecure/storage.js', 'libtextsecure/storage/user.js', diff --git a/background.html b/background.html index 4a873f3a5..d865a59f6 100644 --- a/background.html +++ b/background.html @@ -132,7 +132,6 @@ - diff --git a/background_test.html b/background_test.html index 599b6200c..63c232333 100644 --- a/background_test.html +++ b/background_test.html @@ -136,7 +136,6 @@ - diff --git a/js/signal_protocol_store.js b/js/signal_protocol_store.js deleted file mode 100644 index ed0545927..000000000 --- a/js/signal_protocol_store.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - global - Backbone, - _, - BlockedNumberController -*/ - -/* eslint-disable no-proto */ - -// eslint-disable-next-line func-names -(function() { - 'use strict'; - - function SignalProtocolStore() {} - - SignalProtocolStore.prototype = { - constructor: SignalProtocolStore, - async removeAllData() { - await window.Signal.Data.removeAll(); - - window.storage.reset(); - await window.storage.fetch(); - - window.getConversationController().reset(); - BlockedNumberController.reset(); - await window.getConversationController().load(); - await BlockedNumberController.load(); - }, - }; - _.extend(SignalProtocolStore.prototype, Backbone.Events); - - window.SignalProtocolStore = SignalProtocolStore; -})(); diff --git a/libloki/test/index.html b/libloki/test/index.html index f91e323a6..e1c72704c 100644 --- a/libloki/test/index.html +++ b/libloki/test/index.html @@ -19,7 +19,6 @@ - diff --git a/libtextsecure/protocol_wrapper.js b/libtextsecure/protocol_wrapper.js deleted file mode 100644 index 73391ae4e..000000000 --- a/libtextsecure/protocol_wrapper.js +++ /dev/null @@ -1,8 +0,0 @@ -/* global window, textsecure, SignalProtocolStore */ - -// eslint-disable-next-line func-names -(function() { - window.textsecure = window.textsecure || {}; - window.textsecure.storage = window.textsecure.storage || {}; - textsecure.storage.protocol = new SignalProtocolStore(); -})(); diff --git a/libtextsecure/test/index.html b/libtextsecure/test/index.html index 3477b0328..32b53b28a 100644 --- a/libtextsecure/test/index.html +++ b/libtextsecure/test/index.html @@ -21,7 +21,6 @@ - diff --git a/libtextsecure/test/protocol_test.js b/libtextsecure/test/protocol_test.js deleted file mode 100644 index aad806caf..000000000 --- a/libtextsecure/test/protocol_test.js +++ /dev/null @@ -1,37 +0,0 @@ -/* global textsecure */ - -describe('Protocol', () => { - describe('Unencrypted PushMessageProto "decrypt"', () => { - // exclusive - it('works', done => { - localStorage.clear(); - - const textMessage = new textsecure.protobuf.DataMessage(); - textMessage.body = 'Hi Mom'; - const serverMessage = { - type: 4, // unencrypted - source: '+19999999999', - timestamp: 42, - message: textMessage.encode(), - }; - - return textsecure.protocol_wrapper - .handleEncryptedMessage( - serverMessage.source, - serverMessage.source_device, - serverMessage.type, - serverMessage.message - ) - .then(message => { - assert.equal(message.body, textMessage.body); - assert.equal( - message.attachments.length, - textMessage.attachments.length - ); - assert.equal(textMessage.attachments.length, 0); - }) - .then(done) - .catch(done); - }); - }); -}); diff --git a/test/backup_test.js b/test/backup_test.js index 8d15a14cc..c0660a4e9 100644 --- a/test/backup_test.js +++ b/test/backup_test.js @@ -288,7 +288,15 @@ describe('Backup', () => { } async function clearAllData() { - await textsecure.storage.protocol.removeAllData(); + await window.Signal.Data.removeAll(); + + window.storage.reset(); + await window.storage.fetch(); + + window.getConversationController().reset(); + window.BlockedNumberController.reset(); + await window.getConversationController().load(); + await window.BlockedNumberController.load(); await fse.emptyDir(attachmentsPath); } diff --git a/test/index.html b/test/index.html index 455d9e871..83d54ad1d 100644 --- a/test/index.html +++ b/test/index.html @@ -175,7 +175,6 @@ -