Commit Graph

646 Commits (7ec377950c16c703c845e86a259b2254d8bc8d0c)

Author SHA1 Message Date
lilia 029c9754f0 Fix tests 11 years ago
lilia 5a7ab54ee6 Fix registration page
Also make it accessible by providing a mode argument to the install
function. Previously developers could just edit the url but we no longer
have the address bar as an app window, so now they must close the
default installer and run the following from the background page
console: `extension.install('standalone')`.

In the production build, this should result in an error since it is not
supported / the register page is not included there.
11 years ago
lilia 7afd0a02e8 Convert beforeunload listeners 11 years ago
lilia 002ff45312 Adapt window management to chrome app window api
Appify tabs, windows, browserAction

Port the extension.windows.focus function to new window api and
generalize its error handling in the case where the requested window
does not exist. An error will be passed to the callback.

Port extension.browserAction and rename it to the more generic
extension.onLaunched.

Use of the id option when opening a window ensures that attempting to
open a duplicate window merely focuses the existing window.

Finally, after registration, close the options window and open the
inbox.

Port extension.remove
11 years ago
lilia ddbaf87741 Load notifications script from background page 11 years ago
lilia f90f6328dd Don't resolve the background page til storage is ready 11 years ago
lilia 704c6ce779 Signaling key is now an array buffer 11 years ago
lilia 3f37cd21a9 Remove remaining traces of localStorage
Add window.storage to the background page, which loads all data from the
'items' store in indexeddb, caching them in memory for synchronous
access, then override textsecure storage to use that in memory store.
11 years ago
lilia a3c5b0959f Port textsecure.storage.impl to indexeddb 11 years ago
lilia d230df5622 Move local identitykey and registrationid to indexeddb 11 years ago
lilia fe1d78b5fa Load protobufs asynchronously. Fixes #223 11 years ago
lilia b8c5bc293c App windows cannot be refreshed 11 years ago
lilia 76e170686a Make getBackground async 11 years ago
lilia 7799bef86c Tweak key conflict error messages
Be generic, because sometimes it's not TextSecure, but Signal.
11 years ago
lilia 915612114b Remove general get/put/remove methods from AxolotlStore 11 years ago
lilia d0e262d7cb AxolotlStore stores groups in indexeddb 11 years ago
lilia 359b4a15a2 Move group storage to axolotl store
Add async get/put/removeGroup to axolotl store and let libtextsecure
use it for group state storage.
11 years ago
lilia 748f32022a Fix up refreshGroup 11 years ago
lilia f774047935 Make libtextsecure group storage asynchronous 11 years ago
lilia c26c6fc317 Store sessions by encodedNumber
Storing multiple sessions in a single indexeddb record is prone to
clobbering data due to races between requests to update multiple device
sessions for the same number, since you have to read the current state
of the device->session map and update it. Splitting the records up makes
it so that those updates can be made in parallel. Selecting all the
sessions for a given number can still be done efficiently thanks to
indexeddb range queries.
11 years ago
lilia 37c496f4f0 Close the provisioning socket 11 years ago
lilia 43d6efcd9e Don't save device objects to disk
Generate them from session and identity data. Save/delete pending prekey
data in an in-memory store and attach it to outgoing device objects.
11 years ago
lilia f18795a253 Add removeSession 11 years ago
lilia f413f03a6b Add getDeviceIds to axolotlstore
And add tests for getDeviceIds and removeAllSessions
11 years ago
lilia 121671c99f Store identity keys in indexeddb
Let device storage request them from axolotl store rather than storing a
copy.
11 years ago
lilia 7eda48f755 Move Session Storage to indexedDB 11 years ago
lilia 20ebc3f890 Move identity key storage functions to axolotl store 11 years ago
lilia f38b18ef63 Move Session storage to axolotlstore 11 years ago
lilia 9de1572ba6 Convert all storage.devices methods to be asynchronous 11 years ago
lilia 71715c95bc Async remove identity 11 years ago
lilia 26f1aa4db5 Async putSessionsForDevice 11 years ago
lilia 666f6baaca Async getSessionsForNumber 11 years ago
lilia 9e7d8c0a08 Rename textsecure.api and make it internal-only 11 years ago
lilia 45a61780af Fixup refreshPreKeys and call it whenever a prekey is deleted 11 years ago
lilia 7d0aeac8cb Use a worker to facilitate key generation 11 years ago
lilia f465bdddbf Add textsecure.AccountManager
This class should be used for account registration and for refreshing
prekeys for your account.
11 years ago
lilia a960acacc6 Add textsecure.refreshKeys
This helper checks the server for the number of remaining prekeys, then
generates more if there are fewer than 10 remaining.

// FREEBIE
11 years ago
lilia 96eafc7750 Integrate libaxolotl async storage changes
* Session records are now opaque strings, so treat them that way:
  - no more cross checking identity key and session records
  - Move hasOpenSession to axolotl wrapper
  - Remote registration ids must be fetched async'ly via protocol wrapper
* Implement async AxolotlStore using textsecure.storage
* Add some db stores and move prekeys and signed keys to indexeddb
* Add storage tests
* Rename identityKey storage key from libaxolotl25519KeyidentityKey to
  simply identityKey, since it's no longer hardcoded in libaxolotl
* Rework registration and key-generation, keeping logic in libtextsecure
  and rendering in options.js.
* Remove key_worker since workers are handled at the libaxolotl level
  now
11 years ago
lilia 8304aa903a Update libaxololt to a087b9e746e67995f16e077183cc0 11 years ago
lilia 2ff954d2f8 Fix api.js 11 years ago
lilia cc6a44f35d Fix tests 11 years ago
lilia da34b8e0f8 Rename textsecure.websocket and make it internal-only 11 years ago
lilia 89c24cd2fa Move throwHumanError to api.js
It is only used there.
11 years ago
lilia 36b1e87214 Add textsecure.MessageReceiver
Encapsulate the websocket resources and socket setup process in a
friendly OO class. The MessageReceiver constructor expects an instance
of EventTarget on which to fire message events asynchronously. The
provider of the EventTarget can then add/remove listeners as desired.
11 years ago
lilia bf2bf4cfd9 Remove redirect to index from registration.done() 11 years ago
lilia 6f3de68834 Move browserAction call 11 years ago
lilia 37e09da1cc Remove unsued argument from getDeviceObject
Last usage of the `returnIdentityKey` argument was removed in 8b9a16852.
11 years ago
lilia bdecf5cc44 Generate key_worker.js
Instead of calling importScripts, which is prone to relative path
issues, generate the worker script with everything it needs included.
11 years ago
lilia 7af42a27c5 Fix registerKeys using array indices for key ids
preKeys is an array whose indices may or may not be keyId-based. Since
we have an inline keyId property, use that instead.
11 years ago
lilia 00989962d8 Rename worker script file 11 years ago