Commit Graph

715 Commits (ca85fe16846aefa7edb8e31d8b305a7dae764e32)

Author SHA1 Message Date
Michael Kirk fff061ff3f Make sure WebRTC preferences are synced *every* call
This slows the UI, but only for people who have locally opted into
WebRTC calls, and the alternative is that users are likely to have stale
settings the first time a pair of people opt-in.

// FREEBIE
8 years ago
Matthew Chen fe140b0da5 Updated the button icons in the call view’s “remote video” mode.
// FREEBIE
8 years ago
Matthew Chen bc00b87783 Reply to CR.
// FREEBIE
8 years ago
Matthew Chen 9c3ecbc77d Clean up ahead of PR.
// FREEBIE
8 years ago
Matthew Chen d560aa022a Reworked call view’s remote video mode. 8 years ago
Matthew Chen e2d6c574df Fix guard syntax.
// FREEBIE
8 years ago
Matthew Chen 204aeab69c Respond to CR.
// FREEBIE
8 years ago
Matthew Chen ec1f77c630 Polish video calls.
* Send and handle messages around video status.
* Fix handling of callee data channel.
* Fix layout of local video view.

// FREEBIE
8 years ago
Matthew Chen 48ca4fe865 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 0c7f183ac8 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen a65d3b7c4e Add video-related views.
// FREEBIE
8 years ago
Michael Kirk 814aec6cdd Recover CallKit state when remote client fails to hangup
Distinguish between localHangup, remoteHangup, and call failure.

This allows us to put CallKit in the proper state, ready to receive new
calls without having a backlog of phantom calls which haven't been
properly removed.

Note the "call error" occurs at the point ICE fails, which takes a
while. Anecdotally, like 10 seconds, which feels like a long to be
talking into the ether.

I briefly considered failing at 'disconnected', which happens much
sooner, but that's actually a recoverable state. E.g. if you toggle
airplane mode you can see that you bounce into `disconnected` and then
back to `connected`, so I don't think we'd want to fail the call as long
as WebRTC considers it "recoverable".

// FREEBIE
8 years ago
Michael Kirk 6c14f2f500 Fix "Answer" from iOS9 notification doesn't init audio
The removed code was from an older eon. CallService shouldn't be touched
except via the CallUIAdapter since only there is the omnipresent
distinction between CallKit vs. NonCallKit made.

i.e. when the RTCAudioSession get's started depends on the
CallUIAdaptee.

