Commit Graph

58 Commits (3e8b34f3d09818ff6c18d096bbea2e26a3f96855)

Author SHA1 Message Date
lilia 0c5a69cce4 Add support for getProfile to TextSecureServer
// FREEBIE
8 years ago
lilia 611bbaef35 Don't hardcode the attachment server url
There may come a day when we may need to change this url from the server
side. On that day, clients should continue to operate normally. The
service should be able to change attachment server locations without
requiring a client update.

// FREEBIE
8 years ago
lilia f1a1a819ba Stop parsing attachment ids from attachment urls
See 2111294

Attachment ids are now available in string form from the server
response to `putAttachment`.

// FREEBIE
8 years ago
lilia 37ad742ccf Support for server endpoint to set signed key 8 years ago
lilia 819ba8ee74 Support for undefined preKey 8 years ago
lilia 2b210b3fcd Fix undefined websocket port
Fixes #889

// FREEBIE
9 years ago
lilia 384598fbcc Log websocket urls
// FREEBIE
9 years ago
lilia 0487fa3cd1 Add server fallback port 8443
// FREEBIE
9 years ago
lilia 84235ef58e Use forEach instead of loop
// FREEBIE
9 years ago
lilia 5f07c74f1a Add log statement when opening provisioning socket
Make it more obvious via logs which server someone is attempting to
register with (i.e., to disambiguate staging from prod).

// FREEBIE
9 years ago
lilia d4760452d1 Add signal agent to server requests
// FREEBIE
9 years ago
lilia ea980b4385 Don't surface invalid attachment urls to the user
Log them, but don't put display them in user-facing error ui.

// FREEBIE
9 years ago
lilia 7b1268e5f7 Log incoming invalid attachment urls also
Same as previous commit but for incoming.

// FREEBIE
9 years ago
lilia fe7505c050 Log invalid attachment urls
// FREEBIE
9 years ago
lilia 9c59dfda93 Remove duplicate case statement
This line was never being hit due to the duplicate one above (#L166).
Peeking at the server code shows that 403 is only given in response to
registration attempts, where it does in fact indicate an invalid code.

// FREEBIE
10 years ago
lilia acae4afce3 Handle invalid responses better
Depending on the response code, returning an HTTPError here will let us
retry later, if appropriate.

// FREEBIE
10 years ago
lilia 61439a886f Validate json responses
Perform lightweight validation on json responses from the server. Ensure
that the attributes we depend on have the right type.

// FREEBIE
10 years ago
lilia b0d4370c2c Remove unused variable
// FREEBIE
10 years ago
lilia 7b6820d2ac Refactor messageSender/OutgoingMessage
Move encrypt and transmit to OutgoingMessage
Restore per-number queueing to messageSender

// FREEBIE
10 years ago
lilia 4cc6b1ff9a Validate attachment urls
// FREEBIE
10 years ago
codedust 5e255e9df0 Remove 'Textsecure' from error message in api.js 10 years ago
lilia f863616785 Remove api TODO comments
// FREEBIE
10 years ago
lilia 81ebc5ffd7 Improve stack traces on HTTPErrors
Save stack even earlier, outside the promise.

// FREEBIE
10 years ago
lilia c062fe3060 Automatically retry failed http requests
If we failed to reach the server, wait a second and try again up to 3
times.

// FREEBIE
10 years ago
lilia 816a206892 Refactor sendMessageToDevices
Split into separate encrypt and transmit functions. Let the encryption
function also handle all wire formatting (ie, jsonification and base64
encoding), which simplifes TextSecureServer.sendMessages, removes a
TODO, and lets us save fewer params to make network errors replayable.

// FREEBIE
10 years ago
lilia e9bc39bc56 Add parens and line breaks
// FREEBIE
10 years ago
lilia 868695558d Throw on bad server url
// FREEBIE
10 years ago
lilia 98aa5156b0 Refactor TextSecureServer for storage
Following the pattern from previous commit, let the server class accept
a url and login credentials from the caller. Then integrate into
MessageReceiver and AccountManager.

// FREEBIE
10 years ago
lilia 37ff3cf5a8 Change http logging
Printing method + url again makes it easier to match requests to
responses when scanning logs.

// FREEBIE
10 years ago
lilia f70e844cef Include url in http response logging
Otherwise it's impossible to tell which is which, especially when
sending group messages.

// FREEBIE
10 years ago
lilia e59a5792d5 Don't hardcode the attachment host 10 years ago
lilia 184e37383c Don't auto-populate the relay field
According to server api docs, relay is optional when it is the same as
our own server.

// FREEBIE
10 years ago
lilia 537f0ceef0 Log all http requests at start and end
// FREEBIE
10 years ago
lilia 04c8796bd3 Disable socket level reconnect
This is now handled at a higher level by the message receiver with the
aid of http requests for diagnosing the disconnect.

// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
lilia 0d0bdbf998 Don't auto-reconnect provisioning socket
// FREEBIE
10 years ago
lilia 15cd348bf2 Remove nonexistant variable 10 years ago
lilia 1f8856fa69 MessageReceiver accepts a server websocket url
// FREEBIE
10 years ago
lilia b40a8696b7 DRY up Promise creation in api.js
Since calls to ajax() are always wrapped in promises, we can internalize
that pattern in the ajax function itself.

// FREEBIE
10 years ago
lilia 3711e0a6cd Convert throwHumanError to custom error type
Now with 200% more helpful stack traces.

// FREEBIE
10 years ago
lilia f126e3b21b Work on auth error handling / reinstall 10 years ago
lilia f32ff58953 Add support for device name 10 years ago
lilia 228ffe901d Update json formatting for legacy message requests
Legacy DataMessages are sent using the `body` field, new Content
messages are sent using the `content` field.

// FREEBIE
10 years ago
lilia 9e7d8c0a08 Rename textsecure.api and make it internal-only 10 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
10 years ago
lilia 2ff954d2f8 Fix api.js 10 years ago
lilia da34b8e0f8 Rename textsecure.websocket and make it internal-only 10 years ago
lilia 89c24cd2fa Move throwHumanError to api.js
It is only used there.
10 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.
10 years ago
Matt Corallo 00cb420d37 Merge (un)encrypted storage layers 10 years ago