Commit Graph

20 Commits (5d863418ea3f7149853fd919f04bd7ea1beaa3f3)

Author SHA1 Message Date
Michael Kirk 5d863418ea Narrow the scope of code run on SessionCipher queue
And run all non-cipher code on the main thread.

Note: Running encryption on the sessionCipher queue is more about
serializing access to session mutations than it is about any performance
gains.

// FREEBIE
9 years ago
Michael Kirk 3216fd3714 Prevent session corruption by using same queue for encrypt vs. decrypt
// FREEBIE
9 years ago
Matthew Chen 2a55075e6c Add stub for analytics.
// FREEBIE
9 years ago
Matthew Chen c22085c1ab Add class to track app version.
// FREEBIE
9 years ago
Matthew Chen cc78978be5 Update fronting to use country-specific Google domains.
// FREEBIE
9 years ago
Matthew Chen 566c6e15d1 Add asserts header.
// FREEBIE
9 years ago
Michael Kirk 4c2a062fb4 provide custom copy for unauthorized messages
This happens when someone has registered their number on another device.

// FREEBIE
9 years ago
Michael Kirk 47cad611e5 Fix register w/o background fetch & stale push tokens
* Separate account registration from push token registration
* Provide better errors when validation fails (e.g. numbers don't match, numbers blank)
* More logging during registration
* Call success after setting phone number to avoid any future race condition

  This isn't currently causing problems, but it's unexpected that we'd
  mutate the state *after* calling a callback which might inuitively rely
  on that state.

* Don't throw exception off thread when device keys 404's
* Better async startup handling
  - move processing off main thread
  - reduce code duplication
  - don't wrap it in a transaction in the future case where we want to
    further access the DB

// FREEBIE
9 years ago
Michael Kirk b6676fb029 Better error messages when failure to send due to:
- no internet
- unregistered recipient

// FREEBIE
9 years ago
Michael Kirk 31bd1d07a3 Handle group keychange error (#50)
// FREEBIE
9 years ago
Michael Kirk 4ba1e86ec1 Explain send failures for text and media messages
Motivation
----------
We were often swallowing errors or yielding generic errors when it would
be better to provide specific errors.

We also didn't create an attachment when attachments failed to send,
making it impossible to show the user what was happening with an
in-progress or failed attachment.

Primary Changes
---------------
- Funnel all message sending through MessageSender, and remove message sending
  from MessagesManager.
  - Record most recent sending error so we can expose it in the UI
  - Can resend attachments.
  - Update message status for attachments, just like text messages
- Extracted UploadingService from MessagesManager
  - Saving attachment stream before uploading gives uniform API for send vs.
    resend
  - update status for downloading transcript attachments
- TSAttachments have a local id, separate from the server allocated id
  This allows us to save the attachment before the allocation request. Which is
  is good because:
  1. can show feedback to user faster.
  2. allows us to show an error when allocation fails.

Code Cleanup
------------
- Replaced a lot of global singleton access with injected dependencies to make
  for easier testing.
- Never save group meta messages. Rather than checking before (hopefully) every
  save, do it in the save method.
- Don't use callbacks for sync code.
- Handle errors on writing attachment data
- Fix old long broken tests that weren't even running. =(
- Removed dead code
- Use constants vs define
- Port flaky travis fixes from Signal-iOS

// FREEBIE
9 years ago
Ronny 556dca6502 Check return value of malloc
fixes #27

//FREEBIE
9 years ago
Michael Kirk 8fed13f9bb Don't start expiration timer until message is sent.
Started extracting a MessageSender class from TSMessagesManager+send for
easier testability and in hopes of further slimming down that son of a
gun.

// FREEBIE
9 years ago
Michael Kirk c1ade86a8b New fingerprint format
In coordination with Desktop and Android, iOS will be using all-numeric
fingerprints, aka "Safety Numbers".

Furthermore, the concept of verifying one identity and then the other
has been removed. Instead we ask users to exchange a single number, or
scan a single QR code. These credentials are built by combining the
users identities.

// FREEBIE
9 years ago
Michael Kirk 1df99c5812 fix voice messages for iOS
// FREEBIE
9 years ago
Michael Kirk c39e8b0bc6 extract constant for image/png
// FREEBIE
9 years ago
Michael Kirk a99fde4d3b Device manager
// FREEBIE
9 years ago
Michael Kirk 98d1c59bfc Sync Contacts with Desktop
* TODO refactor attachment sending to work without thread/message
* TODO de-dupe attachment pointer building code

// FREEBIE
9 years ago
Michael Kirk c1a0b88232 Don't crash when contact lookup is given nil contact
// FREEBIE
9 years ago
Frederic Jacobs 5d91a5bd4f Init Commit 10 years ago