Commit Graph

115 Commits

Author SHA1 Message Date
Matthew Chen
c22085c1ab Add class to track app version.
// FREEBIE
2017-01-06 13:21:20 -05:00
Matthew Chen
19e4b2c3a2 Revert "Remove Iran from censorship circumvention. Current approach isn't sufficient."
This reverts commit 374b45146d.
2017-01-06 13:10:18 -05:00
Matthew Chen
374b45146d Remove Iran from censorship circumvention. Current approach isn't sufficient.
// FREEBIE
2017-01-06 13:08:00 -05:00
Matthew Chen
f470979434 Add asserts to .pch.
// FREEBIE
2017-01-04 15:15:29 -05:00
Matthew Chen
5b87af9bc6 Respond to CR, fix build break.
// FREEBIE
2017-01-04 14:16:12 -05:00
Matthew Chen
c3af5bc742 Fix the UAE Google domain.
// FREEBIE
2017-01-04 14:16:06 -05:00
Matthew Chen
cc78978be5 Update fronting to use country-specific Google domains.
// FREEBIE
2017-01-04 14:16:02 -05:00
Matthew Chen
566c6e15d1 Add asserts header.
// FREEBIE
2017-01-04 14:15:56 -05:00
Matthew Chen
2438bd16c5 Add Iran, Oman, Cuba to censorship list.
// FREEBIE
2017-01-04 14:15:14 -05:00
Matthew Chen
52762a1be9 Clean up.
// FREEBIE
2017-01-04 15:22:15 +01:00
Michael Kirk
78515377b1 Censorship circumvention in Egypt and UAE
* domain fronting
* non-websocket message fetching
* alternate pinning policy for google hosted reflector server

// FREEBIE
2016-12-21 09:56:48 -06:00
Michael Kirk
b1ebfa9873 Revert "WIP: Censorship circumvention in Egypt and UAE"
This reverts commit f1ade83c3f.

No quite ready yet.
2016-12-20 17:24:50 -06:00
Michael Kirk
f1ade83c3f WIP: Censorship circumvention in Egypt and UAE
* non-websocket message fetching

// FREEBIE
2016-12-20 17:23:44 -06:00
Michael Kirk
5ccbd4ca6d Bail if we can't build a database.
* Something is irrecoverably wrong at this point.
* Constantize error names

// FREEBIE
2016-12-16 14:49:39 -06:00
Sam Vevang
f8bb46c46c check for errors in the keychain password retrieval
// FREEBIE
2016-12-16 14:32:30 -06:00
Michael Kirk
3eeb6c55d3 Use correct recipient ID when using sync message even if no contact
thread with self exists.

// FREEBIE
2016-12-16 09:55:58 -06:00
Michael Kirk
4c2a062fb4 provide custom copy for unauthorized messages
This happens when someone has registered their number on another device.

// FREEBIE
2016-12-15 22:56:38 -06:00
Michael Kirk
edebd14d42 Ignore messages with unknown Envelope.Contents
// FREEBIE
2016-12-09 08:45:20 -05:00
Michael Kirk
745a5a2769 return immutable identifiers
// FREEBIE
2016-12-03 19:33:26 -05:00
Michael Kirk
7036c63392 Compatible with libphonenumber 0.9.1
// FREEBIE
2016-12-02 19:13:34 -05:00
Russ Shanahan
7125028159 Rename an OWSContactsManager method
From nameStringForPhoneIdentifier
  To displayNameForPhoneIdentifier

* Add nullability descriptions

* Fix the mock object to adhere to new nullability rules

