Commit Graph

28447 Commits

Author SHA1 Message Date
sashaweiss-signal
0b665ee1be Update translations 2022-06-15 14:21:43 -07:00
sashaweiss-signal
a120e4e1ae Update release notes 2022-06-15 14:00:47 -07:00
Evan Hahn
779142ea0c Fix crash when opening wallpaper/chat color view
_I recommend reviewing this with whitespace changes disabled._

Previously, Settings → Appearance → Chat Color & Wallpaper → Chat Color
would cause a crash. This was because we had a re-entrant database
transaction.

This fixes that by removing the re-entrant transaction—a fairly simple
fix.

There was also a function here that was immediately called and not used
elsewhere, so I removed the function and inlined its contents. Not
strictly related to the crash. I believe it was originally added in
0574d23b6f.
2022-06-15 19:08:19 +00:00
Nora Trapp
8c0cc50a0c Fix voice message layout 2022-06-15 10:17:35 -04:00
Nora Trapp
c684f94235 "Bump build to 5.42.0.5." (nightly-06-15-2022) 2022-06-15 04:01:08 -07:00
George Nachman
f643545d4f Fix a bug where delivery receipts were flaky. [IOS-2478]
anyUpdate runs its closure twice with different
messages but the batching context applied updates
always to the same copy of the message.

Also apply lint fixes.
2022-06-14 16:43:55 -07:00
Sasha Weiss (Signal)
54dab321af
Add check for being out of disk space, and show launch-failure UI if so 2022-06-14 12:46:30 -07:00
Evan Hahn
4a05570dc2 Fix small visual bugs in group member sheet
This fixes two small regressions introduced in
80e8379738:

1. There's a bit too much spacing at the top.

2. In dark mode, the grabber had the wrong background color. (As you can
   see in the code, my solution here is a temporary workaround before we
   do a larger refactor.)
2022-06-14 14:24:54 +00:00
Evan Hahn
152080a93b Update libPhoneNumber-iOS
This updates our fork of libPhoneNumber-iOS to include metadata from
libphonenumber v8.12.50.
2022-06-14 14:16:34 +00:00
Nora Trapp
24b6559721 "Bump build to 5.42.0.4." (nightly-06-11-2022) 2022-06-11 04:00:55 -07:00
Nora Trapp
f16f621e32 "Bump build to 5.42.0.3." (Internal) 2022-06-10 22:28:31 -04:00
Nora Trapp
7bd167f815
Initial story sending support
* Little fix for context menu

* Add 'My Stories' section to stories tab

* Add new story thread types

* Show stories in conversation picker

* Support for sending stories

* Update story list when sending stories

* Add basic 'My Stories' view controller

* Initial stories settings screens

* Consolidate TSPrivateStoryThread and TSMyStoryThread into one class

* Require an explicit read transaction to initialize an outgoing message

* Fix linting

* Allow enabling group story from internal settings

* Fix tests

* PR Feedback
2022-06-10 22:28:03 -04:00
Evan Hahn
8009206c18 Respect recipient capabilities when sending gift badges
This respects the `giftBadges` capability when trying to send gift
badges. In other words, it prevents you from sending gift badges to
someone who lacks the capability.

The bulk of this change involves fetching and saving of this new
capability. The rest of the code involves showing it on the "choose
recipient" screen (and some debug screens).
2022-06-10 22:37:22 +00:00
Evan Hahn
83a00eddae Enable (incomplete) gift badge send UI for internal builds 2022-06-10 21:54:11 +00:00
Evan Hahn
ddad327212 Clear invalid legacy avatars, instead of crashing
A migration (introduced in b2c0e975b6)
tries to save legacy avatars to disk. However, if that legacy avatar
data is invalid, we'd crash on launch.

A user encountered this.

Our possible solutions:

1. If legacy avatar data is invalid, just drop it.
2. If legacy avatar data is invalid, try to repair it. (For example, if
   it's too large, try to resize it.) This might not fix the user's
   issue—unfortunately, we don't know why the avatar was invalid.
3. Loosen our definition of a valid avatar. (For example, increase the
   maximum size.) This also might not fix things—we don't know how the
   avatar was invalid.

I went with the first solution.

This was difficult to test. While developing, I made a temporary button
that (1) updated a group, giving it an empty legacy avatar buffer (2)
tried to migrate it.

(Thanks to c5bd634ff1 for making this easy
to diagnose!)
2022-06-10 21:50:16 +00:00
Max Radermacher
184a576e58
Clean up jumbomojiCount & add tests
In e41335a7b5, `String.glyphCount` was updated to match
`String.count`, which eliminates the need to do the pre-emptive “are
there less than 50 characters” check. Since that commit, both of the
character count checks in this method were calling the same underlying
API, so there’s no need to call it twice, and we can just check it
against the strict upper bound immediately.
2022-06-10 14:33:46 -07:00
Jordan Rose
56fd55bb2c DebugUI: Add a button to clear thumbnail caches 2022-06-10 10:03:55 -07:00
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