Commit Graph

30048 Commits

Author SHA1 Message Date
Evan Hahn
9d9f1b79f2 Remove final references to the word "gift"
Copy changes.

Many of these changes change the string's key and comment, but not the
actual string.
2023-01-12 12:42:32 -06:00
Evan Hahn
901c1d33ea Gifting: harden against bad data
Before this change, if an outgoing gift message somehow had multiple
recipients, we'd crash. This could cause the whole app to become
unusable.

This should be impossible, but let's guard against it in case there's a
bug.
2023-01-12 12:13:11 -06:00
Evan Hahn
b71ea7f208 Add a few simple SwiftLint rules
This adds the following rules:

- [`comma_inheritance`][0]: enforces usage of commas to separate types
  in inheritance lists
- [`empty_string`][1]: prefers `str.isEmpty` over `str == ""`
- [`sorted_first_last`][2]: prefers `min()` or `max()` over
  `sorted().first` or `sorted().last`

No code changes were required.

[0]: https://realm.github.io/SwiftLint/comma_inheritance.html
[1]: https://realm.github.io/SwiftLint/empty_string.html
[2]: https://realm.github.io/SwiftLint/sorted_first_last.html
2023-01-12 12:13:00 -06:00
Max Radermacher
1311d3f665
Refactor contact access code
Split it based on whether the purpose is “editing” or “sharing”. If
we’re editing, it generally means we have full access to contacts, and
that we’ve checked which of the contacts are registered on Signal. If
we’re “sharing”, we don’t care whether or not they’re registered.

If we’re “sharing”, we check whether or not we’ve prompted for the
contacts permission yet. If not, we’ll show the prompt.

If we’re “editing”, we assume we’ve already prompted (which is already
the case today), so `.notDetermined` isn’t a possible state.

Other things to note:

- The `supportsContactEditing` was always true, so it’s been removed.

- The error when contacts access isn’t allowed is now shown more
  consistently. Previously, it was sometimes shown in response to
  initializing a view controller.

- Some RecipientPickerViewController code was moved from Obj-C to Swift.
  This is probably useful on its own, but it’ll also make it easier to
  build some new UI in subsequent commits.
2023-01-12 09:55:30 -08:00
Harry
99d2cda9c0
Send SKDM to message recipients without stored session data
* Send SKDM to message recipients without stored session data

* update comment formatting
2023-01-12 09:00:55 -08:00
Max Radermacher
1fc353d8fc "Bump build to 6.9.0.0." (nightly-01-11-2023) 2023-01-11 18:15:28 -08:00
Max Radermacher
e422852f2c Update release notes & translations 2023-01-11 18:14:57 -08:00
Igor Solomennikov
f264b4b70d
Improvements for "Media Review" screen.
* Enable zooming for photos and videos.
* Shrink media when keyboard is up.
* Fix minor animation issues on iPad.
* Fix "Add Message" placeholder not fading out properly.
2023-01-11 16:22:40 -08:00
george-signal
fb3225c9fb
Run synchronous mutations ahead of all async mutations. 2023-01-11 15:48:38 -08:00
Igor Solomennikov
e8788abc19
Fix vertical alignment of text in chat input bar. 2023-01-11 15:27:33 -08:00
Evan Hahn
28a52397d7
Let internal users copy subscriber ID 2023-01-11 13:05:16 -08:00
Evan Hahn
f2c218edca
Use new copy for in-chat gift messages
This required plumbing the other person's "short name", which is the
most significant code change.
2023-01-11 14:18:48 -06:00
Evan Hahn
4aa6524284
Use new preview text for gift messages
* Use new preview text for gift messages

I also moved the logic to Swift.

* PR feedback
2023-01-11 11:26:47 -08:00
Max Radermacher
570e591ae3 Fix nav bars during registration & change number
The new OWSNavigationController design handles showing/hiding the nav
bar. The code in this class was fighting against it, which caused the
nav bars to appear/disappear unexpectedly throughout the process.

