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
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.
_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
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).
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
[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
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.
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.
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.
_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.
The app has two Apple Pay buttons that look identical, and we're about
to add a third. This creates `ApplePayButton`, a reusable view, to
reduce some code duplication.
Tested:
- Subscribing in staging
- Boosting in staging
- Switching between light and dark modes
Each GRDB migration runs in a separate transaction, so it’s possible
only some will be completed. In normal cases, this is fine. However, the
initial migration creates the latest version of the schema. As a result,
we must ensure all incremental migrations are atomically marked as
complete so that we don’t try to run them again after an app crash.
In at least one instance (iOS 14.6), we've seen pings go out that
never get responses and never report timeouts. Check for that
explicitly to make sure we cycle the socket if we're not getting ping
responses.