Commit graph

763 commits

Author SHA1 Message Date
Matthew Chen c6de676018 Respond to CR.
// FREEBIE
2017-01-12 17:55:44 -05:00
Matthew Chen 4a65a88512 Rework new call view.
// FREEBIE
2017-01-12 15:55:14 -05:00
Michael Kirk 469bff5734 Make call delegate weak
// FREEBIE
2017-01-12 13:27:46 -05:00
Michael Kirk 1ed39976ee make public protocol method implementations public
responding to CR

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk f6e6e6b787 CallViewController only accesses CallService via the CallUIAdapter
This is an effort to better define boundaries and simplify
relationships.

This also fixes a theoretical problem where CallKit was showing the in-app
call screen before the call was successfully answered, now we wait until
the action is fulfilled.

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk fc6da05259 remove some dead code
Related to an earlier failed attempt of reconciling CallKit audio
management with WebRTC's.

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk 947a637669 Sync "mute" controls between CallKit
In the process, extracted the CallDelegate to allow the
CAllViewController to observe useful call state properties (call.state
and call.isMuted)

// FREEBIE
2017-01-12 13:27:45 -05:00
Matthew Chen 98e087a47f Fix font lookup on iOS before 8.2.
// FREEBIE
2017-01-12 10:14:35 -05:00
Matthew Chen 740aa643be Add method to flush logs.
// FREEBIE
2017-01-12 09:56:10 -05:00
Michael Kirk c7449db289 remove stubbed audio manager implementation until it's clear what to do
with it.

// FREEBIE
2017-01-12 09:56:09 -05:00
Michael Kirk 9e248168b9 merge CallKitProviderDelegate into CallKitCallUIAdaptee
There was not a clear distinction in responsibilities and mostly the
Adaptee was just delegating to the CKProviderDelegate
2017-01-12 09:56:09 -05:00
Michael Kirk ce3780e44a Wip smashign providerdelgate into UIAdaptee 2017-01-12 09:56:08 -05:00
Michael Kirk 6eecef99ba Promise aware Message sender
As this could be used elsewhere, ideally it'd added to the actual class
definition, but MessageSender (SSK) doesn't use PromiseKit

// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk f9b44c8892 Added CallService documentation
// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk 602a5953f2 respect silence switch for incoming ringing
// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk 57ad7a2808 cleanup 2017-01-12 09:56:08 -05:00
Michael Kirk 647b2b37e9 WIP: WebRTC calling
* Ensure NotificationsManager has dependencies
    Otherwise it's easy to mess up the order of the required dependencies.
* move AccountManager into Environment, it's heavy to construct

// FREEBIE
2017-01-12 09:56:05 -05:00
Matthew Chen 6106326b34 Update to reflect changes in SSK https://github.com/WhisperSystems/SignalServiceKit/pull/85.
// FREEBIE
2017-01-11 09:19:50 -05:00
Thomas Guillet d7b27a4021 Refactor ContactsPicker to show a clean search bar
* Replace UITableviewController to UIViewController
* Create a custom xib file
2017-01-09 11:45:43 +01:00
Matthew Chen 2ce4d39f9e Respond to CR.
// FREEBIE
2017-01-06 13:28:41 -05:00
Matthew Chen 2dac6c888a Update SignalServiceKit pod.
* Fetch messages when app becomes active.
2017-01-06 13:28:41 -05:00
Michael Kirk a636f0b6af Redphone works on ipv6 only network
// FREEBIE
2017-01-01 04:42:48 +01:00
Michael Kirk 90daf60c56 Fix travis build
* Add generated Signal-Swift.h to test search header path. You must do
  this when testing an ObjC clas with swift dependencies (PushManager. in this case)
* Word on the street is that XCode8.2 is less flaky for running simulator tests

// FREEBIE
2016-12-22 10:48:06 -06:00
Michael Kirk ba4569f5bd delete unused code
//FREEBIE
2016-12-21 14:11:09 -06:00
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 94d37d9c55 Warn user about re-registering existing signal number
* show better errors if it *does* happen.
  If someone tries to send from their old device, they'll see a
  depressing, but sensible warning message.
* new translations

// FREEBIE
2016-12-16 11:48:33 -06:00
Michael Kirk 495628834c Bump up launch screen logo size on iPhone6 and larger
The previous launch screen was initially built on iphone5, but we never
scaled the logo to have the same proportions on iphone6 and larger
screens. Now it's scaled proportional to the screen width.

// FREEBIE
2016-12-15 18:00:21 -05:00
Michael Kirk 727fb70806 Fix show error message when download fails
Previously we had our "queued" and "failed" logic backwards.

