Commit Graph

28586 Commits

Author SHA1 Message Date
Max Radermacher
2bde76e85d Persist outgoing gift open status
Also send viewed receipts to linked devices when opening them, and
handle viewed receipts when other devices open them.
2022-07-12 14:34:02 -07:00
Max Radermacher
d756a7c4d1 Avoid setters that don’t read newValue
This fixes our violations of [SwiftLint's `unused_setter_value`
rule][0].

[0]: https://realm.github.io/SwiftLint/unused_setter_value.html
2022-07-12 13:39:43 -07:00
Max Radermacher
0b6794608e
Add gift wrap & animations 2022-07-12 13:16:11 -07:00
igor-signal
c64320e75b
Improve crop view presentation.
Keep image center intact when transitioning to/from crop view to
eliminate unpleasant "jump".
2022-07-12 12:03:55 -07:00
Sasha Weiss (Signal)
98151dfd0d
Don't need transactions to build group models 2022-07-12 10:23:12 -07:00
Nora Trapp
ef695798e3 "Bump build to 5.46.0.5." (nightly-07-12-2022) 2022-07-12 04:00:14 -07:00
Max Radermacher
eda1bc21d7 Remove unused activeComponentKeys() 2022-07-11 16:43:03 -07:00
Max Radermacher
47e75ab251 Put @objc on the line before let variables
This fixes our violations of [SwiftLint's `attributes` rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
2022-07-11 16:40:48 -07:00
George Nachman
4420dceb7d Update pods 2022-07-11 14:45:27 -07:00
george-signal
80565fb43f
Revert "Remove GRDB's memory management. (#4521)" (#4546)
This reverts commit a202f6204e.

It also uses the new facility in GRDB to disable
automatic memory management.

For context see:
https://github.com/groue/GRDB.swift/pull/1253
2022-07-11 14:37:29 -07:00
Nora Trapp
c8f386b13a PR Feedback 2022-07-11 10:23:06 -07:00
Nora Trapp
4aae9b4eb1 Allow configuring who can view 'My Story' 2022-07-11 10:23:06 -07:00
Evan Hahn
bf8fd72fba
Improve Accept-Language header value, fixing registration bug
Some users [are unable to register][1] because the server [returns a 400
error][2] if passed an invalid `Accept-Language` header.

This commit helps prevent two possible error modes:

- Filters out invalid language tags. Some users reported a "Workshopx"
  language, which the server would reject because it's syntactically
  invalid. Deleting this language (at the OS level) let them register.
- If no languages are valid, we should send `*` instead of the empty
  string. There's no evidence that this happened in practice.

In addition, this commit:

- Adds tests.
- Sends a maximum of 10 languages instead of 6.
- Omits the `q` value when it's 1 because [that's the default][3].
- Marginally improves performance by iterating lazily.

[1]: https://github.com/signalapp/Signal-iOS/issues/5261
[2]: bf6d3aa324/service/src/main/java/org/whispersystems/textsecuregcm/controllers/AccountController.java (L271-L275)
[3]: https://www.rfc-editor.org/rfc/rfc9110.html#section-12.4.2

Co-authored-by: Nora Trapp <nora@signal.org>
2022-07-11 12:20:24 -05:00
Nora Trapp
abdcec9c14 "Bump build to 5.46.0.4." (nightly-07-09-2022) 2022-07-09 04:00:26 -07:00
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