Commit Graph

54 Commits

Author SHA1 Message Date
Matthew Chen
715e9e85ff Respond to CR.
// FREEBIE
2017-04-13 15:36:59 -04:00
Matthew Chen
00f1b53e61 Reduce usage of contacts intersection endpoint.
// FREEBIE
2017-04-13 15:28:45 -04:00
Michael Kirk
edc556b106 Fix multiple match for SignalRecipient
when searching for contacts by phone number

// FREEBIE
2017-04-12 10:53:39 -04:00
Matthew Chen
17b751d22a Create block offer when non-contacts send you a message.
// FREEBIE
2017-04-12 08:38:46 -04:00
Matthew Chen
d89d4dea8a Remove the properties related to Redphone and WebRTC support.
// FREEBIE
2017-04-11 17:23:20 -04:00
Matthew Chen
e038d24103 Apply assert to ensure singletons are only created once.
// FREEBIE
2017-03-31 18:45:46 -04:00
Matthew Chen
d38f6fbfd1 Filter out country codes properly.
// FREEBIE
2017-03-26 15:12:19 -04:00
Matthew Chen
5846131976 Further refinements to phone number parsing.
// FREEBIE
2017-03-22 09:53:59 -04:00
Thomas Guillet
478b5b247a Remove convoluted dependency
of PhoneNumberUtil to ContactsManagerProtocol

Also moved tests from Signal-iOS repository here.
2017-03-20 15:11:11 -04:00
Matthew Chen
332833da7b Respond to CR.
// FREEBIE
2017-03-16 13:53:06 -03:00
Matthew Chen
60e0ddfb92 Fix non-contact lookup for non-US users.
// FREEBIE
2017-03-16 13:31:14 -03:00
Matthew Chen
e12bd4773a Fix non-contact lookup for non-US users.
// FREEBIE
2017-03-16 13:31:14 -03:00
Matthew Chen
d63a519c43 Fix filtering of country codes in registration flow.
// FREEBIE
2017-03-16 13:21:21 -03:00
Matthew Chen
686fe679bd Respond to CR.
// FREEBIE
2017-02-16 20:32:19 -05:00
Matthew Chen
7bd4d26532 Add “received at” timestamp to all TSMessages so that they may be sorted properly.
// FREEBIE
2017-02-15 18:04:37 -05:00
Matthew Chen
351a010fe0 Clean up prekey usage.
// FREEBIE
2017-02-14 13:39:52 -05:00
Michael Kirk
311d80fb2e Missed calls increment unread counter/badge
This affects:
- per-thread badge in the inbox view
- app badge when viewed from springboard.

// FREEBIE
2017-02-07 17:00:55 -05:00
Michael Kirk
7b1b706e2a Include reusable localized text in recipient-not-found error
This way we can use it for calls as well.