The vc.navigationController.navigationItem.backBarButtonItem.isEnabled
code also appears to be a no-op. A view controller should configure its
own navigationItem (ie vc.navigationItem), not that of its
navigationController. Furthermore, backBarButtonItem isn't set to what's
actually shown -- this is an opportunity to override what should be
shown to our own custom button.
2023-01-11 09:44:46 -08:00
Max Radermacher
578862f04b Fix onboardingMode assignments & checks
The OnboardingModeSwitchConfirmationViewController bases all of its UI
and behavior on the default mode for the current device. As a result,
the “toggle” behavior is wrong -- it should always override the mode.

Furthermore, if you back out of the override view controller and tap the
normal “Continue” button, that should use the default mode (because you
haven’t gone through the flow to confirm the overridden mode).
2023-01-11 09:43:29 -08:00
Evan Hahn
0adb0f2fab
Update text on gifting "thanks" sheet 2023-01-11 08:55:19 -08:00
Evan Hahn
186eff2152
Update copy on first badge gifting screen
Just a couple of string changes.
2023-01-11 08:54:37 -08:00
Evan Hahn
3db06c1a7a
Allow gift badge sending in debug builds
This will make it easier to test gifting.
2023-01-11 08:52:34 -08:00
Evan Hahn
3c4aa01ebd
Update copy for gift badges on donation settings screen
"Gift a Badge" is now "Donate for a Friend".
2023-01-11 10:00:24 -06:00
Evan Hahn
46b4cb7fae Update gift badge copy on badge expiration sheet 2023-01-11 09:44:59 -06:00
Evan Hahn
1ebb11c9ee Update gift badge strings on redemption sheet
A small number of things moved around, too. For example, we no longer
need the sender's full name—just a short name.
2023-01-11 09:43:17 -06:00
Evan Hahn
c7638d1efe Use new copy on gifting confirmation screen
This removes the word "gift" from the confirmation screen (except the
server-provided value, which may have changed by the time you read
this), replacing it with things like "donate for a friend".

This is mostly a copy change, with one bit of text removed entirely.
2023-01-11 09:40:32 -06:00
automated-signal
dcab94bafb "Bump build to 6.8.0.5." (nightly-01-11-2023) 2023-01-11 04:00:26 -08:00
Max Radermacher
386ca8a006
Simplify InviteFlow 2023-01-10 18:45:48 -08:00
Jordan Rose
8f97bdb6b4 Group calls: handle when a ring is cancelled before the call appears
Otherwise we could leave the incoming call screen up even though the
ring was cancelled (reflected in the CallKit ring stopping).
2023-01-10 17:27:29 -08:00
Max Radermacher
08a7774fc6
Fix web socket normalClosure on iOS 13 2023-01-10 17:26:18 -08:00
Max Radermacher
907b6cb02d Require transaction when updating address mappings 2023-01-10 16:31:31 -08:00
Max Radermacher
07a7478d57 Remove redundant cache removal operation
We do the same operation 1.5 times. We only need to do it once.
2023-01-10 16:31:31 -08:00
Max Radermacher
fb7b6d80f2 Fix SignalServiceAddress hashValue debug check 2023-01-10 16:31:31 -08:00
Max Radermacher
3c6d3e8adb
Fix web socket error reporting after handshake
If we hit an HTTP error during the handshake, we’ll get back a
badServerResponse error, and the `response` will indicate the error.

If we run into some other error later in the process, we’ll get back a
non-badServerResponse error, but the `response` will still be set based
on the most recent HTTP response (ie HTTP 101 Switching Protocols),
which isn’t actually the error that occurred.
2023-01-10 16:27:25 -08:00
Evan Hahn
9782dfcec4
Gifting: show more info about disappearing messages
This adds a string like this to the badge gifting flow:

> Disappearing messages are turned on for this chat. Your donation
> message will disappear in 8 hours.

Because this disrupts the table view, we need to fully re-render its
contents when the disappearing messages timer changes. That required
some refactoring, and also let us remove some instance variables.
2023-01-10 15:04:05 -08:00
Igor Solomennikov
bcdb996993 Fix an issue where message context menu would appear unexpectedly.
Delete the code that would allow "long tap to show context menu" gesture to be
recognized simultaneously with scroll view's pan gesture. That would cause
message context menu to appear whenever user would stop inertia scrolling with
a tap and keep the finger on the screen.
2023-01-10 14:58:31 -08:00
Max Radermacher
a283045058 Improve collation methods in ContactsPicker 2023-01-10 14:43:09 -08:00
Evan Hahn
f4530c0438
Use new copy for donation receipt titles
"Gift" is now "Donation for a Friend".
2023-01-10 15:41:32 -06:00
Harry
b3136fb42c
Call Disposition
* Add CallEvent sync message proto

