Commit Graph

137 Commits

Author SHA1 Message Date
Michael Kirk ddba843d44 Censorship circumvention in Egypt and UAE
* domain fronting
* non-websocket message fetching

// FREEBIE
2016-12-21 10:04:23 -06:00
Michael Kirk c4baf5a625 [SSK] Avoid bricking signal if a key is temporarily unreadable
// FREEBIE
2016-12-16 14:51:00 -06:00
Michael Kirk c3a22d7da6 [SSK] Fix contact sync when no thread to self exists
fixes #1497

// FREEBIE
2016-12-16 11:31:27 -06:00
Michael Kirk 32a05dabce [SPK] Update SignalProtocolKit (AxolotlKit) (#1549)
// FREEBIE
2016-12-16 08:47:24 -06:00
Michael Kirk e2d725a041 [SSK] Ignore messages with unknown Content
Most like it would indicate a new feature that this old client doesn't
understand. Otherwise we'd print an empty bubble.

// FREEBIE
2016-12-09 09:31:07 -05:00
Michael Kirk 753c445bfc [SSK] Update libphonenumber
// FREEBIE
2016-12-04 14:01:08 -05:00
Russ Shanahan e7126f8c60 Less confusing "#" avatar for unknown Contact instead of "+"
For consistency with the Android and Desktop client behavior.

* Show a placeholder avatar when no image, initials (#1512)

  If all we know about the user is their phone number, their avatar image
  is rendered as a placeholder. Previously, it would render the first few
  characters of their phone number as if they were initials (eg. "+")

* Rename, extend OWSContactsManager methods (#1512)

  Rename from: nameStringForPhoneIdentifier
           to: displayNameForPhoneIdentifier

  Also, add:
  - (BOOL)nameExistsForPhoneIdentifier:(NSString *)identifier;

  Which reports whether there's any "name" for a contact.

* Remove unused typedefs

  These aren't used in the project anymore, and they were causing
  compiling warnings due to a lack of nullability indication.

* Resolve some OWSContactsManager nullability warnings

  Did a pass through all of the existing nullability warnings in
  OWSContactsManager. Tried to pick descriptors that best reflected the
  behavior of the methods.

// FREEBIE
2016-12-04 14:01:07 -05:00
Russ Shanahan 81e1ec4b9e Compare both first and last names when sorting (#1487)
If two names have the same last name, ensure we fall back on the
first name when sorting them.

// FREEBIE
2016-11-30 15:01:27 -05:00
Josh Schneier 896dd026d2 Remove DJWActionSheet 2016-11-29 10:20:56 -05:00
Michael Kirk f30c733ef3 Custom contact picker for invite flow
Preferred to the system contact picker because:
1. removes "group" clutter from header, unlikely to be used much.
2. can select while searching
3. fixes unified contact problem where e.g.
   If only one of your contact has a phone number, they appear disabled
   when choosing to invite via messaging, even though the other linked
   contact *does* have a phone number.
4. label users w/o email so it's clearer why they can't be selected

Also:

* Twitter share-image was too tall

// FREEBIE
2016-11-26 14:43:42 -05:00
Michael Kirk 7120ca1192 Make sure we're laying out contact cell after assigning avatar
// FREEBIE
2016-11-22 16:55:07 -05:00
Michael Kirk 0aa226f3d1 [SSK] If a new message type is introduced, ignore it
rather than printing an empty bubble.

// FREEBIE
2016-11-22 12:18:05 -05:00
Michael Kirk de7752ab20 Revert 50abf4d02d
The real problem was addressed (or, worked around) here:
1eb234e8ba

// FREEBIE
2016-11-17 18:22:02 -05:00
Michael Kirk 9b2c03793c [SSK] explicit newlines in safety numbers
// FREEBIE
2016-11-14 17:40:51 -05:00
Michael Kirk ee29fff0da [SSK] Default to blocking changed Safety Numbers
// FREEBIE
2016-11-14 14:24:03 -05:00
Michael Kirk c5be8f2d88 Don't include phone number in scannable safety number QR code
also fixes #1455

// FREEBIE
2016-11-14 09:12:24 -05:00
Michael Kirk c2aa17e362 Changed Safety numbers no longer block communication
When your partner changes their identity key (e.g. by reinstalling),
you'll see a notice alongside their message, but it will no longer
prevent the message from showing. aka "non blocking".

Existing users will be opted into the previous blocking behavior.

This is configurable for all users in Settings > Privacy.

// FREEBIE
2016-11-11 09:13:38 -05:00
Michael Kirk 28a2a4610c Fix compiler warnings.
// FREEBIE
2016-11-11 08:54:13 -05:00
Michael Kirk 368db7e553 [SSK] Only need to fetch prekey once
Plus related rate limit translations

// FREEBIE
2016-11-10 10:47:49 -05:00
Michael Kirk 23c80748e6 Hide safety numbers until you've exchanged keys
// FREEBIE
2016-11-09 13:43:07 -05:00
Michael Kirk 1912fbde72 [SSK] Send group messages as long as one recipient is found
// FREEBIE
2016-11-08 15:20:57 -05:00
Michael Kirk c401f764ef [SSK] Fix crash on messaging unregistered user
// FREEBIE
2016-11-07 19:52:05 -05:00
Michael Kirk c6a2fbff23 Tapping corrupted message opens "session reset" activity
This action was previously hidden under a secret longpress gesture in
the fingerprint view controller.

Ideally we'd never receive corrupted messages, but at the point we do,
our sessions are out of whack, and the only recovery option is to reset.
Let's help our users do that.

* Resetting session sends END_SESSION message

  Otherwise the remote side wouldn't know we reset the session and will
  send us a message on the old ratchet.

* Don't reset their identity key when resetting sender ratchet.

* Updated translations

// FREEBIE
2016-11-04 14:57:37 -04:00
Michael Kirk 1dd06a5e6c Fix registration flow / Keep push tokens in sync
* Separate registering an account from registering for push notifications
  * Allows us to complete registration without prompting user for
    notification settings.

UX Changes
----------
* Automatically keep push tokens in sync on startup.
  Push tokens *can* change, though they rarely do. It happens more often
  for people switching between appstore/beta builds.

  fixes #1174

* Show alert with registration failure
  * add secret 8-tap debug log gesture to registration flow

* Move registration to separate flow
  * don't see flash of inbox when first launching

* show useful error messages when given wrong code / no code

* remove background fetch
  We werent using it, but only relying on a side effect of it which is
  no longer necessary.

Code Changes
------------

* More registration logging.

* Install PromiseKit with carthage

  Our dependencies are not yet framework compatible, so we can't use
  cocoapods.

* Merge preferences util "category" into superclass.

  The immediate reason for this is Swift interop was assuming optional
  types were not optional, and exploding when a value was nil.

  This is clearer anyway, since we were treating it like a subclass, and
  it was the only thing using the class anyway.

* auto-genstrings now searches *.swift (and *.h, which was previously
  broken) for translateable strings.

// FREEBIE
2016-11-03 16:13:49 -04:00
Michael Kirk cc8c8d61b4 [SSK] Update to prevent session corruption
// FREEBIE
2016-11-03 14:52:14 -04:00
Michael Kirk 50abf4d02d [JSQMVC] Fix crash on delete when under load.
Hack to fix https://github.com/jessesquires/JSQMessagesViewController/issues/1885

This doesn't happen often, but is reproducible under simulated message
churn (~50 insert/update/deletes randomly spaced over 10 seconds).

During performBatchUpdates, the collectionViewLayout can call
layoutAttributesForElementsInRect which can reference the just-deleted
item's
view. (The view presumably hasn't been deleted yet, but will be by the
time
performBatchUpdates is complete).

It's opaque how layoutAttributesForElementsInRect get's it's list of
views. I
can only speculate how this works based on debugging, but it seems that
the
CollectionFlowLayout keeps an internal list of item frames, which when
crashing
still contain items corresponding to the to-be-deleted items.

In any case, it seems like a bug that JSQMVC would ever attempt to get
layoutAttributes for an item which doesn't exist in the datasource.
2016-10-31 10:38:20 -04:00
Michael Kirk eded20f1f5 [SSK] Don't send empty message to self after changing disappearing timer
previously fixed in: SSK:91fcd01632a81f2aa67d2d94b97c68d519e6881a

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

// FREEBIE
2016-10-28 15:10:31 -04:00
Michael Kirk 66f0f8cc95 [SSK] Better error messages when failing to send
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 84e5606972 [SSK] Fix disappearing messages don't become consistent after reinstall
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-26 15:22:35 -04:00
Michael Kirk 689df1be37 Handle key change in group send
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 33f6a95520 Explain send failures for text and media messages
fixes #1231

Motivation
----------
Previously when messages failed to send, there was no reason given.
Furthermore, when media messages failed to send there was no indication
that any attempt to send the message even occurred, nor a retry
dialog.

UX Changes
----------
- Show "uploading" status for media
- Show specific error message in retry-send dialog
- Only scroll to bottom when new message is inserted
- Show specific errors when group creation fails

Code Changes
-----------
- Updated incorrect references to TSMessageAdapters which were actually
  references to OWSMessageData
- MessageSender was extracted from SSK MessagesManager
- access MessagesManager as property
- idiomatic init/properties for Env
- log contact intersections
- Move scroll-to-bottom animation to main thread.

// FREEBIE
2016-10-26 15:22:35 -04:00
Matthew Douglass 722c3a5e78 Create TSOutgoingMessage with info on group change
TSOutgoingMessage is created with details about the group changes so that we see more than just “Group Updated.”

* Customizes message for new group creation

  Replaces GROUP_UPDATED with GROUP_CREATED for a brand new group. Localized for English only.

* Updates to use fixed SignalServiceKit branch

// FREEBIE
2016-10-20 20:32:30 -04:00
Michael Kirk 802d2bfdff Revert "Create TSOutgoingMessage with info on group change"
Inadvertently stole credit for work done when squashing the commits.
Reverting and re-merging giving appropriate credit.

This reverts commit 8242c9e381.
2016-10-20 20:31:54 -04:00
Michael Kirk 8242c9e381 Create TSOutgoingMessage with info on group change
TSOutgoingMessage is created with details about the group changes so that we see more than just “Group Updated.”

* Customizes message for new group creation
  Replaces GROUP_UPDATED with GROUP_CREATED for a brand new group. Localized for English only.

* Updates to use fixed SignalServiceKit branch

// FREEBIE
2016-10-20 20:20:41 -04:00
Michael Kirk 89ee74f134 Update SSL to 1.0.2j (#1409)
// FREEBIE
2016-10-20 13:24:20 -04:00
Michael Kirk 49de772997 Fix slow reloading conversation view. (#1397)
Fix animation memory leak exacerbated every time you reload a
conversation with expiration timers.

Stop animation on cells that aren't currently being displayed. This is
relatively minor compared to the above, but still, no reason to waste
cycles.

// FREEBIE
2016-10-15 16:41:40 -04:00
Michael Kirk 50ce283582 Fix empty bubble when setting disappearing message timer in a thread to
yourself.

fixes #1393

// FREEBIE
2016-10-14 19:37:38 -04:00
Michael Kirk a04b351455 Fix set timer in group thread. (#1375)
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 85beb93e86 Style timer changes less alarmingly.
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk dc95d328cb Don't expire messages until they are sent.
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk c0f37f8123 Fix sync messages expirations in SSK
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk ee0cce75e8 Disappearing Messages
* Per thread settings menu accessed by tapping on thread title

  This removed the toggle-phone behavior. You'll be able to see the phone
  number in the settings table view.

  This removed the "add contact" functionality, although it was already
  broken for ios>=9 (which is basically everybody).

  The group actions menu was absorbed into this screen

* Added a confirm alert to leave group (fixes #938)

* New Translation Strings
* Extend "Add People" label to fit translations.
* resolved issues with translations not fitting in group menu

* Fix the long standing type warning where TSCalls were assigned to a TSMessageAdapter.

* Can delete info messages

  Follow the JSQMVC pattern and put UIResponder-able content in the
  messageBubbleContainer. This gives us more functionality *and* allows us
  to delete some code. yay!

  It's still not yet possible to delete phone messages. =(

* Fixed some compiler warnings.

* xcode8 touching storyboard. So long xcode7!

* Fixup multiline info messages.

  We were seeing info messages like "You set disappearing message timer to
  10" instead of "You set disappearing message timer to 10 seconds."

  Admittedly this isn't a very good fix, as now one liners feel like they
  have too much padding.

   If the message is well over one line, we were wrapping properly, but
  there's a problem when the message is *just barely* two lines, the cell
  height grows, but the label still thinks it's just one line (as evinced
  by the one line appearing in the center of the label frame. The result
  being that the last word of the label is cropped.

* Disable group actions after leaving group.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 11a586a835 New Fingerprint Format
Rather than verifying eachothers keys separately, you now verify the
privacy with your recipient by sharing a single composite number or
QRCode.

This is a breaking change, in coordination with Desktop and Android.

UX
--

Fingeprint is no longer in line with identity key error. Instead you
have the option of going to the full-screen safety number verification
experience.

Overhauled fingerprint design
-----------------------------

* use same modal dismiss button as elsewhere
* remove fingerprint from settings.
* quick slide in animation vs slow fade
  * existing was painfully slow
  * blur effect is better metaphor for something slide over top
  * anyway there was a rendering glitch in the end of fade where
    underlying navbar would "snap" out

Also Fixed
----------
Always provide a name string for contact

* Centralize all the nil-checking
* Fall back to "unknown contact"

allow multi-line error messages

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 2f33e87265 Update socket rocket to get an upstream crash fix
See:
https://github.com/facebook/SocketRocket/issues/421

Which is one of our more popular crashes, and happening more frequently
with iOS10.

// FREEBIE
2016-09-30 10:22:12 -04:00
Michael Kirk 8d2b38f027 Fix device listing
broken while refactoring db to async

// FREEBIE
2016-09-30 10:22:12 -04:00
Michael Kirk 3e7e67e276 Async migrations framework
* nonblocking by default
* track success of each migration independently

// FREEBIE
2016-09-28 17:09:11 -04:00
Michael Kirk 3b687da0ec Upgrade SSK to setup db async where possible
fixes #1358

// FREEBIE
2016-09-28 17:09:11 -04:00
Michael Kirk 2ab6955967 More logging, scrub phone numbers from file logs (#1357)
Phone number are still logged in TTY for development.

// FREEBIE
2016-09-27 21:20:58 -04:00
Michael Kirk 1433ee2655 Fix crash on boot =/ (#1349)
I botched a migration 6 months ago, which left some lingering TSRecipients serialized in our data store, laying in wait to explode the next time we enumerate every object in the database (e.g. when we add an index).

The bloom filter migration failed to remove TSRecipients in the somewhat rare event that the local user had no downloaded bloom filters. This could happen e.g. if they were low on disk space at the time of running the migration, I believe the app would remove the bloom filter cache.

// FREEBIE
2016-09-26 21:57:34 -04:00
Michael Kirk 0c4f1d41b6 Fix contact sync in SSK (#1345)
* bump version
* update translations

// FREEBIE
2016-09-23 17:32:03 -04:00