Commit Graph

28430 Commits

Author SHA1 Message Date
Jordan Rose
5dbbbbfdb0 DebugUI: Fix media message generation
Attachments need to be mapped back to their messages consistently, and
downloaded attachments should be tracked by the MediaGalleryManager
once this is set up correctly.
2022-06-10 10:02:11 -07:00
Evan Hahn
fa5b2281d8 Remove reverse integration script
I don't think we need this script anymore based on our new release process.
2022-06-10 13:56:32 +00:00
Evan Hahn
3925b1fa0c Better error when recipients can't get gift badges
Previously, the error was a generic fallback (and a crash in development). Now, it's a proper message.
2022-06-10 13:56:20 +00:00
Nora Trapp
3724492cb0 "Bump build to 5.42.0.2." (nightly-06-10-2022) 2022-06-10 04:00:51 -07:00
george-signal
ec66f3b21e
Break envelope processing into two parts (#4340)
The purpose of this change is to alleviate the
main source of CPU-grinding after sending a
message to a large group: about 20% of the total
time is spent decoding and re-encoding messages as
they are fetched from the DB and then updated with
info about which recipients have acknowledged
delivery.

Prior to this commit, we decrypted the payload and
then processed the message in a single rather deep
call tree that began in `processNextBatch`. There
are two completely different paths through this
tree that lead to handling a delivery receipt
because server-generated delivery receipts have
the necessary info in plaintext in the envelope
and client-generated delivery receipts have it in
the ciphertext.

The idea here is to break incoming envelope
handling into two parts.

In the first part, each envelope is decrypted and
other common activities (like handling sender key
distribution messages) are performed. A processing
request is created for each. Next, processing
requests are handled. It's easy to examine a
processing request to determine if it is a
delivery receipt, and if so, for what outgoing
message. Doing so allows the new
DeliveryReceiptContext class to cache message
fetches and combine updates to the same message.

Processing requests are grouped together so that
sequential delivery receipt requests enjoy caching
of messages and coalescing of updates into a
single fetch/decode/encode/commit. Other kinds of
envelopes are handled immediately to avoid
increasing memory pressure that caching multiple
messages could cause.
2022-06-09 16:40:34 -07:00
Max Radermacher
d4f290954e
Shift "Cancel" button slightly to the left
This helps avoid accidentally tapping "Cancel" instead of "Send".
2022-06-09 15:28:21 -07:00
Max Radermacher
66a2638edd Don’t attach canceled link previews 2022-06-09 15:10:50 -07:00
Max Radermacher
333758c54f
Pin audio message view size to the entire text box
If we don’t, the text view is visible at larger font sizes.
2022-06-09 15:09:45 -07:00
Max Radermacher
05ed931b10 Convert boost/gift badge constants to an enum 2022-06-09 15:01:22 -07:00
Evan Hahn
5b9f737b46 Fix indentation in ProfileFetcherJob.swift
This is a whitespace-only change.
2022-06-09 16:34:49 -05:00
Ehren Kret
a6c5e0ed52 Ignore .vscode directory 2022-06-09 15:30:35 -05:00
Evan Hahn
5c55278535 Tweak copy for expired Boost badges
If your Boost badge expires but it's not your primary badge, our current
text doesn't make perfect sense.

After some discussion, we settled on the following copy change:

```diff
-Your Boost badge has expired and is no longer visible on your profile.
+Your Boost badge has expired and is no longer available to be displayed on your profile.
```
2022-06-09 15:34:01 +00:00
Nora Trapp
068899127d "Bump build to 5.42.0.1." (nightly-06-09-2022) 2022-06-09 04:00:47 -07:00
Evan Hahn
a80b42adc6 Rename recipient picker delegate argument
You'd expect this argument to signal a boolean return, but it returns a
`RecipientPickerRecipientState`. I renamed the argument to (hopefully)
make it clearer.
2022-06-08 21:21:08 +00:00
Nora Trapp
a106ecdfdd Fix RTL layout of video playback progress bar 2022-06-08 16:58:56 -04:00
Nora Trapp
366fdfec8a Fix voice note RTL layout 2022-06-08 16:58:56 -04:00
Evan Hahn
f88a9f6ede "Bump build to 5.42.0.0." (nightly-06-08-2022) 2022-06-08 15:01:05 -05:00
Evan Hahn
d510e28491 Update translations 2022-06-08 15:00:17 -05:00
Evan Hahn
03dc820b24 Update release notes 2022-06-08 14:37:58 -05:00
Evan Hahn
068a5cc7f2 Run auto-genstrings (because I forgot)
I added this string in 35c8bb7c9c, but
didn't run `auto-genstrings` properly.
2022-06-08 15:30:52 +00:00
Nora Trapp
a83c91ab60 "Bump build to 5.41.0.9." (nightly-06-08-2022) 2022-06-08 04:00:44 -07:00
Evan Hahn
e679707038 Fix SwiftLint shorthand_operator violations
The gist is:

```diff
-foo = foo + 1
+foo += 1
```

Most of the violations were in generated files, so I changed and re-ran the generator.

A few of these violations required implementing some new methods, which I added tests for.

See [the docs for this rule][0].

[0]: https://realm.github.io/SwiftLint/shorthand_operator.html
2022-06-07 14:51:57 +00:00
Evan Hahn
35c8bb7c9c Skeleton UI for sending gift badges
Co-authored-by: Max Radermacher <max@signal.org>
Co-authored-by: igor-signal <98181527+igor-signal@users.noreply.github.com>

The goal of this commit is to build a "skeleton" UI for sending gift
badges.

It's totally possible that I haven't anticipated future changes
correctly, but my goal was to have each future change be a separate,
unrelated commit. For example, we need some logic to determine whether a
recipient has the "giftBadges" capability. That can be done separately
from the commit to send the badge message.

I also added "TODO (GB)" in these spots.

As with many other badge gifting tasks, this is behind a disabled
feature flag, so it should have no user impact.
2022-06-07 14:51:47 +00:00
Nora Trapp
0d0f1ed5df "Bump build to 5.41.0.8." (nightly-06-07-2022) 2022-06-07 04:00:40 -07:00
Evan Hahn
41c4be6b71 Remove useless override
This override stopped being relevant in
c4f967ef46, as far as I can tell.
2022-06-06 14:45:54 +00:00
igor-signal
333f4d18b0
Delete unused play icons
They're not used anywhere.
2022-06-06 14:07:24 +00:00
Evan Hahn
c2e7f0ca93 Prefer implicit getters
_I recommend reviewing this with whitespace changes disabled._

This fixes violations of [SwiftLint's `implicit_getter` rule][0] by
removing explicit getters when an implicit one would do.

[0]: https://realm.github.io/SwiftLint/implicit_getter.html
2022-06-06 14:00:15 +00:00
Evan Hahn
5dbc030359 Fix violations of SwiftLint's closure_parameter_position rule
This commit should just change whitespace.

See [the docs for this rule][0].

[0]: https://realm.github.io/SwiftLint/closure_parameter_position.html
2022-06-06 13:58:23 +00:00
Nora Trapp
81ff2ab419 "Bump build to 5.41.0.7." (nightly-06-04-2022) 2022-06-04 04:00:30 -07:00
Jordan Rose
a97560ac38 Allow OWSOutgoingResendRequest/Response on the Note to Self thread
Otherwise, local threads with linked devices can never be reset via
DecryptionErrorMessages as other threads are.
2022-06-03 16:34:49 -07:00
Jordan Rose
98bf0aafb9 Allow quotes with attachments to be missing thumbnails
And fix the presented content type and filename for the attachments in
a quote (it should be the type and filename of the original
attachment, not the thumbnail).
2022-06-03 16:34:25 -07:00
Evan Hahn
e40f162a1e Fix compiler_protocol_init lint rule violation
This fixes our one violation of [SwiftLint's `compiler_protocol_init` rule][0].

[0]: https://realm.github.io/SwiftLint/compiler_protocol_init.html
2022-06-03 19:09:45 +00:00
Evan Hahn
c41867ab7a Fix doc comment in Emoji
The `Emoji` enum had an [orphaned doc comment][0], which SwiftLint reported.

This updates that file's generator to fix the error. (SwiftLint is disabled for most of the file, though—a bit unfortunate, but probably correct for generated files.)

[0]: https://realm.github.io/SwiftLint/orphaned_doc_comment.html
2022-06-03 18:30:36 +00:00
Evan Hahn
621736897d Fix minor issues with colon spacing
[SwiftLint's `colon` rule][0] says the following:

> Colons should be next to the identifier when specifying a type and next to the key in dictionary literals.

This fixes a few violations of that rule.

[0]: https://realm.github.io/SwiftLint/colon.html
2022-06-03 18:23:13 +00:00
Evan Hahn
24ca5abf9c Remove unneeded breaks
This fixes our violations of [the SwiftLint `unneeded_break_in_switch`
rule][0].

[0]: https://realm.github.io/SwiftLint/unneeded_break_in_switch.html
2022-06-03 17:52:28 +00:00
Evan Hahn
df9d1af923 Fix file header with duplicate license and import 2022-06-03 17:49:28 +00:00
Jordan Rose
1c82df3bc9 Protos: Remove unused fields from DataMessage.Quote
These were never added to other clients, so we shouldn't be using
them.
2022-06-03 10:34:21 -07:00
Nora Trapp
02dcf6282e "Bump build to 5.41.0.6." (nightly-06-03-2022) 2022-06-03 04:00:36 -07:00
Jim Gustafson
12a4b687a2 Update to RingRTC v2.20.8 2022-06-02 20:40:46 -07:00
Jordan Rose
91f4615d5d Avoid multiple ThemeDidChange notifications
We get notified of the system theme changing through OWSWindow, but
there's more than one window in the app.
2022-06-02 14:01:42 -07:00
Nora Trapp
b29dc8b65c "Bump build to 5.41.0.5." (nightly-06-01-2022) 2022-06-01 04:00:21 -07:00
Jordan Rose
4e05dfde5c Don't generate a new PushChallenge for every failed operation
We sometimes attempt to do N operations at once where up to N of them
end up getting caught by the rate limiter. This should *not* turn into
N push challenges, or else we'll get rate limited for that too.
2022-05-31 18:05:22 -07:00
Max Radermacher
c15df6b507
Persist Gift Badges on incoming messages 2022-05-31 11:46:33 -07:00
Jordan Rose
ce9da716e6
MediaGallery: Correctly respond to external deletion
This removes DatabaseChanges.deletedAttachmentIds and replaces it with
a notification that carries more information: the attachment's thread
and original message received-at timestamp in addition to the unique
ID. With this information, we can correctly refresh the parts of
MediaGallery that may be affected by the deletion. (The previous
implementation was correct for the original version of MediaGallery,
but not the rewritten version I implemented last year. My apologies to
all users seeing crashes here!)

In the new model, deletions from outside of MediaGallery's control 
result in reloads of the sections containing the items in question.
This may result in refetching other media that was previously loaded,
but avoids the issue in the previous implementation where existing
loaded items would now be at the wrong offsets.
2022-05-31 10:55:31 -07:00
Nora Trapp
015770187a "Bump build to 5.41.0.4." (nightly-05-28-2022) 2022-05-28 04:01:19 -07:00
Jordan Rose
f7444d960e PhotoCapture: stop the AVCaptureSession on its dedicated queue
AVCaptureSession isn't thread-safe to reconfigure, and that includes
stopping a current session. Everything else we did with the session
was on a dedicated queue, but the call to stop it was on the main
queue. Fix that by exposing the existing promise-based stop method to
the CaptureOutput helper.
2022-05-27 16:56:28 -07:00
Max Radermacher
0577775f2f
Parse GiftBadges on incoming messages
(They are still dropped, regardless of whether or not they’re valid.)
2022-05-27 15:22:19 -07:00
Evan Hahn
0cee2789b9 Update "pending changes action sheet" localization metadata
_I recommend reviewing this with whitespace changes disabled._

This is a minor change; it have no direct user impact.

We have a "pending changes action sheet" which shows up to warn users
that their changes may not be saved. The localization key and comment
indicated that its strings were only for groups, but that's not
true—it's used for lots of things, such as editing your profile or
updating a group's metadata.
2022-05-27 21:54:42 +00:00
Evan Hahn
fa099f6e96 Fix retain cycles with ApplePayButton usage
I introduced retain cycles in 1a253bbf86.
This fixes them!
2022-05-27 21:41:14 +00:00
Max Radermacher
fa99be971d
Add GiftBadge to SignalService.proto 2022-05-27 13:32:09 -07:00