// FREEBIE
2016-12-09 15:58:11 -05:00
Thomas Guillet 97500d55ec Prevent iRate mechanism when handling local notifications 2016-12-09 15:56:58 -05:00
Michael Kirk 490795ea3d Make disappearing messages button visible in German (#1536)
Because the button was missing an explicit width it was not being layed
out properly when it's label was sufficiently long.

// FREEBIE
2016-12-09 15:51:23 -05:00
Michael Kirk e7bc2e86db Show email as name when contact has no name
// FREEBIE
2016-12-09 15:12:13 -05:00
Daniel Rosado 76d01863db [Invite Flow] Use email address to collate contacts when no given or family name is provided
* Add tests to ContactsPicker collate contacts functionality
2016-12-09 15:12:13 -05:00
Josh Schneier 89730f2b85 Improve accessibility a bit 2016-12-09 15:10:25 -05:00
Michael Kirk c1ab36576e Fix crash when attaching media
Seems these crashes were introduced when transitioning from
DJWActionSheet -> UIAlertController

// FREEBIE
2016-12-09 09:31:07 -05:00
Michael Kirk 243ff190bc Fix crash in group listing / new group views
The broken code addressed in 8211d4584f
was duplicated a couple of places. This commit ferrets out the rest of
them and centralizes the logic in the ContactsManager.

// FREEBIE
2016-12-04 22:58:02 -05:00
Michael Kirk 103f0450a1 Build avatar from contact initials even if they don't have a phone
number

The invite contact picker was rendering the "#" avatar for contacts who
had a name, but no phone number.

In some ways this approach is dumber. But since we have "surprising"
logic to set the contacts firstName to a phone number or maybe a company
name when contacts are built from ABContacts, this approach is more on
the level with the existing assumptions of what could be in that field
(which is to say, pretty much anything).

// FREEBIE
2016-12-04 14:03:12 -05:00
Michael Kirk 8211d4584f Don't explode when missing first name
// 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
Michael Kirk 1dcd1830e6 Fix crash in group member listing
Restore contactsComparator which is still being used in the group member
listing

partial revert of 81e1ec4b9e

// FREEBIE
2016-12-01 17:38:48 -05:00
Thomas Guillet e58de07af7 Prevent going to the "Background Notifications" when tapping "Notification Sounds" 2016-12-01 15:51:25 -05:00
Michael Kirk e6f0130f35 Fix peek from inbox (#1509)
fixes #1506

// FREEBIE
2016-12-01 15:46:08 -05:00
RiseT f29a0fe49b Change safety number strings to be singular
// FREEBIE
2016-11-30 20:11:41 -05:00
Michael Kirk 942353cba2 Fix crash on "show safety numbers" in group thread
// FREEBIE
2016-11-30 15:04:26 -05:00
Michael Kirk 5a0141003d "No Contacts" screen uses new invite flow
fixes #1501

// FREEBIE
2016-11-30 15:03:18 -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
Michael Kirk f0461891e0 Convert Localizable.strings tools to UTF-8 (#1420)
- Update translations
- Updated transifex scripts to convert appropriately
- Run script from any dir
- Check that target directories exist
- We're currently not pulling any strings from JSQMVC

UTF-8 is preferred since we can see diffs in GH and have sane merges.

// FREEBIE
2016-11-29 16:54:01 -05:00
Josh Schneier 896dd026d2 Remove DJWActionSheet 2016-11-29 10:20:56 -05:00
Josh Schneier f686fc9a87 Style refactor to reduce rightward drift
// FREEBIE
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 f9a60b622d Use cleaner signal link in invite email
// FREEBIE
2016-11-22 18:47:03 -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 2bac3e4280 Better fit for "delete account" button on iPhone5
- move invite button faaaaaaaar away from the "delete account" button.

// FREEBIE
2016-11-22 15:11:53 -05:00
Michael Kirk 06ca3c9290 Mail and Message invite flow
* Spruce up compose contact-picker
- Fix random sorting for contacts missing first or last name
- Add Avatar to contact picker
- de-dupe contacts

Better copy for INVALID_MESSAGE error.

// FREEBIE
2016-11-22 12:11:35 -05:00
Michael Kirk bed5250397 remove redunant method
// FREEBIE
2016-11-21 22:03:37 -05:00
Josh Schneier c0c71fe261 Switch back to the default keyboard after sending 2016-11-21 11:37:57 -05:00
Michael Kirk 584118a9fc compare safety numbers with clipboard (#1475)
* Compare safety numbers with clipboard

// FREEBIE
2016-11-21 11:06:37 -05:00
Igor Ranieri Elland a0dc5950fc Automatically adjust message bubble text size on dynamic text changes. (#1469)
* Automatically adjust message bubble text size on dynamic text changes.

- Addresses part of #1453.

* Renamed dynamic text notification handler method.
2016-11-17 17:07:18 -05:00
Igor Ranieri Elland e67af9d52b Make settings modal.
- Issue raised in #1453.
2016-11-17 13:57:18 -05:00
Thomas Guillet f1b4bd772c Prevent bogus message emission on group deletion
Only send a message if the local number is part of the group

* Fix error on empty group #1449
* Fix an unlogged issue about notification sent to group members even is the local user already quit the group
2016-11-17 13:41:32 -05:00
Russ Shanahan 087f753979 Voiceover fix- Do not read "no messages" text when it's hidden (#1437) FREEBIE 2016-11-17 13:31:46 -05:00
Russ Shanahan b40f6acd01 Voiceover fix: Message author read as thread name (#1437) FREEBIE
There was a bug in voiceover mode. When reading messages, Voiceover
would read out "message author: message content" for each chat bubble,
but the message author was always the name of the chat. So if it was
a contact chat, every message would be read as if from the other party,
and if it was a group chat, every message would be from the title of
the group.

This patch looks up the display name for the given signal id so
Voiceover reads the correct name for each message. It will read "Me" if
the message is outgoing.
2016-11-17 13:31:46 -05:00
Michael Kirk 88d9ef987f Share dialog for Safety Numbers
// FREEBIE
2016-11-15 18:44:52 -05:00
Michael Kirk eb995cb389 revert to tracking longform build
We use this to determine which legacy migrations to run.

Also, soften the "your device is too old" behavior to just exit, rather
than blow away the users installation. Ouch!

* bump version

// FREEBIE
2016-11-14 13:34:39 -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 d3c2f44aeb Exclude extra data detectors.
Data detectors work by matching local text against a series of local
matchers. No network activity is required. Some of the data detectors
are really useful (e.g. a link, or being able to copy a phone number).

Some aren't very useful, e.g. pop culture references, and seeing things
underlined is giving people the false impression that their data is
being inspected remotely.

// FREEBIE
2016-11-14 08:58:22 -05:00
Michael Kirk fbcf5fbf07 Properly assign global contacts updater to environment
broken in 33f6a95520

// FREEBIE
2016-11-13 12:39:08 -05:00
Michael Kirk ddeadafc3b Don't show own addressbook info in settings
Some folks get the wrong idea and think Signal Service knows their name,
when really, we were just showing them the entry for the registered
phone number in their address book.

In any case, presumably the user already knows their name, so we don't
need to remind them.

// FREEBIE
2016-11-13 11:49:39 -05:00
Michael Kirk 7bcf5190b4 Address some lingering emoji cropping
This is an expedient, but not good, "fix". Some messages are going to
have extra space at the bottom of the bubble. But, for the time being,
that's preferable to getting messages clipped.

// FREEBIE
2016-11-13 11:48:05 -05:00
Michael Kirk 01a3ef015f Don't show permissions pop-up until user has seen contact disclaimer (#1456)
// FREEBIE
2016-11-12 15:32:45 -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 4c5bc1ed6f Fix fingerprint Label copying
failed to update storyboard when class was renamed.

// FREEBIE
2016-11-10 10:27:11 -05:00
Michael Kirk 23c80748e6 Hide safety numbers until you've exchanged keys
// FREEBIE
2016-11-09 13:43:07 -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 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 ddf0890408 Fix crash on nil message
// FREEBIE
2016-11-04 16:32:12 -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 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 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
Mike 7c6b84c46b Outgoing message sound respects Settings toggle (#1373) 2016-11-03 14:51:38 -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 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 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 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
Michael Kirk 7c32259a92 We aren't using ErrorMessage/InfoMessage. (#1412)
We incorrectly assumed some parameters were these types, but actually
they were TSMessageAdapters.

// FREEBIE
2016-10-23 13:39:42 -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 64f4eb73c5 Allow autogenstrings to find all strings
* Inline #define strings, so genstrings can find them
* Make all strings single line so they don't get truncated by auto-genstrings
* Properly quote LHS in strings file

// FREEBIE
2016-10-20 13:27:38 -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 5b01976466 Fix hidden incoming audio
Missed bottom constraint when customizing incoming message bubbles to
include timer icon in footer.

// FREEBIE
2016-10-14 19:10:37 -04:00
Michael Kirk 1e417ea93f Longpress to copy safety numbers
Nothing else to see here. =)

 ༼ つ ◕◡◕ ༽つ [swift]

// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk da82c01f6e Restart timer animation when returning from background
// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk 04f5c3ce22 Slow the timer animation down a bit.
fixes #1384

// FREEBIE
2016-10-13 10:04:58 -04:00
Michael Kirk 6a4fc3168d Fix delivery shown for undelieverd disappearing messages.
fixes  #1380

// FREEBIE
2016-10-12 14:54:41 -04:00
Michael Kirk 607262df6a Remove observers on dealloc (#1379)
// FREEBIE
2016-10-12 12:50:03 -04:00
nixnuex ca5ca9d0cc code verification: show complete phone number 2016-10-12 09:41:42 -04:00
Michael Kirk 85beb93e86 Style timer changes less alarmingly.
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 89df8ddb31 Group updates can be deleted
Removed some dead code re: NSCopy/Coding, since it seems unused.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 07ab1bd931 Call notifications appear immediately after call
previously you had to leave/return. This happens because we unregister
observers while our view is not visible.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 7106eee4a3 Call notifications are deletable
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 405990a7d5 Don't select or copy info message text.
// 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 2b2ebbe099 Tweak settings design
* lighter tint for icons, their bold stroke width makes them darker than
  the text
* Replace double hourglass icons with a single one. It aligns better,
  and the "small time" vs "big time" is confusing
* Add description of what disappearing messages do

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 023e62e6a6 fix reused cell starts blinking too early
There are dispatch_async's waiting to be fired on some re-used cells.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 94a23021f8 Size error messages correctly.
* calculate size of info message using the info message font.
* offset by the info message header

There were instances of lines getting cropped, or an extra line being
added. The previous, more conservative, solution was to just make every
bubble too big, but it looked terrible.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk b95112356c iOS 8 Fixups
* ContactsUI framework is not available on ios<9.
  And it never was, so this framework should not be "required".

* Fix conversation settings title font on ios8

* Fix fingerprint not displaying on ios8

* ios8 safety number indented on third line.

* Fix glitchy table cell animation (not ios8 specific)

  The defaut slide-under animation only looks good if you're using a
  standard table cell height, but our duration slider is taller than the
  rest of the table's cells.

  Plus add a little bottom padding to the slider cell

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 2edd2b8f81 set launch state correctly
// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk a28fea8384 Fix emoji message truncation on iOS10
fixes #1368

Apple switched emoji fonts from AppleColorEmoji to AppleColorEmojiUI.
The new font doesn't compute it's size correctly, causing containing
rectangles to be too small.

This commit scrubs strings of the new emoji font, and replaces it with
the old.

// FREEBIE
2016-10-12 09:30:25 -04:00
Michael Kirk 43a2eb9da1 Fix occasional crash when sending after deleting messages
// 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 48336b6c53 Resetting session returns you to messages view with an indicator that
your session was reset.

// 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 3e7e67e276 Async migrations framework
* nonblocking by default
* track success of each migration independently

// 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 be0556f68a fix "last active" date
// FREEBIE
2016-09-21 12:53:17 -04:00
Michael Kirk 5372173c4a Fix groups breaking without avatar (#1336)
- Group updates were appearing as "unsupported attachment"
- Couldn't message in a new group unless it had attachment.

// FREEBIE
2016-09-20 19:16:05 -04:00
Michael Kirk ed06555567 Merge branch 'release/2.5.0' into release/2.5.0-with-master
// FREEBIE
2016-09-17 16:06:33 -04:00
Michael Kirk 197933817c Fix height of network status on iphone5.
Abandon dynamic type since other (standard) table cells don't use it.

// FREEBIE
2016-09-17 13:51:34 -04:00
Michael Kirk 7c6e9e07b8 Read receipts remove lockscreen notifications
No need to have a notification for a message you've already read on
desktop.

// FREEBIE
2016-09-17 13:51:33 -04:00
Ronny b59a0e47d7 Disable group header interaction (#1328)
prevent clickability of the group header cell in the group members view
2016-09-17 12:44:46 -04:00
nixnuex 50cd4f54fc verification code field: improved user experience (#1325) 2016-09-17 12:36:17 -04:00
Michael Kirk 5200cccbe3 Update translations
* New bg (Bulgarian) localization!
* New sq (Albanian) localization!
* replace unfinished bg_BG localization with complete bg localization
* caps keys to make it easier to see missing localizations
* pull with newly pushed source keys

// FREEBIE
2016-09-09 15:17:15 -04:00
Michael Kirk 33f63e76d1 Fix devices icon intermittently showing
Because it was not rendering correctly in all cases, we're foregoing the
templated image, and using a colored asset.

// FREEBIE
2016-09-09 11:40:32 -04:00
Michael Kirk 019310f284 Deselect table rows when swiping back in table views
// FREEBIE
2016-09-07 22:50:21 -04:00
Michael Kirk 7e67fb1939 Some style for the QR code scanner.
Also made identity key scanner appear faster. Previously we were
waiting for camera to initialize. Now we do this after the view has
loaded - with a black background, the affect is preferable than
lagging on the transition.

// FREEBIE
2016-09-07 22:43:19 -04:00
Michael Kirk 7c3a07960f Device manager fixes
* Avoid intermittent crash in device manager via YapDatabaseModified
* Properly align refresh text when expecting new device
* Avoid glitchy activityIndicator while polling
* Expose edit mode toggle

Much of the code changes here were in the corresponding SSK update.

// FREEBIE
2016-09-06 17:16:42 -04:00
Michael Kirk dee26e6e0a Use PNG constant
// FREEBIE
2016-09-06 15:57:44 -04:00
Michael Kirk 9006ff604f Multi device read receipts.
All the heavy lifting is in SignalServiceKit.

// FREEBIE
2016-09-06 15:57:44 -04:00
Michael Kirk 428f7fca19 Adapt to nullability annotations in SignalServiceKit
// FREEBIE
2016-09-06 15:57:44 -04:00
Michael Kirk 92290a5d4d Fix: Inbox count not updating while viewing archive
e.g. If I'm viewing the archive when a new message comes in

// FREEBIE
2016-09-06 15:57:44 -04:00
Michael Kirk ef6784ed95 Device Manager
* List linked devices
* Adding a new device
* Removing a device

TODO: design on the QRScanner

// FREEBIE
2016-09-06 15:57:44 -04:00
Michael Kirk 84156698c4 Provision device from QRCode.
NEEDS DESIGN - will likely have an intermediate "device manager" screen.

* extracted QRCode Scanner into re-usable ViewController

// FREEBIE
2016-09-02 12:40:21 -04:00
Michael Kirk 6545161192 thread is set during notification callback.
It should *not* be non-atomic

// FREEBIE
2016-08-23 14:24:48 -04:00
Michael Kirk eef2002224 Clean up settings (#1316)
* Remove unused (hidden) button from settings
* dynamic type for settings cells
* prefer property vs ivar access
* property attributes

// FREEBIE
2016-08-22 17:41:11 -04:00
Michael Kirk cc2d47fbd3 Update protocol (#1315)
* Update to latest SignalServiceProtocol
* Show SignalServiceKit compiler warnings

// FREEBIE

* Update to latest signal protocol

// FREEBIE
2016-08-22 16:54:31 -04:00
Michael Kirk e56d41edc7 Otherwise we'll never run future migrations. (#1314)
// FREEBIE
2016-08-21 14:15:50 -04:00
James Barclay f8a0be4c70 Return immutable data from generateSecureRandomData:length and use OSStatus to check the status of SecRandomCopyBytes. (#1306) 2016-08-17 16:09:57 -04:00
Michael Kirk 9a86ca76ce screen security is enabled by default
// FREEBIE
2016-08-15 10:07:14 -04:00
Michael Kirk 58548c68cc code cleanup
- refactor screen protection code for clarity
- remove unused settings cell class
- remove unused preferences

// FREEBIE
2016-08-15 10:07:14 -04:00
Adam Stiles 52861a6ef5 Fix incorrect GIF message bubble sizing (#1300)
TSAnimatedAdapter is used when rendering GIFs. TSAnimatedAdapter
inherits from JSQMediaItem but does not provide a custom implementation
of the hash method. The default implementation of hash in JSQMediaItem
results in all messages of a given interaction type (incoming,
outgoing) sharing a cached bubble size. For this reason, JSQMediaItem
subclasses are required to implement hash (see
https://github.com/jessesquires/JSQMessagesViewController/issues/631).

This commit fixes issue #1275 by implementing hash in TSAnimatedAdapter
the same way TSPhotoAdapter does.
2016-08-15 09:39:46 -04:00
Michael Kirk 6120bd9e8e Orphan-data cleanup no longer causes timeout (#1303)
On older devices with lots of data, the orphan data cleaner can time
out. Here we're trading certainty that the migration completed for
confidence that the boot process doesn't time out.

// FREEBIE
2016-08-15 08:06:34 -04:00
Vitali Lovich 547cd9797a Improve audio waveform scrolling performance (#1292)
The object is already cached & the waveform view constructed when scrolling,
so there's no need to re-create the view.

This doesn't fix the problem with the wave-form generation on the first
view of the message.  That is a more critical problem in the underlying
SCWaveformView class which renders on the main thread instead of doing
it asynchronously.

FIXES #1258
2016-08-02 10:52:20 -06:00
Michael Kirk 92b3ea5d25 Re-enable attachment cleanup migration after fixing it in SSK (#1298)
// FREEBIE
2016-08-01 10:41:10 -07:00
Michael Kirk 000a5941f4 Delete attachment cleanup migration.
After running locally, I noticed many old threads missing old
attachments. I'll do some further investigation.

// FREEBIE
2016-08-01 08:21:32 -07:00
Michael Kirk 9f2bb5d2cc Fixes lingering interactions after removing thread (#1297)
Most of the work was done in SignalServiceKit 0.0.7, this adapts to
those changes.

Migration to clean any orphaned interactions/attachments.

- don't set new migration version until migration was successful.
- remove dead code from migrations

- rename message.attachments->message.attachmentIds
- Remove unused parameter from GroupModel
- formatting touched method/'s signatures

//FREEBIE
2016-07-31 15:25:07 -07:00
Michael Kirk 147cc15105 Input toolbar fits text size (#1290)
* Set height of toolbar based on actual font height. FIXES #1282
* max height for compose field FIXES #1186

Still absent is resizing to fit draft.

// FREEBIE
2016-07-22 00:05:24 -07:00
Michael Kirk 86f06593d8 Fix "can't reattach saved GIF" (and others) (#1288)
The root of the problem is we were using the deprecated ALAssetsLibrary
framework, which couldn't find certain assets.

By using the photos framework not only are we able to find these
assets, but it also cleans up our code:
* no more copying byte buffers
* no more detecting file type

// FREEBIE
2016-07-21 17:15:34 -07:00
Michael Kirk 3c2846274c Prevent crash when copying corrupted image attachment. (#1287)
// FREEBIE
2016-07-21 15:55:32 -07:00
Brandon Cheng 583d3e82ad Alternative solution for requiring direct taps for launching media view (#1235) (#1261)
// FREEBIE
2016-07-21 10:23:39 -07:00
Ronny e7affecc17 FIX: Leaving group should dismiss keyboard #1274 (#1278)
If we hide the input toolbar, we should hide the keyboard too

//FREEBIE
2016-07-21 08:50:41 -07:00
Ronny 0455f03615 Fixes Call Error message text should adapt size to fit localized texts (#1164) (#1178)
- adding constraints and changing properties for _callStatusLabel to
fit 3 lines of text

//FREEBIE
2016-07-21 07:53:26 -07:00
Michael Kirk 97fdabf9a2 Narrow the bubbles a bit. (#1269)
This is closer to the 2.3 version.

Seems like upstream sizing has changed since our JSQMVC upgrade. This wider size calculation makes sense if you're losing space to the avatar, but since we're not using avatars the full width bubbles can make the whole view seem a bit crowded when you have large blobs of text.

// FREEBIE
2016-07-20 13:21:20 -07:00
Michael Kirk 835021b0d3 Fix extra tall error messages by rendering timestamp (#1268)
We were ocassionally seeing extra tall error messages. This is because,
when appropriate, we were adding the space for a timestamp, but then
never actually rendering the time stamp.

So now:

- Error Messages aren't rendered too-tall
- Error Messages get a printed timestamp when appropriate

// FREEBIE
2016-07-20 11:59:18 -07:00
Michael Kirk f899cff128 Fix in-app audio
- sound is set by passing in reference
- don't access properties in constructor
- distinguish multiple variables with same name

// FREEBIE
2016-07-19 09:12:18 -07:00
Michael Kirk df63c8624d fix compiler warnings
// FREEBIE
2016-07-19 09:10:39 -07:00
Michael Kirk e7d4763715 Must tap directly on bubble to launch fullscreen media view (#1260)
// FREEBIE
2016-07-18 18:51:40 -07:00
Michael Kirk 9db3b0db27 Consistent and efficient media Delete/Copy/Save UX
copy/save/delete is accessed via longpress for all media messages, just
like for simple text messages.

Notes
-----
We don't support saving audio attachments as it's not clear where they should go.
(I don't think users expect them to end up in their iTunes library.)

There is still no UX for "pasting" media into Signal.

Removed the now redundant (and confusing) "share" button interface.

//FREEBIE
2016-07-18 09:20:48 -07:00
Michael Kirk db3b2d443c Use upstream corner radius
The history here is that the radius I'm removing was added in #884 after
having straight edges added in our custom fork for a while.

So, rather than override our override, I'm just reverting to the
upstream value, which is close in proximity, and closer to iMessages
radius.

// FREEBIE
2016-07-14 23:28:42 -07:00
Michael Kirk 4ccb295dbb Send button disabled color and dynamically sized
Using upstream button and change notification allows us to delete some
code.

// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk f8d65ab0f5 Post JSQMVC code cleanup
* formatting
* referencing TODOS
* remove unnecessary logging

// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk b7dd51438e Move colors into style class
// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk 1a4b38e34b Modernize init, dealloc, dicts
* Use NS_DESIGNATE_INTIALIZER to ensure we're setting all the variables we need to be in OWSCall
* no need to nil properties in dealloc on ARC
* use declarative dictionaries for legability

// FREEBIE

use declarative dictionaries for clarity
2016-07-14 23:15:06 -07:00
Michael Kirk f7f1b6877b Remove unused call thumbnail code
// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk e930574b1b rename our custom JSQ classes to OWS so it's clear what is/not our code.
This was done as part of unforking JSQMessagesViewController, but is
intentionally a separate commit so we can separate formatting changes
from code changes in git history.

* Import frameworks like:
    #import <FrameworkName/HeaderName.h>
* instead of:
    #import "HeaderName.h"

// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk 933281f234 format objc.
This is part of unforking JSQMVC, but I'm only reformatting files
otherwise changed rather than reformatting the entire project for git
sanity.

This is intentionally a second commit so we can separate formatting
changes from code changes

* brace should drop after method definition (this is common across
  almost all objc projects, and allows you to quickly differentiate
  multi-line method signatures from their implementation.
* aligning consecutive assignments ongoingly muddies git history

// FREEBIE
2016-07-14 23:15:06 -07:00
Michael Kirk 4d320d6015 Unfork JSQMessagesViewController
Geting back on upstream fixes a couple bugs (see ##Bugfixes), and also
will make future updates easier.

The unforking process was basically this:

* move custom message types (Calls and DisplayedMessages) classes from our
  custom JSQMVC fork into Signal-iOS.
* Move any method customization into our subclass. Including
  ColletionView stuff, bubble sizing, and gesture behavior

Bug Fixes
---------
* Fix mis-sized incoming media bubbles.

Bubble size was being cached by interaction id. Which broke when
receiving an attachment. The problem is that incoming media messages
were initially the height of a "Downloading Attachment" info message.
Instead we use the mediaHash for media messages to expire the bubble
size when the media changes.

* fix missized bubble when MVC did appear

The MessagesViewController isn't sized correctly until ViewWillAppear.
This caused the first round of bubbles to be rendered incorrectly (they
assumed a larger container than they had).  I think is reflected in the
current version of the app by a reflow occurring shortly after the view
appears.

Chores
------
* bump travis to build with xcode8
* specify RQV development team for device build. required by xcode 8 beta

Cleanup
------
* Refactor messageing XIB so that elements are hangning outside of
  the views frame
* Fix compiler warning with explicit cast
* delete deprecated lineBreakmode, it's the default value anyway.

// FREEBIE
2016-07-14 23:15:05 -07:00
Michael Kirk d24d54d4f2 small IOS9 Fixes (#1253)
* Fix compiler warnings by explicitly casting to int.
* Show a better permissions message when viewing attachments.
* Fix comment.

// FREEBIE
2016-07-08 16:39:28 -07:00
Michael Kirk d4f2c0f249 ensure picker source available to prevent crash
This is crashing on simulator, but presumable if it weren't available
for other reasons (permissions?) it would also crash.

// FREEBIE
2016-07-07 10:31:51 -07:00
Michael Kirk 1e43e139fd Get back on upstream SocketRocket (#1241)
* Latest SocketRocket includes
  * crash fixes.
  * our new security policy management, so we don't have to
    keep rebasing to incorporate updates.

* Adapt to policy renaming in SignalServiceKit
* bump XCode version to play nice with SWIFT_NAME

// FREEBIE
2016-06-30 23:08:49 -07:00
Michael Kirk a181d218cf extract and test contact searcher
// FREEBIE
2016-06-28 14:13:39 -07:00
Michael Kirk 8c6bf3cba6 prefer properties per style
// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 1f31015d54 find phone number regardless of punctuation used in search.
e.g. 3235551234, 323-555-1234, 1-323-555-1234, etc. are all the same as +13235551234.

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 26f5418500 Remove distinction between TS and RP users
* Ensure we're always showing call button for non-group threads.
* search phone strings directly rather than precomputing field

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk 62633ff7f4 remove unused code
// FREEBIE

dot notation is only for property access

// FREEBIE

remove unused code
2016-06-28 08:58:29 -07:00
Michael Kirk 1e0f0157c1 namespace ContactsManager -> OWSContactsManager
rename test class ContactManager->OWSContact_s_Manager
update docs

// FREEBIE
2016-06-28 08:58:29 -07:00
Michael Kirk b3bb4c745e Set explicit height for all media types. Audio is the only special case. (#1237)
This might FIX #1111, but I think there are actually a handful of things
breaking our layout.

// FREEBIE
2016-06-28 06:50:12 -07:00
Michael Kirk aa9908d439 Large media attachments should be compressed (#1232)
* compress non-GIF media as JPEG

There are some problems with this approach
- Potentially re-encoding files
- Lots of code in the controller

* Compress GIF > 5MB into static JPEG.

This isn't ideal, but a stopgap to prevent people from sending huge
GIFs, while also giving them *some* kind of feedback (e.g. a static jpeg
is sent rather than their being no indication to sender+recipient that
anything was attempted.)

* spell bmp correctly

// FREEBIE
2016-06-23 13:43:31 -07:00
Michael Kirk 76352bf471 Code Cleanup (#1229)
* remove unused Signal-Bridging-Header
* move Adapters out of ViewControllers directory
* remove unimplemented method from header
* Fix unused variable warning.
* Move SignalsViewControllers out of UITests directory.
* remove executable bit from source files

// FREEBIE
2016-06-17 15:41:41 -07:00
Michael Kirk 7c84c4569a Only call UI modifying observers when UI is present (#1226)
* centralize observers relevant to a "visible UI"
* collocate init/teardown of observers

// FREEBIE
2016-06-17 10:45:48 -07:00
Michael Kirk bee7c71dff Prevent freeze when swiping back twice. (#1224)
FIXES #1222

Maybe this code was a vestige of a former way we were customizing the
back button. In any case, it's no longer required for swipe-to-pop
functionality.

// FREEBIE
2016-06-16 16:42:01 -07:00
Michael Kirk 4a1c53f624 Access contacts atomically to avoid corruption (PR #1223)
4% of our crashes are from accessing latestContactsById with an invalid
address. This was partially addressed by assigning a value on init, but
it's still happening.

By converting the ivar to an atomic property we can avoid any funny
business that would happen when accessing this var while it's being
updated in a different thread.

Also, make sure we're copying to defensively strip mutability.

Also:
* bumped release target
* removed unused code
* dealloc at the top per style.
2016-06-16 13:54:33 -07:00
Michael Kirk 8f04f863b7 hide UI element must happen on main thread (#1220)
// FREEBIE
2016-06-15 13:39:13 -07:00
Michael Kirk 7fef6aeab2 Fix crash after deleting message (#1219)
* update to JSQMessageViewController fixes #1218
* no need for SVC to retain membership of MVC

// FREEBIE
2016-06-15 12:46:29 -07:00
Michael Kirk 78a5355b04 Initialize latestContacts to empty dict (#1207)
Seeing intermittent segfaults on [latestContacts allKeys].
This could be because latestContacts is initialized async.

//FREEBIE
2016-06-09 12:06:10 -07:00
Michael Kirk a736e8de66 Fixes avatar not showing for single contact thread (#1202)
* requires update to SignalServiceKit
* updated Pod Dependencies
* bumped version

Fixes #1201

// FREEBIE
2016-05-26 15:49:34 -05:00
Michael Kirk d7c48578a9 Fix invite crashing without sms (#1192)
* Fixes "New Message" --> "Invite contact" exception for iPhone devices that do not support SMS messaging

* fix SMS invite on empty inbox

This code appears in two contexts - (1) in an empty inbox , where no other view
controller is presented, and (2) in compose interface where a
search controller is presented, and must first be dismissed.

* only check SMS sending ability directly, (not device model)

This is better because:
1. sometimes iPhones can't send SMS
2. Sometimes iPads/iPods can send SMS

* correct localization key

* bump build

// FREEBIE
2016-05-23 11:39:30 -07:00
Michael Kirk 9bacc3de78 Reset compose view on thread switch (#1187)
* all Signal users can send text messages, never hide texting toolbar.

//FREEBIE

* Fix composition box size when switching threads.

Partial revert of 2c83046ff6 which
introduced a shared reusable message view controller across threads.

2c83046ff6 resulted in several discovered
bugs so far (#1179, #1150, #1152, and maybe: #1146). It's pretty clear
at this point we're going against the grain of how
JSQMesageViewController is intended to be used, and since the nominal
purpose of this feature (iPad Layout) doesn't exist, we should revert to
the known good way of interacting with the MessageViewController,
creating a fresh instance per thread.

// FREEBIE
2016-05-17 09:38:49 -07:00
Michael Kirk da6597118a Fix unable to send invite via sms (#1188)
* bump release

//FREEBIE

* fix invite over sms alert

Could not present the sms invite alert controller because we were
already presenting the UISearchController

FIXES: #1182

// FREEBIE
2016-05-16 15:52:11 -07:00
Michael Kirk 496f8117f9 Update translations (#1172)
* Update translations (4 new translations!)

*New Translations*

- Persian (fa) (100%)
- Indonesian (id) (82%)
- Macedonian (Macedonia) (mk_MK) 100%
- Shona (sn) 98%

Inluded a script to pull translations that are >=80% complete

80% is completely arbitrary, but nicely bisects the current translation
efforts which fall into buckets of "over 80%" and "under 50%."

// FREEBIE

* final tx pull before push source

//FREEBIE

* tx pull, after updating source (plus some eager beavers already pushed new translations)

iStringVerify passes

* Make "add person" label more i18n flexible

This accommodates (e.g.) Italian, which was being truncated.

// FREEBIE

* Galician localization

Moitas grazas xesusmosquera!

// FREEBIE

* i18n for Unarchive action

started leaving hints for our translators. These are currently manually
redundantly duplicated in the source/strings file, in hopes of a more
automated future with genstrings.

// FREEBIE

* include iStringsVerify check in update-translations script

and pull latest translations after including UNARCHIVE action
// FREEBIE

* i18n GROUP_MEMBERS_HEADER

//FREEBIE

* pull translations
2016-05-08 17:17:37 -07:00
Michael Kirk 7f022404d1 [UI] smaller group action menu icon, revert edit divider to neutral color (#1169)
* Group actions bar button image was too big

Added image inset to resize.

// FREEBIE

* return blue line to neutral gray. (partial revert of 0c1a97a743)

// FREEBIE

* Podfile.lock corollary to updating SSL in b7813bdc9a

// FREEBIE
2016-05-07 09:29:10 -07:00
Michael Kirk 5286c032ce reset "Load Earlier Messages" when switching threads (#1163)
Since we're now re-using the message controller across threads, we have
to reset some elements to their initial state when switching threads.
Missed this one.

Fixes: #1150

// FREEBIE
2016-04-26 18:57:55 -07:00
Ronny f05429b594 Prevent skewed group image (fixes #756) (#1159)
* Prevent skewed group image (#756)

- fixes #756

//FREEBIE

* Prevent skewed group image in inbox view (#756)

- fix skewed inbox view image
- fixes #756

//FREEBIE
2016-04-22 12:34:09 -07:00
Michael Kirk 752b0fecab Bloom filter migration: check for file before deleting (#1147)
- Extracted migration method
- added some logging

// FREEBIE
2016-04-18 11:17:08 -07:00
Michael Kirk 9f572881f8 * Cache cleaning uses YAP notificationsThis way we don't have to worry about cleaning the cache explicitlywhen we do destructive actions.// FREEBIE
* Cache cleaning uses YAP notifications

This way we don't have to worry about cleaning the cache explicitly
when we do destructive actions.

// FREEBIE
2016-04-18 10:07:35 -07:00
Michael Kirk 95ab3d677c must *always* be in main thread when dismissing view controller. (#1114)
Fixes intermittent crash when uploading new group photos.

// FREEBIE
2016-04-13 15:26:50 -07:00
Michael Kirk 5869fb8e06 Fix ability to attach photos from camera (#1112)
* Fix ability to attach photos from camera

Looks like this came about with the animated GIF handling. We'll only
go down the byte-comparison-mime-type-detecting code path for attaching
existing photos, since it only exists for animated GIFs.

This will also revert to properly compressing our image attachments, so
long as they are taken from the camera.

* Prevent crash when tapping broken image

It never makes sense to present a "full screen" nil image. Previously
this happened when camera-capture was broken, but could conceivably
happen for other as-of-yet unknown reasons.

// FREEBIE
2016-04-13 11:38:42 -07:00
Michael Kirk c0bb704d2d Cache instantiated interactions (#1152)
*most* of our time when scrolling around a message view is in this
method. Doubly so when these are media items.

remove interaction from cache when it is deleted/updated

// FREEBIE
2016-04-13 10:05:09 -07:00
Michael Kirk 7d8292fd53 show alert must happen in main thread (#1119)
//freebie
2016-04-13 08:10:51 -07:00
Michael Kirk fc494d735f Merge pull request #1140 from michaelkirk/fix-screen-protection-image
After removing launch image, we need to update screen security
2016-04-11 16:22:15 -04:00
Michael Kirk 199ce49265 Fix smooshed launch image on iphone 6 by using storyboard instead of static launch image
This is recommended practice for iphone6/+ for iOS>=8

> Although it’s best to use a launch file for iPhone 6 and iPhone 6
> Plus, you can instead supply static launch images if necessary. If you
> need to create static launch images for these devices, use the
> following sizes:

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html

Fixes #1136
Closes #1137
2016-04-08 11:35:29 +02:00
Michael Kirk 721ed066f2 Fixes This class is not key value coding-compliant for the key "keyPath"
Since "Key Path" is the header for run time attributes, my guess is that
this was a click misfire so long ago. I'm not clear if this was ever
causing a crash or just a warning, but we don't want the noise.

Fix "Unbalanced calls to begin/end appearance transitions"

You should not segue while animations are in progress. I'm not sure if
this was causing intermittent crashes or just the warning.

//FREEBIE

Closes #1130
2016-04-08 11:35:29 +02:00
Arek Banas 72e1180e16 Removing unused didReceiveMemoryWarning methods from view controllers.
Closes #1078
2016-04-08 11:35:29 +02:00
Frederic Jacobs 4034baedb9 Adapting to renaming. 2016-04-08 09:47:41 +02:00
Michael Kirk f44393bb74 Re-introduces the delete action.
The delete action became opt-in in JSQMessagesViewController.
Fixes #913
Closes #1104

//FREEBIE
2016-03-27 20:12:29 +02:00
Aayush Ranaut bd377e65af Network Signal and deactivate account row don't highlight.
Related #1026
2016-01-03 20:35:30 +01:00
Frederic Jacobs 2c83046ff6 Closes #990.
- Use single MessagesViewController. Goal: Being able to reuse that UI
for SplitViewController on iPad. Prevents unnecessary deallocations and
re-allocations.
- Remove custom archiving UI for default swipe right to left archive
action, like in iOS Mail.app.
- DynamicType for main view.
- Simplify API of MessagesViewController to prevent undefined behavior.
//FREEBIE
2015-12-26 18:12:13 +01:00
Frederic Jacobs 1b02e186f8 Fixes #146 #147. 2015-12-24 18:52:18 +01:00
Frederic Jacobs a7ec383a7b Fixes #984 Fixes #948.
A future improvement could be to store the usage data in the encrypted
database than in the NSUserDefaults that are more vulnerable to
forensics.
2015-12-24 15:40:50 +01:00
Mahyar McDonald 0c1a97a743 Some nits & add corner rounding to the message text box.
Closes #884
2015-12-24 11:43:24 +01:00
Adam Kunicki da97349d41 Add subtitle to Screen Security setting to explain its function.
Closes #1014
Fixes  #993
2015-12-24 11:26:48 +01:00
Frederic Jacobs 3acc47d6ad Fixes #832 2015-12-23 00:11:03 +01:00
Frederic Jacobs c6d44e59e2 TextSecureKit Refactoring
- Using same clang format file for old and new files.
- Moving out all TextSecure code to allow other clients (OS X, iOS) to
  integrate easily TextSecure functionality.
- Use TextSecure API to signup.
2015-12-22 23:41:10 +01:00
Michael Okner 37b582beda Adding support for animated gifs
Implemented using corbett's suggestion in issue #525. Uses
Flipboard/FLAnimatedImage in an AttachmentAdapter. Detects gifs using
new Animated category in MIMETypeUtil.

Backwards compatible with previous versions of Signal on iOS for both
sending and receiving Gifs, though they are sent/received in older
versions as UIImage and won't animate. Gifs also animate on both ends of
conversations with TextSecure users on Android.

//FREEBIE
2015-11-29 12:59:34 +01:00
Rui 25293fd40b Fixes #957.
Exit button not displaying when scanning fingerprint.
2015-11-29 12:28:04 +01:00
Frederic Jacobs 53793e3c0f Fixes #950 2015-11-29 02:03:52 +01:00
Frederic Jacobs 26f9207cab Bye Bye Bloomfilters
For reasons outlined in
https://whispersystems.org/blog/contact-discovery/ , Signal will no
more use bloom filters for RedPhone contact intersection.
2015-11-29 01:14:49 +01:00
Frederic Jacobs 861e3d6266 Fixes #930 2015-11-03 00:26:48 +01:00
Frederic Jacobs b70be4d559 Fixing bug with reused label appearing bold. 2015-11-02 19:47:55 +01:00
Frederic Jacobs 777e7e16f0 3D Touch: Quick Compose 2015-10-31 23:44:16 +01:00
Frederic Jacobs 0fd9acfb2c Phone emoji 2015-10-31 23:44:16 +01:00
Lilia c4dcb5f807 Fixes #907
Upon receiving a 404 to a prekey request for a particular device D, the client handles that error by removing device D from the recipient's device list, and proceeds to encrypt and send to the remaining known devices.

Reviewed & Patched by @FredericJacobs
2015-10-31 23:44:16 +01:00
Frederic Jacobs a29eb5470f Attachment type in notification and description. 2015-10-31 23:44:15 +01:00
Frederic Jacobs ef6e658c38 Performance updates & smarter layout (2 lines)
- Adding support for ContactsUI when adding contacts on iOS 9.
- Multiple performance updates by liberating the main thread and
reusing tableview cells.
2015-10-31 23:44:15 +01:00
Frederic Jacobs 3d4d4123f7 Removing APNavigation as a dependency. 2015-10-31 23:43:16 +01:00
Frederic Jacobs 8189e593ef Fixes glitching of inbox label when coming back from background.
The method was not called on the main thread, resulting in rendering
issues.
2015-10-31 05:00:05 +01:00
Frederic Jacobs e98a6217fe TLS 1.2 on signaling tcp. 2015-10-31 05:00:05 +01:00
Frederic Jacobs 0ad55853f2 Adding staging environment. 2015-10-31 05:00:05 +01:00
Frederic Jacobs bbde7cd2a8 iOS 9 Support
- Fixing size classes rendering bugs.
- Supporting native iOS San Francisco font.
- Quick Reply
- Settings now slide to the left as suggested in original designed
  opposed to modal.
- Simplification of restraints on many screens.
- Full-API compatiblity with iOS 9 and iOS 8 legacy support.
- Customized AddressBook Permission prompt when restrictions are
  enabled. If user installed Signal previously and already approved
  access to Contacts, don't bugg him again.
- Fixes crash in migration for users who installed Signal <2.1.3 but hadn't signed up
  yet.

- Xcode 7 / iOS 9 Travis Support
- Bitcode Support is disabled until it is better understood how exactly
  optimizations are performed. In a first time, we will split out the
  crypto code into a separate binary to make it easier to optimize the
  non-sensitive code. Blog post with more details coming.
- Partial ATS support. We are running our own Certificate Authority at
  Open Whisper Systems. Signal is doing certificate pinning to verify
  that certificates were signed by our own CA. Unfortunately Apple's App
  Transport Security requires to hand over chain verification to their
  framework with no control over the trust store. We have filed a radar
  to get ATS features with pinned certificates. In the meanwhile, ATS is
  disabled on our domain. We also followed Amazon's recommendations for
  our S3 domain we use to upload/download attachments. (#891)
- Implement a unified `AFSecurityOWSPolicy` pinning strategy accross
  libraries (AFNetworking RedPhone/TextSecure & SocketRocket).
2015-10-31 04:45:55 +01:00
Frederic Jacobs eb94a1114a Fixing issue with message ordering. 2015-09-14 10:23:29 +02:00
Frederic Jacobs c95f190140 Require AddressBook permission.
Signal requires the AddressBook permission to use the app at the
moment. This avoids the edgecases where a user doesn’t allow access to
his address book and then tries to use the app. We’re also doing a
significantly better job at explaining why we need this permission to
the user.
2015-08-24 01:47:25 +02:00
Frederic Jacobs 0090030f3d Adding rating code
We’ve noticed that most people went to the App Store to leave really
bad reviews of the app and it is severely affecting our discoverability.
We will ask for a rating if we see you’ve been using the app for some
time. If you rate the app or decline to rate, that’s fine. We will
never bug you again!
2015-08-24 00:28:50 +02:00
Frederic Jacobs ada07351e1 Support for supportsVOIP attribute.
- Deprecates RedPhone upgrade flow.
- Adds a generic upgrade dialog.
- Upgrades dependencies.
- Reorganizes `TSStorageManager` & TSNetworkManager imports.
2015-08-23 00:00:39 +02:00
Orta Therox 0ab32b80d1 Stop the spinner when registration fails on a RegistrationVC 2015-08-19 14:59:05 -04:00
Frederic Jacobs c4bf4a8f50 Preliminary iOS9 support and upgrading to CocoaLumberjack 2.0 2015-08-14 00:19:29 +02:00
Frederic Jacobs f6c0625c2c Removing unused imported classes.
//FREEBIE
2015-07-27 16:19:08 +02:00
Frederic Jacobs e7328bd673 Upgrading cert pinning & flagging release. 2015-07-27 16:19:03 +02:00
Frederic Jacobs 07abcaf7da Register extra keying material at registration. 2015-07-14 21:55:25 +02:00
Mert Buran 040e4c750b Removing literals and self within block.
declaring constants instead of string literals
avoiding using self within block
removed unused method decleration from header file

Reviewed-by: @FredericJacobs
2015-07-13 13:49:43 +02:00