* Add CallRecord class and db table

* Renames and comments for clarity

* create and update CallRecord from local device call events

* Handle incoming call event sync messages

* Add outgoing call sync event piping

* Send call event sync messages

* Handle call record sync messages before the app is launched

* Mark TSCall interactions as read and update their status when getting call event sync messages

* Prevent CallKit race conditions by checking state before creating TSCall interactions

* Update chat call event text for unanswered and declined calls

* Remove incorrect debug assert which fires every time a call is missed in the background

* PR comments, mostly nits

* convert old debug assert into a log + task comment

* nit

* Update copy for in chat call logs

* Smaller PR comments

* Add foreign key to CallRecord's interactionUniqueId

* Update write transaction ordering comment

* run genstrings

* fix strings
2023-01-10 11:48:46 -08:00
Max Radermacher
9528ac2c8e Don’t send pre key fetches via web socket
This was added in ab6c4a4c36, but the
server deosn’t support "v2/keys" via web socket, so the web socket
requests always fail and fall back to the REST endpoint.
2023-01-10 11:37:52 -08:00
Max Radermacher
566d39d215 Remove hasWebsocketSendFailed
This was added Oct 5, 2018 (a697072271).
As of Oct 19, 2018 (2894db0d6e), it’s no
longer read, so the assignments aren’t necessary.
2023-01-10 11:37:52 -08:00
Evan Hahn
f3b8ded89f
Show "choose payment method" sheet for gift badges
We plan to support PayPal and credit/debit cards for gift badges. This
change, invisible to external users, is a step towards that.

Before this change, Apple Pay was always shown as the only payment
method. Now, all supported payment methods are shown.

PayPal and card don't do anything right now—they show an error UI if
tapped.
2023-01-10 13:35:05 -06:00
Sasha Weiss
f4af994294
Move boost payment requests to extension in own file 2023-01-10 11:32:15 -08:00
automated-signal
06382e44fb "Bump build to 6.8.0.4." (nightly-01-10-2023) 2023-01-10 04:00:29 -08:00
Evan Hahn
8f873dcdaa Remove unnecessary donation view, inline it
This change should have no user impact.

`DonateInfoSheetHeaderView` was used in two places: the "choose payment
method" sheet and the "confirm PayPal donation" sheet. However, the
latter was removed in 3404ababe5, meaning
this view was only used in one place.

For clarity, this moves it back into the "choose payment method" sheet
and removes the special view. It is a partial revert of
dc3e588f64.
2023-01-09 16:32:02 -06:00
Evan Hahn
00f71434f6 Update string comments to reflect usage
This change should have no user impact.

A few donation strings were used in two places: the "choose payment
method" sheet and the "confirm PayPal donation" sheet. The string
comment reflected this.

However, the latter sheet was removed in
3404ababe5, so we can update the comments.
2023-01-09 16:32:02 -06:00
Max Radermacher
751f551e79 Don’t use serviceIdentifier for Contacts 2023-01-09 12:01:34 -08:00
Max Radermacher
fd3457b9a5 Update sending flow to use UUIDs 2023-01-09 12:00:51 -08:00
Max Radermacher
6c2eabaacb
Only use ACI when fetching pre keys 2023-01-09 12:00:07 -08:00
Max Radermacher
cbb7b07329 Make ContactCell conform to ReusableTableViewCell 2023-01-09 11:59:10 -08:00
Jordan Rose
1fc5a5ff5a Don't tell CallKit that calls missed when offline have ended
...because we never told CallKit that such a call *started*.
2023-01-09 10:17:50 -08:00
Jim Gustafson
4005d14ead Update to RingRTC v2.23.0 2023-01-09 09:46:37 -06:00
automated-signal
b3a0344904 "Bump build to 6.8.0.3." (nightly-01-07-2023) 2023-01-07 12:37:24 -08:00
george-signal
955680d635
All media optimizations. 2023-01-06 16:42:37 -08:00