// FREEBIE
2016-12-02 18:48:29 -05:00
Russ Shanahan
34ffce89f5 Only calculate fullName once, & sortable fullnames (#67)
1. Adds caching of the calculated fullName value
   (which will slightly improve performance)
2. Incorporates fullNames that respect the first-name-first
   rules of the currently unmerged PR #22
3. Adds two new fullName properties that can be used
   for sorting comparators
4. Move the comparator into the model object for easy testing

Includes tests to ensure that the first name first and last name
first sorts are behaving as expected.

// FREEBIE
2016-11-29 10:02:46 -05:00
Michael Kirk
3083e2929c OWSContact from CNContact
Used in new contact picker for the Signal invite flow 

* populate emails
* nullability annotations

// FREEBIE
2016-11-26 12:29:02 -05:00
Michael Kirk
df756423f2 Ignore unknown group messages
otherwise when (e.g.) android adds a new group type they'll be shown as
empty bubbles.

// FREEBIE
2016-11-22 12:14:39 -05:00
Michael Kirk
1ba082356a Explicitly include newlines in numeric fingerprint
More straight forward than fudging / verifying different layout widths.

// FREEBIE
2016-11-14 17:38:26 -05:00
Michael Kirk
e53422f765 Configurable safety number blocking enabled by default
// FREEBIE
2016-11-14 14:15:43 -05:00
Michael Kirk
60a39f93c6 Remove phone numbers from scannable QR Code
Initially they were there to offer richer error messages when the wrong
code was scanned.

However, we found that people were posting them publicly,
misunderstanding the QR codes to be a kind of personal identifier.

For one, this isn't useful because the QR codes, like safety numbers,
are unique *per* conversation. So they aren't useful in a generic sense.
And secondly this is bad because the QR code contains both parties phone
numbers.

// FREEBIE
2016-11-14 08:43:24 -05:00
Michael Kirk
70e536ca8f Privacy preferences for blocking identity change
// FREEBIE
2016-11-10 16:28:36 -05:00
Michael Kirk
725153307e Add some nullability annotations (#62)
* fix compiler warnings about info message initializers

// FREEBIE
2016-11-10 15:21:56 -05:00
Michael Kirk
b0343ee1d1 Only fetch PreKey once.
Previously we were retrying as if it might succeed, and running into
rate-limit errors.

Also, added a specific rate limit error message.

// FREEBIE
2016-11-10 09:59:07 -05:00
Michael Kirk
1ebb82f987 Contacts don't have safety numbers until they've exchanged keys.
// FREEBIE
2016-11-09 12:57:54 -05:00
Michael Kirk
2e06bb148f Send group message so long as at least one recipient is found
Previously we were haulting if even one recipient was unregistered.

// FREEBIE
2016-11-08 13:57:29 -05:00
Michael Kirk
ebeae2608d Fix crash on messaging unregistered user
// FREEBIE
2016-11-07 18:56:14 -05:00
Michael Kirk
027fa10730 Only dispatch async at top level.
Previously each method was dispatching it's callbacks async. This is a
waste of code, processing, and makes crash logs impenetrable.

// FREEBIE
2016-11-07 09:48:05 -05:00
Michael Kirk
b4c504f61d EndSessionMessage notifies remote side of reset session
Otherwise they'll send us messages we can't decrypt.

Also: Log and fail when message doesn't send due to no thread being specified.

// FREEBIE
2016-11-04 12:24:39 -04:00
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
2016-11-03 16:10:06 -04:00
Michael Kirk
03f05f217c Prevent session corruption
Mutating the session is not thread safe.

// FREEBIE
2016-11-02 10:46:42 -04:00
Michael Kirk
9c426e0a4b again: Don't send empty message to self after changing disappearing (#54)
timer

previously fixed in: 91fcd01632

But got lost in a rebase after moving TSMessagesManager+sendMessage to
OWSMessageSender.

// FREEBIE
2016-10-28 13:18:46 -04:00
Michael Kirk
b6676fb029 Better error messages when failure to send due to:
- no internet
- unregistered recipient

// FREEBIE
2016-10-25 09:55:46 -04:00
Michael Kirk
3e10a49258 Fix disappearing messages don't become consistent after reinstall (#52)
Fixes the bug wherein:

Given the sender had disappearing messages enabled
And the receiver thinks it's disabled (this can happen due to re-install)
When we receive a disappearing message
The message does start expiring timer and disappear
But you see a notice "<sender> disabled disappearing messages"
Rather than the expected "<Sender> set disappearing messages timer to X".

// FREEBIE
2016-10-24 15:24:06 -04:00
Michael Kirk
31bd1d07a3 Handle group keychange error (#50)
// FREEBIE
2016-10-24 13:54:00 -04:00
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
2016-10-24 09:36:51 -04:00
Matthew Douglass
d4c55d6940 Maps numbers to names in TSGroupModel
* Maps numbers to names in TSGroupModel

Use an injected ContactsManager to look up proper user names for phone numbers in [TSGroupModel getInfoStringAboutUpdateTo].
Fixes WhisperSystems/Signal-iOS#757

* Supports custom messages for TSOutgoingMessage

This will enable Signal-iOS to push detailed information about TSGroupModel updates through SignalServiceKit and into the TSInfoMessage created by TSMessagesManager+sendMessages

// FREEBIE
2016-10-17 10:15:50 -04:00
Ronny
556dca6502 Check return value of malloc
fixes #27

//FREEBIE
2016-10-15 13:47:58 -04:00
Michael Kirk
91fcd01632 Don't send empty message to self after changing disappearing timer
fixes #1393

// FREEBIE
2016-10-14 19:28:22 -04:00
Michael Kirk
a32a18ac67 Fix set timer updates in group thread.
// FREEBIE
2016-10-11 09:24:40 -04:00
Michael Kirk
23854dc72d Report info message type for timer duration changes
// FREEBIE
2016-10-11 09:24:40 -04:00
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
2016-10-11 09:24:40 -04:00
Michael Kirk
0b4d81002f Fix attachment deleting for outgoing messages
Broken in the disappearing messages beta due to sloppy refactoring. =(

// FREEBIE
2016-10-11 09:24:40 -04:00
Michael Kirk
34868b9b0f fix captions in groups and sync messages (#42)
* Fix incoming group caption for groups.
* sync message transcript captions are expired

// FREEBIE
2016-10-11 09:24:40 -04:00