Commit graph

780 commits

Author SHA1 Message Date
Michael Kirk 28a2a4610c Fix compiler warnings.
// FREEBIE
2016-11-11 08:54:13 -05:00
Michael Kirk 1da7b3b2cf bump build
// FREEBIE
2016-11-10 10:48:07 -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 4c5bc1ed6f Fix fingerprint Label copying
failed to update storyboard when class was renamed.

// FREEBIE
2016-11-10 10:27:11 -05:00
Michael Kirk 96c5ab0111 Bump build
// FREEBIE
2016-11-09 14:06:06 -05:00
Michael Kirk 49e5b19487 Update translations
// FREEBIE
2016-11-09 14:05:02 -05:00
Michael Kirk c7a2fd30c2 Bump build
// FREEBIE
2016-11-09 13:50:10 -05:00
Michael Kirk 23c80748e6 Hide safety numbers until you've exchanged keys
// FREEBIE
2016-11-09 13:43:07 -05:00
Michael Kirk 225c5ecfb7 Merge branch 'jaropawlak/master' (#1408)
Alert when missing camera permissions

// FREEBIE
2016-11-08 17:20:03 -05:00
Michael Kirk b8fc4001ec Camera permission fixup
- remove unknown segue, otherwise couldn't compile project
- translated english strings
- added translation comments
- reused existing "dismiss" string
- deselected row after dismissing permissions alert in linked devices
  screen

// FREEBIE
2016-11-08 17:16:19 -05:00
Jarosław Pawlak c152c1c83a asking for camera permissions #1363 2016-11-08 16:28:24 -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
Pawel Jurczyk fd89458814 Adds comment on running carthage, which is neccessary to build the project.
// FREEBIE
2016-11-05 12:48:05 -04:00
Michael Kirk 79d5cf9e93 bump version
// FREEBIE
2016-11-04 17:45:28 -04:00
Michael Kirk 1bf77e8261 dismiss keyboard when showing corrupted message actionsheet
otherwise the keyboard covers the actionsheet.

// FREEBIE
2016-11-04 17:45:28 -04:00
Michael Kirk 21d37a92e5 Fix crash on nil image.
The only case I've actuall seen this is when a download is removed from
the file system, outside of Signal.

// FREEBIE
2016-11-04 17:39:28 -04:00
Michael Kirk 82c903b5da bump build
// FREEBIE
2016-11-04 16:47:05 -04:00
Michael Kirk ddf0890408 Fix crash on nil message
// FREEBIE
2016-11-04 16:32:12 -04:00
Michael Kirk 157b5ef15d Bump build
// FREEBIE
2016-11-04 15:01:14 -04: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 bd370f1de4 Fix cropped Chinese/Japanese messages
The earlier fix for the broken ios10 emoji font ended up breaking
messages for some users with a tall font.

Here we have a lighter touch - ensuring we don't touch messages that
don't use emoji.

Also, introduce a different approach to the fix, rather than trying to
compute the bounding rect of an appropriately attributed string, just
add an extra bit of height per line.

This approach isn't ideal for long messages with only one emoji line in
them, but the previous approach was incompatible with Chinese messages
that also contain emoji. See the new
`MesssagesBubblesSizeCalculatorTest.swift` for test cases considered.

// FREEBIE
2016-11-03 16:22:33 -04:00
Michael Kirk 62f9606bf5 Merge branch 'mkirk/fix-registration-without-background-modes#1329'
// FREEBIE
2016-11-03 16:19:21 -04:00
Michael Kirk 78d9c97d70 Bump build and properly set version.
// FREEBIE
2016-11-03 16:13:50 -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 f98e57e164 WIP: Fix hanging registration when background modes disabled
fixes #1329

We must register notification settings earlier to be sure we'll be able
to get the users push tokens.

We were previously relying on a quirk of background fetch, a feature
which we don't *actually* use, wherein it's possible to get push tokens
for a user without first prompting them for their notification
settings. More on this from UIApplication.h:

    // Calling this will result in either application:didRegisterForRemoteNotificationsWithDeviceToken: or application:didFailToRegisterForRemoteNotificationsWithError: to be called on the application delegate.
    // ---> Note: these callbacks will be made only if the application has successfully registered for user notifications with registerUserNotificationSettings:, or if it is enabled for Background App Refresh.
    - (void)registerForRemoteNotifications NS_AVAILABLE_IOS(8_0);

In the previous implementation, if a user had disabled background
notifications (e.g.  in order to save battery), we were waiting for push
tokens that would never come.

However, this simple "fix" introduces a UX problem - now we prompt for
an alert in the middle of our registration flow.

// FREEBIE
2016-11-03 16:12:28 -04:00
Michael Kirk bae050480a Debug logging around call init crash.
// FREEBIE
2016-11-03 16:12:27 -04:00
Michael Kirk 4fc5260244 Don't prompt for feedback if user hasn't completed registration
// FREEBIE
2016-11-03 16:12:27 -04:00
Michael Kirk ac996db258 Merge pull request #1407 from mdouglass/fix-issue-1270
Unifies bubble sizes for media bubbles

// FREEBIE
2016-11-03 15:38:27 -04:00
Michael Kirk cc8c8d61b4 [SSK] Update to prevent session corruption
// FREEBIE
2016-11-03 14:52:14 -04:00
Mike 7c6b84c46b Outgoing message sound respects Settings toggle (#1373) 2016-11-03 14:51:38 -04:00
Michael Kirk 431a91a485 Convert to non-decimal build numbers.
first three digits were redundant anyway. Now it's less likely to mess
up the build version, and yet easier to recover if you do.

// FREEBIE
2016-11-01 11:35:54 -04:00
Michael Kirk 61fa5756ab bump build.
oof: I previously pushed a build number 2.6.4.x to the 2.6.3.x release, so
now we have to stick with 2.6.4 in order to upload it. =/

// FREEBIE
2016-11-01 11:11:01 -04:00
Michael Kirk 21ebe0db98 bump build
// FREEBIE
2016-11-01 10:49:05 -04:00
Michael Kirk 1eb234e8ba Attempt to fix intermittent crash in messages view controller
HACK to work around radar #28167779

  "UICollectionView performBatchUpdates can trigger a crash if the collection view is flagged for layout"
  more: https://github.com/PSPDFKit-labs/radar.apple.com/tree/master/28167779%20-%20CollectionViewBatchingIssue

I have never reproduced the crash, but it's appearing in about 0.05% of
<=2.6.2 sessions and an alarming ~5.0% of beta sessions >=2.6.3.8.

// FREEBIE
2016-11-01 10:05:11 -04:00
Michael Kirk e206afdc5e Bump build
// FREEBIE
2016-10-31 10:39:40 -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 f2ee006d5f Update translations
Bump version.

// FREEBIE
2016-10-28 10:52:43 -04:00
Michael Kirk 541ca39155 Partial revert of 33f6a95520 (#1421)
An existing related crash is much more common after 33f6a95520.

This is the only change proximate to the crash.

Crash looks like this:

    Last Exception Backtrace:
    0   CoreFoundation                  0x189c601c0 __exceptionPreprocess + 124 (NSException.m:165)
    1   libobjc.A.dylib                 0x18869855c objc_exception_throw + 56 (objc-exception.mm:521)
    2   CoreFoundation                  0x189c60094 +[NSException raise:format:arguments:] + 104 (NSException.m:131)
    3   Foundation                      0x18a6ea82c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112 (NSException.m:157)
    4   UIKit                           0x1903a534c -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:] + 13428 (UICollectionView.m:5585)
    5   UIKit                           0x1903a8e98 -[UICollectionView _endUpdatesWithInvalidationContext:tentativelyForReordering:animator:] + 92 (UICollectionView.m:6401)
    6   UIKit                           0x1903a9178 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:] + 384 (UICollectionView.m:6459)
    7   UIKit                           0x1903a8fd8 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:] + 96 (UICollectionView.m:6423)
    8   UIKit                           0x1903a8f5c -[UICollectionView _performBatchUpdates:completion:invalidationContext:] + 84 (UICollectionView.m:6418)
    9   UIKit                           0x18fc834ec -[UICollectionView performBatchUpdates:completion:] + 64 (UICollectionView.m:6407)
    10  Signal                          0x1000d7e90 -[MessagesViewController yapDatabaseModified:] + 756 (MessagesViewController.m:1863)

