Commit Graph

28539 Commits

Author SHA1 Message Date
Jim Gustafson
fd4d030d6e Explicitly drop calls filtered by Blocked Contact
This block is the system-level block for the contact. Extends the previous
work dropping calls for Do Not Disturb, where RingRTC is prevented from
sending a Hangup message, which allows other devices to continue ringing.
2022-07-05 15:12:58 -07:00
Evan Hahn
d7b42d9fcc Snooze donation megaphone when sending a gift badge
This snoozes the megaphone as soon as we *might* charge your card, even
if it ultimately fails. Even if that job fails, you probably already
know you can donate.
2022-07-05 13:24:32 -05:00
Evan Hahn
9123074442 Update Pods 2022-07-05 12:24:35 -05:00
Evan Hahn
10254f8486 Remove "intermediates" flag from SDS codegen scripts
A couple of codegen scripts had an `--intermediates` flag. While I was
playing around with this (fixing something else), I noticed that these
flags don't work and cause a crash.

Instead of fixing those bugs, I thought it'd be better to just delete
this flag because I don't think anybody uses it.

Tested this by running `make` in the `sds_codegen/` directory, with
success.
2022-07-05 11:52:00 -05:00
Evan Hahn
9932c16428 Update Pods 2022-07-05 10:46:44 -05:00
Jim Gustafson
6ed5529ad0 Update to RingRTC v2.20.11 2022-07-05 10:41:41 -05:00
Nora Trapp
221f07c55c "Bump build to 5.45.0.2." (nightly-07-02-2022) 2022-07-02 04:01:03 -07:00
Max Radermacher
4ad8230f3d Snooze subscription megaphone after redeeming gift 2022-07-01 17:10:59 -05:00
Evan Hahn
f5556d1857
Use durable job for sending badge gifts
Previously, sending a gift badge was not a durable operation, which
meant that crashes/failures could cause users to have their payment
methods charged without actually sending the badge.

Now, the flow is split up into two steps: non-durable parts before the
charge is attempted, and durable parts afterward.

The high-level flow is:

1. Prepare the payment, which involves a couple of repeatable network
   requests.
2. Enqueue a job with the prepared payment, that:
   1. Charges the payment method (idempotently)
   2. Requests a receipt credential (idempotently)
   3. Enqueues a gift message, and optionally a text message