// FREEBIE
2017-02-01 19:16:07 -05:00
Michael Kirk
6521a80c44 Lookup methods yield SignalRecipient (#102)
Let's us remove some otherwise redundant code to look up the recipient
from their ID.

// FREEBIE
2017-01-27 13:06:49 -05:00
Matthew Chen
ffb199bcd1 Respond to CR.
// FREEBIE
2017-01-13 11:46:06 -05:00
Matthew Chen
08ba42c563 Update SignalRecipient with “is WebRTC enabled” property from service.
// FREEBIE
2017-01-13 09:43:08 -05:00
Michael Kirk
d1aa253f87 WebRTC calling
* Stun server request
* settable TextSecureEnv
* nullability annotations for TSCall
* Better debug logging for message sending
* fixup tests and expiration time

// FREEBIE
2017-01-11 17:15: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
1ebb82f987 Contacts don't have safety numbers until they've exchanged keys.
// FREEBIE
2016-11-09 12:57:54 -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
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
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
40cdc7f224 disappearing messages
* Support for disappearing messages
* update inbox thread preview when receiving message

// FREEBIE
2016-10-11 09:24:40 -04:00
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
2016-10-11 09:24:40 -04:00
Michael Kirk
2dba7d141a Fix contact/group sync messages. (#32)
Initially we don't have device messages for our remote device. We need to send the empty device list to get the updated list of remote devices.

Introduced lots of dependency injection to make MessagesManager more testable.

// FREEBIE
2016-09-23 16:55:56 -04:00
Michael Kirk
a0df56a68e Fix multiple keychange errors (#29)
* Don't attempt to send a message unless we've successfully built a deveice-messages
* Only process message exception when we're done with retries.

// FREEBIE
2016-09-19 21:57:20 -04:00
Michael Kirk
c8a5f50763 Fixup DevicesManager
* By providing a view extension for secondary devices we can use that in
  a view mapping to power our devices view controller, and avoid any race
  conditions with uncommitted transactions.

* Fix crash when you're not in your own contacts

* New device appears on top

* Don't show "edit" button unless there are devices, or rather, the helpers to do so.

* Fix glitchy refresh

  Saving unchanged records was causing the tableview to redraw, which was
  mostly invisible, except that if the refresh indicator were running, it
  would twitch.

// FREEBIE
2016-09-09 15:11:40 -04:00
Michael Kirk
580781e3e4 Incoming Read Receipts
// FREEBIE
2016-09-09 15:11:40 -04:00
Michael Kirk
a99fde4d3b Device manager
// FREEBIE
2016-09-09 15:11:40 -04:00
Michael Kirk
fe7171dd93 Sync messages with your other devices
After provisioning a desktop client, you'll see messages sent from your
phone appear on your desktop client, and messages sent from the desktop
client appear on your phone.

* In the process extracted some of the Attachment processing logic out
  of the giant MessagesManager.
* Some nullability annotations on affected files.

// FREEBIE
2016-09-02 12:28:58 -04:00
Michael Kirk
6ec21ade9b TSContactThread doesn't need to know protobufs
Just pass in the relay since that's the only thing we care about

// FREEBIE
2016-09-02 12:28:58 -04:00
Michael Kirk
c1a0b88232 Don't crash when contact lookup is given nil contact
// FREEBIE
2016-09-02 12:28:57 -04:00
Michael Kirk
1d0b645fc9 Update to new protocol (#23)
* new protobufs from libsignal-service-java@a1c93edc40e3ce201fa4e70339a3e6f4e197e319
* Makefile to build ObjC classes from *.proto
* refactored some touched code to minimize duplication
* removed unused protos
* deleted some dead code
* renamed method for clarity

// FREEBIE
2016-08-22 16:09:58 -04:00
Michael Kirk
0f9a3334c1 Ensure interactions removed when thread is deleted
In theory, this should have already been handled by the
YapDatabaseRelationship extension via edges.

However, in practice, there were situations (cause unknown) where
interactions would exist without an edge to their corresponding thread.

Rather than being clever with the edge/callback machinery, now threads
explicitly delete all their interactions, and interactions delete all
their attachments (when applicable).

Also, a class to clean up spurious interactions / attachments

In the process:
- refactored TSYapDatabaseObject init to specify designated initializer
- added some testing niceties to TSYapDatabaseObject

// FREEBIE
2016-07-31 08:49:01 -07:00
Michael Kirk
2858694ee0 style changes // fix compiler warnings
- log errors
- forward declare where possible
- clang-format
- remove inaccurate file headers
- include Pods in Example app build target to get SignalServiceKit warnings
- Fix those warnings!

// FREEBIE
2016-07-31 08:48:46 -07:00
Michael Kirk
d66c8bd427 Avoid deadlock while accepting new key (#17)
Using description in log output crashes when the description is a media
message, since printing media description uses a transaction within our
existing transaction.

Instead we'll use a simpler debugDescription for simple text building,
like logging.

// FREEBIE
2016-07-18 16:00:59 -07:00
Michael Kirk
f537b6f192 Fix (and test) description for corrupted attachments (#16)
// FREEBIE
2016-07-07 16:05:58 -07:00
Michael Kirk
80671b247f Extract phone formatting method (#14)
* refactor and backfill tests for phone number parsing
* bump version to 0.0.5
2016-06-28 10:22:36 -07:00