Commit graph

174 commits

Author SHA1 Message Date
Michael Kirk bbfd9ba74d Place Signal/Redphone calls from system contacts
// FREEBIE
2017-02-01 18:56:37 -05:00
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
2017-01-27 14:33:12 -05:00
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
2017-01-25 11:41:30 -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
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
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 942353cba2 Fix crash on "show safety numbers" in group thread
// FREEBIE
2016-11-30 15:04:26 -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
Josh Schneier c0c71fe261 Switch back to the default keyboard after sending 2016-11-21 11:37:57 -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
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 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 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 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 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
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
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 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 da82c01f6e Restart timer animation when returning from background
// 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 85beb93e86 Style timer changes less alarmingly.
// 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 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 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 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 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 428f7fca19 Adapt to nullability annotations in SignalServiceKit
// FREEBIE
2016-09-06 15:57:44 -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 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