3. When the job completes, open the conversation in the UI.
2022-07-01 17:10:31 -05:00
Max Radermacher
f7f66d6436
Add support for redeeming gift badges 2022-07-01 14:07:24 -07:00
Max Radermacher
043daeb734 Fix block & report spam toast position
The `bottomBar.height` value includes the layout margin at the bottom,
and the `presentToast` method will count this as well, resulting in the
view being placed too high on devices with a notch/home indicator.
2022-07-01 09:50:12 -07:00
Max Radermacher
5a0719c8cc Fix notification comment typo; avoid forced unwrap 2022-07-01 09:49:26 -07:00
Nora Trapp
2456dde560 "Bump build to 5.45.0.1." (nightly-07-01-2022) 2022-07-01 04:01:00 -07:00
Max Radermacher
4803bc2771 Move header file closer to its implementation file 2022-06-30 15:02:52 -07:00
Max Radermacher
cf2fa3739f Update copy on the first gifting flow screen 2022-06-30 14:18:42 -07:00
george-signal
ab14034d69
Better UX for broken videos. (#4500)
* Change the play button to a crossed out triangle
  if a video is not playable.
* Show a toast if you tap it anyway.
2022-06-30 10:59:34 -07:00
Max Radermacher
f6eee78975 Capitalize “One-time Donation” button text 2022-06-30 10:55:14 -07:00
Evan Hahn
62c8685e87 "Bump build to 5.45.0.0." (nightly-06-30-2022) 2022-06-30 12:28:12 -05:00
Evan Hahn
840ce72be5 Update translations 2022-06-30 12:26:21 -05:00
Max Radermacher
7bef47f356
Use serial queue for SDSTransactable.asyncWrite
The database writes are ultimately serial, so there’s little benefit to
scheduling each of these on its own queue. If another slow-ish write is
already happening, there’s a chance that we may see thread explosion,
with many threads waiting to write to the database.
2022-06-30 08:38:54 -07:00
Nora Trapp
7cd51722c5 "Bump build to 5.44.0.7." (nightly-06-30-2022) 2022-06-30 04:01:00 -07:00
Evan Hahn
6afa158bff Remove unused variable from gifting view controller
I added this in 35c8bb7c9c but it was
never used—I think it was a false start I never removed.
2022-06-29 16:39:59 -05:00
Evan Hahn
0007e9895d Update "one-time donation" bar on badge gift screen 2022-06-29 16:22:20 -05:00
Evan Hahn
18da3305c6 Add tests for SignalMe.isPossibleUrl
No source code changes here, just adding a test.
2022-06-29 15:02:12 -05:00
Max Radermacher
46cacb177e Ignore peek call errors in staging 2022-06-29 14:32:19 -05:00
Sasha Weiss (Signal)
86d9b8ea0a
Remove args always passed as nil that were later unused anyway 2022-06-29 09:19:02 -07:00
Nora Trapp
417884c77a "Bump build to 5.44.0.6." (nightly-06-29-2022) 2022-06-29 04:00:52 -07:00
Max Radermacher
807ea6e034
Simplify …BadgeIds.contains(_:)
There’s no need to use `allCases` -- we can accomplish the same thing
using the automatically-provided `init(rawValue:)` initializer.
2022-06-28 17:15:14 -07:00
Nora Trapp
b85638377e "Bump build to 5.44.0.5." (nightly-06-28-2022) 2022-06-28 04:00:49 -07:00
Max Radermacher
c9fcee9cc3 Clean up incoming reaction processing 2022-06-27 11:10:26 -07:00
Max Radermacher
4976462238 Add missing fields to sync message descriptions 2022-06-27 09:03:47 -07:00
Max Radermacher
11d08f101f
Fix crash when deleting messages from the future
The subtraction operation produces a negative value and causes a crash
in Swift. Allow deleting these messages to match Android’s behavior.
2022-06-27 09:02:04 -07:00
Nora Trapp
fe8459df51 "Bump build to 5.44.0.4." (nightly-06-26-2022) 2022-06-26 04:00:43 -07:00
Evan Hahn
54bcc455b6 Delay gift badge capability check until send time
Previously, we checked capabilities on the "choose gift recipient"
screen. If you had stale profile data, people might _seem_ incapable,
but a later profile refresh would render them capable. We could have
solved this in a few ways, but I matched Android: check the capability
right before sending.

The pseudocode used to be something like this:

```python
def allowed_candidates(all_recipients):
  for recipient in all_recipients:
    if recipient.is_locally_capable:
      yield recipient
```

The pseudocode is now something like this:

```python
def press_donate_button():
  if recipient.is_locally_capable:
    is_capable = True
  else:
    fetch_profile(recipient)
    is_capable = recipient.is_locally_capable

  if is_capable:
    authorize_apple_pay_and_send_badge()
```
2022-06-25 14:43:40 -05:00
Nora Trapp
addc2fa4d4 "Bump build to 5.44.0.3." (nightly-06-25-2022) 2022-06-25 04:00:39 -07:00
Max Radermacher
a8e25ac3b2 Ignore checkpointing errors on launch
These aren’t fatal, so they shouldn’t present the “failed to launch UI”
to the user. This restores the behavior from before 4e535fa7ef.
2022-06-24 22:27:01 -05:00
Max Radermacher
b665e11a17 Fix search bar layout in recipient picker
It computed the search bar’s insets using a view that hadn’t been sized.
2022-06-24 14:48:26 -07:00
Max Radermacher
c84d3988c6 Remove redundant Storage Service assertion
If there aren’t any elements in the array, the `owsFailDebug` a few
lines down will trigger and report the same condition.
2022-06-24 14:10:18 -07:00
Evan Hahn
fd52ce886a Disable force_cast and force_try SwiftLint rules 2022-06-24 16:49:43 +00:00
Evan Hahn
d0c7de494a Computed accessors shold always be in the same order
`get`, then `set`. This fixes violations of [SwiftLint's
`computed_accessors_order` rule][0].

A very mechanical change.

[0]: https://realm.github.io/SwiftLint/computed_accessors_order.html
2022-06-24 09:35:07 -07:00
Evan Hahn
576d854c6f Remove unnecessary break statements
This fixes all of our violations of [SwiftLint's
`unneeded_break_in_switch` rule][0].

[0]: https://realm.github.io/SwiftLint/unneeded_break_in_switch.html
2022-06-24 09:32:34 -07:00
Nora Trapp
a2e8ce13bf "Bump build to 5.44.0.2." (nightly-06-24-2022) 2022-06-24 04:00:37 -07:00
Nora Trapp
477f312c1e Send and receive sync transcripts for story messages 2022-06-24 00:35:31 -04:00
Nora Trapp
b13c7dbfdb Don't include yourself in private story recipients 2022-06-24 00:35:31 -04:00
George Nachman
064c0950d4 Update pods 2022-06-23 20:24:09 -07:00
george-signal
e528ea8824
Add source device to manifest record
* Populate the source device in manifests we create.
* Log the source device in manifests we fetch.
2022-06-23 17:50:44 -07:00
Max Radermacher
e303428216 Don’t allow “Delete for Everyone” for Gift Badges 2022-06-23 10:17:53 -07:00
Max Radermacher
da16b7c392 Convert TSMessageTest to Swift 2022-06-23 10:17:53 -07:00
Evan Hahn
76c8d66702 Use "done" button on gift badge message keyboard
Goodbye "return", hello "done".

Clicking "done" will dismiss the keyboard.
2022-06-23 17:09:57 +00:00
Evan Hahn
9b5fe034f9 Remove unused variable from subscription view
Its last usage was removed in 51247f7d74. I forgot to remove it then.
2022-06-23 17:08:27 +00:00