// FREEBIE
2016-10-28 09:36:39 -04:00
Matthew Douglass baf0ea96d6 Fixes [UIDevice isiPhoneVersionSixOrMore]
Improves the detection logic for iPhone 6 and above (uses interface idiom and the pixel width of the screen). This fixes detection on the iPhone 7 which was previously broken because it’s model number wasn’t include.

Also removes a number of category methods that weren’t being used in the codebase and were equally incomplete.

// FREEBIE
2016-10-28 00:18:03 -07:00
Matthew Douglass 09d377f7e2 Unifies bubble sizes for media bubbles
On iPhone 6 and above, media bubble sizes are 10% wider
On iPhone 5s and below, media bubbles are fixed in their larger dimension and the other dimension is calculated based on the aspect ratio of the underlying image (clamped to a reasonable min/max height).

// FREEBIE
2016-10-28 00:16:45 -07:00
Matthew Douglass c958c7909c Unifies bubble sizes for media bubbles
Media bubbles (for photo, video and animated) sizes are calculated using shared logic. The bubbles are fixed width and their height is calculated based on the aspect ratio of the underlying image (clamped to a reasonable min/max height).

Fixes #1270

// FREEBIE
2016-10-27 21:47:53 -07:00
Matthew Douglass bbfffdf79f Scanning an invalid QR code shows an error dialog
* From the error dialog you are able to back out of scanning or try again. Adds English localization for this message.

  Adds an extra flag in OWSQRCodeScanningViewController to make sure that we don’t handle captureResults when capture is disabled (this was racing before because the call to [capture stop] is async and that was causing the cancel case to present the error dialog multiple times.

  Fixes Signal-iOS#1347

* Fixes appearance of race with starting capture
  Also marks the capture variable as atomic since it is accessed on
  multiple threads.

// FREEBIE
2016-10-26 15:49:19 -04:00
Michael Kirk 40d6550fca Update translations
// FREEBIE
2016-10-26 15:22:35 -04:00
Michael Kirk 560b377512 Fix intermittent crash on network status change
These notifications are posted off the main thread, so let's make sure
we're only touching the view hierarchy on the main thread.

// FREEBIE
2016-10-26 15:22:35 -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 0e345dbbad Update translations
// FREEBIE
2016-10-26 15:22:35 -04:00