// FREEBIE
8 years ago
Michael Kirk d3e6747499 Merge remote-tracking branch 'origin/master' into feature/webrtc 8 years ago
Michael Kirk 5856e351ae Respect WebRTC calling preference (#1640)
TODO: this is going to be weird when two parties are *just* enabling
webrtc for the first time. We might want to do something as drastic as
refetch contact information before completing the call.

// FREEBIE
8 years ago
Michael Kirk 4e72ab92c8 Prevent session corruption by using a single serial queue for encrypt and decrypt
coordinate SignalProtocol encryption/decryption on a single serial
queue. Previously message sending encrypted on the sending thread, while
message receiving decrypted on the main thread.

// FREEBIE
8 years ago
Michael Kirk a6029f2545 Merge remote-tracking branch 'origin/master' into feature/webrtc 8 years ago
Michael Kirk 6af933c17d Merge branch 'release/2.6.13' 8 years ago
Michael Kirk 333fb6c60f assert on main thread
// FREEBIE
8 years ago
Michael Kirk b2091431dc Fix retain cycle
// FREEBIE
8 years ago
Michael Kirk 87ed662116 Persist AudioService if CallViewController is dismissed
...in response to CR, move the AudioService off of the CallViewController

Adopt multiple observer pattern vs. a singular delegate. Doing so
required implementing some machinery to address the ARC (see:
Weak.swift)

// FREEBIE
8 years ago
Michael Kirk 3ee94d57d9 Only NonCallKit adaptee uses manual ringing
- stop executing ringer code on CallKit which manages ringing for us.
- Organize ringing code more clearly.

// FREEBIE
8 years ago
Michael Kirk 4c23b5e23f Remove dependency on AppAudioManager
Implement speakerphone toggle directly. Previously we were using
AppAudioManager for several things, but this is that last lingering bit.
Much of the AppAudioManager code is based on RedPhone calling, so by
removing the dependency we pave the way to throw that code away.

// FREEBIE
8 years ago
Michael Kirk 4374e431a2 Respect silent switch in and out of app.
// FREEBIE
8 years ago
Michael Kirk a89bde933d Respect silent-switch pre-CallKit
8 Cases considered:

(Silent Switch toggled vs. Silent Switch not-toggled)
x (App in Foreground vs. App in Background)
x (CallKit vs. NonCallKit)

CallKit already does the "right thing"

// FREEBIE
8 years ago
Matthew Chen d4dbe7f44f Disable unused CallKit buttons.
// FREEBIE
8 years ago
Matthew Chen 229d95ecbf Respond to CR.
// FREEBIE
8 years ago
Michael Kirk d6f2fa92a6 remove negative notification
There isn't much the user can do in response to it, and the user will
get a subsequent "new message" notification when the fallback push
triggers.

// FREEBIE
8 years ago
Michael Kirk 907e122d62 Migrate legacy db stored logging preferences to NSUserDefaults
This is part of making sure we can log *before* the DB is initialized.

// FREEBIE
8 years ago
Michael Kirk 2355c74173 fixup condition
// FREEBIE
8 years ago
Michael Kirk 870fb960a2 Start logging earlier in app setup.
Because logging-preference was previously stored on the storageManager
this meant we couldn't possible log anything related to the init'ing the
storage manager.

TODO: migrate old logging preference to use the new NSUserDefaults
setting

// FREEBIE
8 years ago
Michael Kirk 9516ab1106 Bail on startup if DB password is inaccessible
Most likely this would be  because the user hasn't unlocked their device
since last restart.

This behavior existed once before, but the startup ordering is pretty
delicate. So, we're now redundantly checking in SSK in case this
delicate startup logic gets mis-ordered again.

Also fixed the AppDelegate method to check for the proper
applicationState, since it will never be "active" in didFinishLaunching.

fixes https://github.com/WhisperSystems/Signal-iOS/issues/1627

// FREEBIE
8 years ago
Matthew Chen 9e739433c5 Start work on video.
// FREEBIE
8 years ago
Matthew Chen 698b914049 Elaborate logging in app delegate.
// FREEBIE
8 years ago
Michael Kirk dbb29d7d7e Don't require recording permissions until call is ringing.
We do this by manually managing the RTCAudioSession.
Unfortunately to do this we have to include a couple of RTC headers not
exported by the default build of WebRTC.framework (see: Libraries/WebRTC)

// FREEBIE
8 years ago
Michael Kirk 0797df19b9 Only update label on timer
The rest of the UI only changes on Call.state change.

// FREEBIE
8 years ago
Michael Kirk 0072ee3033 Ensure a stale peerConnectionClient doesn't call any methods on the CallService
Nil delegates when terminating call

// FREEBIE
8 years ago
Michael Kirk 32789bd960 Move RTCDataChannelDelegate to PeerConnectionClient
- minimizes CallService exposure to WebRTC

// FREEBIE
8 years ago
Michael Kirk 8998853aff Move RTCPeerConnectionDelegate to PeerConnectionClient
This makes sense as PeerConnectionClient is our interface to WebRTC

- Makes it easier to test PeerConnectionClient and CallService
- Allows us to shrink CallService class a bit (it's huge)

// FREEBIE
8 years ago
Michael Kirk bd65dc6ba7 Fallback TURN servers if we can't get them from the server for some reason
// FREEBIE
8 years ago
Matthew Chen 1898b9fa19 Merge branch 'charlesmchen/fixWebsocket' into feature/webrtc 8 years ago
Matthew Chen ada6da9506 Fix merge.
The changes to SignalCall must have been lost as I tried to apply swift lint to them.

// FREEBIE
8 years ago
Matthew Chen a023d02ae2 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen cb3f564446 Fix web socket issue.
// FREEBIE
8 years ago
Matthew Chen 1e80946a93 Add call duration to call view.
// FREEBIE
8 years ago
Matthew Chen 654bdb1a85 Add WebRTC setting.
// FREEBIE
8 years ago
Matthew Chen 071fc4ddc8 Improve buttons in call view.
// FREEBIE
8 years ago
Matthew Chen 19633a9f61 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 9df5cebfc3 Update the call view icons and refine the layout.
// FREEBIE
8 years ago
Matthew Chen 92eb2f6148 Update the call view icons and refine the layout.
// FREEBIE
8 years ago
Matthew Chen ee5682165d Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 09c2e27e41 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen c6de676018 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 4a65a88512 Rework new call view.
// FREEBIE
8 years ago
Michael Kirk 469bff5734 Make call delegate weak
// FREEBIE
8 years ago
Michael Kirk 1ed39976ee make public protocol method implementations public
responding to CR

// FREEBIE
8 years ago
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
8 years ago
Michael Kirk fc6da05259 remove some dead code
Related to an earlier failed attempt of reconciling CallKit audio
management with WebRTC's.

// FREEBIE
8 years ago
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
8 years ago
Matthew Chen 98e087a47f Fix font lookup on iOS before 8.2.
// FREEBIE
8 years ago
Matthew Chen 740aa643be Add method to flush logs.
// FREEBIE
8 years ago
Michael Kirk c7449db289 remove stubbed audio manager implementation until it's clear what to do
with it.

// FREEBIE
8 years ago
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
8 years ago
Michael Kirk ce3780e44a Wip smashign providerdelgate into UIAdaptee 8 years ago
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
8 years ago
Michael Kirk f9b44c8892 Added CallService documentation
// FREEBIE
8 years ago
Michael Kirk 602a5953f2 respect silence switch for incoming ringing
// FREEBIE
8 years ago
Michael Kirk 57ad7a2808 cleanup 8 years ago
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
8 years ago
Matthew Chen 6106326b34 Update to reflect changes in SSK https://github.com/WhisperSystems/SignalServiceKit/pull/85.
// FREEBIE
8 years ago
Thomas Guillet d7b27a4021 Refactor ContactsPicker to show a clean search bar
* Replace UITableviewController to UIViewController
* Create a custom xib file
8 years ago
Matthew Chen 2ce4d39f9e Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 2dac6c888a Update SignalServiceKit pod.
* Fetch messages when app becomes active.
8 years ago
Michael Kirk a636f0b6af Redphone works on ipv6 only network
// FREEBIE
8 years ago
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
8 years ago
Michael Kirk ba4569f5bd delete unused code
//FREEBIE
8 years ago
Michael Kirk ddba843d44 Censorship circumvention in Egypt and UAE
* domain fronting
* non-websocket message fetching

// FREEBIE
8 years ago
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
8 years ago
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
8 years ago
Michael Kirk 727fb70806 Fix show error message when download fails
Previously we had our "queued" and "failed" logic backwards.

// FREEBIE
8 years ago
Thomas Guillet 97500d55ec Prevent iRate mechanism when handling local notifications 8 years ago
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
8 years ago
Michael Kirk e7bc2e86db Show email as name when contact has no name
// FREEBIE
8 years ago
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
8 years ago
Josh Schneier 89730f2b85 Improve accessibility a bit 8 years ago
Michael Kirk c1ab36576e Fix crash when attaching media
Seems these crashes were introduced when transitioning from
DJWActionSheet -> UIAlertController

// FREEBIE
8 years ago
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
9 years ago
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
9 years ago
Michael Kirk 8211d4584f Don't explode when missing first name
// FREEBIE
9 years ago
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
9 years ago
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
9 years ago
Thomas Guillet e58de07af7 Prevent going to the "Background Notifications" when tapping "Notification Sounds" 9 years ago
Michael Kirk e6f0130f35 Fix peek from inbox (#1509)
fixes #1506

// FREEBIE
9 years ago
RiseT f29a0fe49b Change safety number strings to be singular
// FREEBIE
9 years ago
Michael Kirk 942353cba2 Fix crash on "show safety numbers" in group thread
// FREEBIE
9 years ago
Michael Kirk 5a0141003d "No Contacts" screen uses new invite flow
fixes #1501

// FREEBIE
9 years ago
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
9 years ago
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
9 years ago
Josh Schneier 896dd026d2 Remove DJWActionSheet 9 years ago
Josh Schneier f686fc9a87 Style refactor to reduce rightward drift
// FREEBIE
9 years ago
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
9 years ago
Michael Kirk f9a60b622d Use cleaner signal link in invite email
// FREEBIE
9 years ago
Michael Kirk 7120ca1192 Make sure we're laying out contact cell after assigning avatar
// FREEBIE
9 years ago
Michael Kirk 2bac3e4280 Better fit for "delete account" button on iPhone5
- move invite button faaaaaaaar away from the "delete account" button.

// FREEBIE
9 years ago
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
9 years ago
Michael Kirk bed5250397 remove redunant method
// FREEBIE
9 years ago
Josh Schneier c0c71fe261 Switch back to the default keyboard after sending 9 years ago
Michael Kirk 584118a9fc compare safety numbers with clipboard (#1475)
* Compare safety numbers with clipboard

// FREEBIE
9 years ago
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.
9 years ago
Igor Ranieri Elland e67af9d52b Make settings modal.
- Issue raised in #1453.
9 years ago
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
9 years ago
Russ Shanahan 087f753979 Voiceover fix- Do not read "no messages" text when it's hidden (#1437) FREEBIE 9 years ago
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.
9 years ago
Michael Kirk 88d9ef987f Share dialog for Safety Numbers
// FREEBIE
9 years ago
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
9 years ago
Michael Kirk c5be8f2d88 Don't include phone number in scannable safety number QR code
also fixes #1455

// FREEBIE
9 years ago
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
9 years ago
Michael Kirk fbcf5fbf07 Properly assign global contacts updater to environment
broken in 33f6a95520

// FREEBIE
9 years ago
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
9 years ago
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
9 years ago
Michael Kirk 01a3ef015f Don't show permissions pop-up until user has seen contact disclaimer (#1456)
// FREEBIE
9 years ago
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
9 years ago
Michael Kirk 28a2a4610c Fix compiler warnings.
// FREEBIE
9 years ago
Michael Kirk 4c5bc1ed6f Fix fingerprint Label copying
failed to update storyboard when class was renamed.

// FREEBIE
9 years ago
Michael Kirk 23c80748e6 Hide safety numbers until you've exchanged keys
// FREEBIE
9 years ago
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
9 years ago
Jarosław Pawlak c152c1c83a asking for camera permissions #1363 9 years ago
Michael Kirk 1bf77e8261 dismiss keyboard when showing corrupted message actionsheet
otherwise the keyboard covers the actionsheet.

// FREEBIE
9 years ago
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
9 years ago
Michael Kirk ddf0890408 Fix crash on nil message
// FREEBIE
9 years ago
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
9 years ago
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
9 years ago
Michael Kirk 62f9606bf5 Merge branch 'mkirk/fix-registration-without-background-modes#1329'
// FREEBIE
9 years ago
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
9 years ago
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
9 years ago
Michael Kirk bae050480a Debug logging around call init crash.
// FREEBIE
9 years ago
Michael Kirk ac996db258 Merge pull request #1407 from mdouglass/fix-issue-1270
Unifies bubble sizes for media bubbles

// FREEBIE
9 years ago
Mike 7c6b84c46b Outgoing message sound respects Settings toggle (#1373) 9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
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
9 years ago
Michael Kirk 7c32259a92 We aren't using ErrorMessage/InfoMessage. (#1412)
We incorrectly assumed some parameters were these types, but actually
they were TSMessageAdapters.

// FREEBIE
9 years ago
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
9 years ago
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.
9 years ago
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
9 years ago