Commit Graph

28572 Commits

Author SHA1 Message Date
Max Radermacher
68ca93408c Fix outgoing gift message reply border width 2022-07-08 22:30:46 -07:00
Igor Solomennikov
f9e124145a [Media Editor] Don't slide buttons on the bottom when drawing and moving text.
Only slide buttons on-/off-screen when entering/leaving image editor.
2022-07-08 22:21:21 -07:00
Sasha Weiss (Signal)
ac341fdbbc
DRY out V2 group updates 2022-07-08 15:47:45 -07:00
Evan Hahn
64462ac1b0 Save a receipt when you send someone a badge
This commit:

1. Adds a new donation receipt type: gifts.
2. Saves receipts when sending someone a gift.

The first part was the main challenge. Previously, donation receipts had
logic like this (pseudocode):

     def getReceiptType(self):
       if self.subscriptionLevel:
         return "subscription"
       else:
         return "one-time"

Now, we explicitly encode the type and have logic to handle "legacy"
receipts that don't have a type encoded.
2022-07-08 13:17:30 -05:00
Evan Hahn
2598ab4275 Fix localizable strings
In 7f4a5f3f7b, we accidentally (1)
re-added the `BOOST_VIEW_AMOUNT_LABEL` key (2) removed the
`BLUR_TOOLTIP` key.

This fixes those issues.
2022-07-08 08:41:41 -05:00
Max Radermacher
ed63a2aeac
Remove trailing comma
This fixes our violation of [SwiftLint's `trailing_comma` rule][0].

[0]: https://realm.github.io/SwiftLint/trailing_comma.html
2022-07-08 08:39:47 -05:00
Nora Trapp
c9c37e2c16 "Bump build to 5.46.0.3." (nightly-07-08-2022) 2022-07-08 04:00:23 -07:00
Evan Hahn
951f5c3708 Remove trailing whitespace
This is a whitespace-only change that fixes a SwiftLint violation.
2022-07-07 17:39:05 -07:00
Evan Hahn
57c47ced2c Fix operator_whitespace SwiftLint violations
This fixes violations of [SwiftLint's `operator_whitespace` rule][0].
This is a whitespace-only change.

[0]: https://realm.github.io/SwiftLint/operator_whitespace.html
2022-07-07 17:38:38 -07:00
Igor Solomennikov
70f4ab3fab [Media Editor] Do not wrap image editing tool VCs in a nav controller.
Two VCs: photo editor and crop view don't need a UINavigationController
and are fine presented as is.

Also remove unused `completion` parameter.
2022-07-07 15:38:25 -07:00
sashaweiss-signal
b9d3992323 "Bump build to 5.46.0.2." (Internal) 2022-07-07 13:33:18 -07:00
Igor Solomennikov
72d47eba28 Temporarily remove Sticker button from the media editor. 2022-07-07 13:13:53 -07:00
igor-signal
bf2ce630d9
Fix layout of mention picker in media editor's Review screen. 2022-07-07 11:42:05 -07:00
Evan Hahn
e25772183d Prefer foo != nil to _ = foo
This fixes our violations of [SwiftLint's `unused_optional_binding`
rule][0].

[0]: https://realm.github.io/SwiftLint/unused_optional_binding.html
2022-07-07 11:09:00 -07:00
Max Radermacher
369118b045 Add support for replying to gift messages 2022-07-07 10:49:20 -07:00
Max Radermacher
ea0986b676 Parse gift badges on incoming sync messages
This allows outgoing gift messages from other devices to be shown.
2022-07-07 10:46:50 -07:00
Max Radermacher
4fb4c29c80 Don’t coalesce viewed receipts 2022-07-07 10:46:37 -07:00
Igor Solomennikov
ef1a56a299 Media Editor: Improved layout in for tall images (eg screenshots).
Fixes an issue where image would be displayed under bottom toolbar.
2022-07-07 08:37:34 -07:00
Igor Solomennikov
44b8cacce9 Disable insetsLayoutMarginsFromSafeArea in RoundMediaButton.
This is done to prevent incorrect layout when moving buttons off-screen
in ImageEditorBottomBar.

All instances of RoundMediaButton always have a fixed size and there are
no cases when it would be necessary for button's layoutMargins to include
safe area (which is inherited from the superview).
2022-07-07 08:37:34 -07:00
Igor Solomennikov
2fd17eda12 Animate controls on the crop screens in and out.
This change also fixes a bug when bottom buttons in the crop screen
were not visible. That happened because ImageEditorBottomBar by default
had its controls hidden (with the intent that they are animated in once
view controller's view is visible). That was a poor design choice on my
end and is fixed in this commit.
2022-07-07 08:37:34 -07:00
Nora Trapp
3e96e21ccb "Bump build to 5.46.0.1." (nightly-07-07-2022) 2022-07-07 04:00:21 -07:00
Igor Solomennikov
7f4a5f3f7b Merge branch igor/media-editor-updates. 2022-07-06 14:54:26 -07:00
george-signal
a202f6204e
Remove GRDB's memory management. (#4521)
This disgusting hack removes GRDB's notification
center observers, which prevents it from calling
`DatabasePool.releaseMemory()`.

`releaseMemory` is harmful because it places all
future reads behind a dispatch barrier. The effect
is that even very short reads block on any db
reads that precede the barrier. Some of those can
be very slow, such as orphan message handling.

The practical effect of this barrier is that the
main thread gets stuck on what should be a very
quick operation, such as loading your own avatar
data. iOS can kill the app with 8badf00d.

This change is a temporary workaround. A proper
solution has been added to a PR that I sent to
GRDB, which you can see here:

https://github.com/groue/GRDB.swift/pull/1253

Once that is accepted upstream we should update
GRDB and revert this commit.

This change should fix IOS-2474 and doubtless many
other issues.
2022-07-06 13:27:13 -07:00
Evan Hahn
cb387bc031 Explicitly require Xcode 13.2
Instead of it being a minimum version.
2022-07-06 14:59:33 -05:00
Evan Hahn
80369c8cdd Update to macOS 12 on CI
See [the documentation][0] for this macOS version.

[0]: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md
2022-07-06 14:59:33 -05:00
Max Radermacher
10469e29f5 Remove unused descriptionFor… methods
This are unused since things got refactored in ec66f3b21e. It
appears as though `contentDescription` is just called directly rather
than calling these wrappers.
2022-07-06 12:52:58 -07:00
Max Radermacher
09fd1a39d2
Send viewed receipts when redeeming gift badges 2022-07-06 12:39:41 -07:00
sashaweiss-signal
f714d2f11e "Bump build to 5.46.0.0." (nightly-07-06-2022) 2022-07-06 10:50:36 -07:00
sashaweiss-signal
2a0ae59ce8 Update translations 2022-07-06 10:49:35 -07:00
sashaweiss-signal
6761afdcd8 Update release notes 2022-07-06 10:43:29 -07:00
Max Radermacher
1cc8347dd0 Add contentTypeWithThumbnail
This avoids repeating the same code in two places.
2022-07-06 11:40:49 -05:00
Nora Trapp
55770c47f9 "Bump build to 5.45.0.3." (nightly-07-06-2022) 2022-07-06 04:00:31 -07:00
Max Radermacher
0f582e5171 Remove unused OWSQuotedMessageView method
This is unused. Remove it & all the resulting unused code.
2022-07-05 15:29:58 -07:00
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