Commit Graph

28339 Commits

Author SHA1 Message Date
Max Radermacher
faea3c50bf Fix l10n_lint URL 2022-05-20 10:12:52 -07:00
Max Radermacher
bbb69e8d74 Check for malformed .stringsdict files
If they’re malformed, Xcode builds will fail while trying to copy the
plist files to the bundle.
2022-05-20 10:12:52 -07:00
Nora Trapp
9e103aec6f "Bump build to 5.40.0.3." (nightly-05-20-2022) 2022-05-20 09:57:54 -07:00
Nora Trapp
739d860b35 "Bump build to 5.40.0.2." (nightly-05-20-2022) 2022-05-20 04:00:42 -07:00
Jordan Rose
e9b6439518 Un-nest builders for our proto wrapper types
We expose many of these builders to Objective-C, but Swift is unable
to map forward-declarations of those types (@class) back to the real
Swift classes because they're nested within the protos. Since we're
already using fully-qualified names even in Swift (e.g.
"SSKProtoContentBuilder"), nesting isn't worth the trouble it's
causing.
2022-05-19 15:40:21 -07:00
Jordan Rose
4c8d7662a6 Add OWSIdentityManager.shouldSharePhoneNumber(with:transaction:)
When someone sends a message to your PNI, your responses (from your
ACI) must include a PNI signature, and the sealed sender certificate
you use during this period should include your phone number. This
confirms to the other user that your ACI is associated with your PNI.

This commit adds the state tracking that and ensures that both
TSOutgoingMessage and OWSUDManager check that state when building 1:1
messages and choosing certificates, respectively. Later commits will
set and clear this flag as needed.
2022-05-19 14:20:53 -07:00
Jordan Rose
3e8217deb0 TSOutgoingMessage: break out -contentBuilderWithThread:transaction:
TSOutgoingMessage has an existing overridable method
-dataMessageBuilderWithThread:transaction: that returns an
SSKProtoDataMessageBuilder; this makes it easy for the base class to
add a profile key to every outgoing DataMessage message no matter how
the proto gets built. Similarly, we (sometimes) want to put a
PniSignature on every outgoing message (of any kind), so now we have
-contentBuilderWithThread:transaction:. (The PniSignature part comes
next.)
2022-05-19 14:20:53 -07:00
Jordan Rose
36426db3e7 Port TSOutgoingMessageTests to Swift
Take the opportunity to combine related tests and ensure we're testing
the right things.
2022-05-19 13:44:21 -07:00
Max Radermacher
a55da92c2b Add script to symbolicate .ips files 2022-05-19 12:56:08 -07:00
Evan Hahn
baddc85564 Add first gift badge screen
This adds the first screen for badge gifting. It lets you see the gift
badge, pick the currency, and advance to the next screen.

It also adds a skeleton for the next screen, so there's somewhere to
advance to, but that screen is unfinished.

All of this is behind disabled flags, so this should have no user
impact.
2022-05-19 14:07:23 +00:00
Nora Trapp
d2fcc546bc "Bump build to 5.40.0.1." (nightly-05-19-2022) 2022-05-19 04:00:40 -07:00
Max Radermacher
cb5889a977 Disable selection for loading/no search results 2022-05-18 21:36:17 -07:00
Nora Trapp
5c8986fbb2 Don't let xcode manage build number 2022-05-18 18:22:58 -07:00
Evan Hahn
af3d7b1326 Revert buggy zh_TW translation for now
I synced translations in e85c289427.
The `zh_TW` translation had a string that caused the file to be
syntactically invalid.

I ran this to fix it:

    git checkout e85c2894278bc5d4929b0adbc5123a849e1db61d~1 Signal/translations/zh_TW.lproj/PluralAware.stringsdict

In the long term, we'll fix this string, and this problem will go away.
2022-05-18 18:00:04 -05:00
Evan Hahn
f0a9594280 "Bump build to 5.40.0.0." (nightly-05-18-2022) 2022-05-18 17:12:42 -05:00
Evan Hahn
ea7c610901 "Bump build to 5.39.0.9." (nightly-05-18-2022) 2022-05-18 17:11:30 -05:00
Evan Hahn
e85c289427 Update translations 2022-05-18 17:09:06 -05:00
Evan Hahn
2e8cbcbbcf Update release notes 2022-05-18 16:43:09 -05:00
Nora Trapp
a342773c1a "Bump build to 5.39.0.8." (Internal) 2022-05-18 14:10:19 -07:00
Nora Trapp
a77bebd8d5 "Bump build to 5.39.0.7." (Internal) 2022-05-18 14:09:47 -07:00
Jordan Rose
926178abe1 Port OWSIdentityManagerTests to Swift
...for testing Swift-side things soon.
2022-05-18 11:28:39 -07:00
Max Radermacher
7fa13f9a20 Add missing PluralAware.stringsdict files
If we have a Localizable.strings file for a specific language, we should
also include the PluralAware.stringsdict file, even if less than 80% of
the plural strings have been translated.

When adopting a brand new language, it makes sense to wait for some
threshold of strings across the entire app to be available.

However, the same doesn’t apply for the new PluralAware files. If we
already have some translations for a language, we should include all the
translations that are available.

Assume that `L.lproj/Localizable.strings` already exists. Then:

(1) If `L.lproj/PluralAware.stringsdict` isn’t included, all plurals
will appear in the fallback language.

(2) If `L.lproj/PluralAware.stringsdict` is included but there aren’t
any translations, all plurals will appear in the fallback language.

(3) If `L.lproj/PluralAware.stringsdict` is included and has even a
single translation, that string will shown in the app.

(4) If `L.lproj/PluralAware.stringsdict` is included and has 80% of its
translations, all of those translations will be shown in the app.

This change address (3) without changing the behavior for (1) and (2).
2022-05-18 11:02:45 -07:00
Martin Böttcher
89dbebe442 mixing the pluralaware strings uses the main language if appropriate 2022-05-18 11:02:45 -07:00
Jordan Rose
a301452f0c Test phone number sharing modes for sealed sender
Sealed sender certificates come in two flavors: one with our local
phone number, and one without. Add an automated test for picking the
right one based on our phone number sharing mode (everybody,
contacts-only, nobody).

This commit also adds a convenience helper for tests that want to wait
on promises that might run on the main thread.
2022-05-18 10:21:53 -07:00
Evan Hahn
3d815a14fb Remove wiki suggestion from contribution instructions 2022-05-18 10:53:08 -05:00
Jordan Rose
ebe6c81674 Typo: handleUnexpected{Void -> Voip}Push 2022-05-18 10:45:58 -05:00
Nora Trapp
d51d557292 "Bump build to 5.39.0.6." (nightly-05-18-2022) 2022-05-18 04:00:37 -07:00
Igor Solomennikov
8b3ea9d27d Fix typo: "Gausian" -> "Gaussian". 2022-05-17 19:25:30 -07:00
Evan Hahn
d31ccfb057 Let users copy their subscriber ID
_I recommend reviewing this with whitespace changes disabled._

Support wants a way for users to copy their subscriber ID. This adds a
hidden way to do that: long-pressing your avatar in the donation view.

It copies it as a url-safe base64 string, which is similar to [what
Android does][0].

[0]: 0fe0765e63/app/src/main/java/org/thoughtcrime/securesms/components/settings/app/AppSettingsFragment.kt (L183)
2022-05-17 18:36:03 -05:00
Evan Hahn
532705c23f Remove unnecessary try! in subscription view 2022-05-17 16:49:43 -05:00
Evan Hahn
1930615326 Subscriptions should respect server-reported currencies
The subscription currency picker lets you choose currencies that are
supported by the client but not the server.

For example:

- The client supports USD, EUR, and GPB in its hard-coded list.
- The server only reports USD and EUR.

Before this change, the user could choose GBP, which would cause no
price to be shown (and possibly other bugs; I didn't check).

Now, they cannot choose a currency that isn't supported by both the
client and server.

I tested this by faking a server response and seeing fewer currencies in
the list.

I think this is a useful fix on its own, but it'll also help with badge
gifting.
2022-05-17 14:40:00 -05:00
Max Radermacher
80e0208bbb
Time out syncTruncatingCheckpoint after 3 seconds 2022-05-17 12:31:03 -07:00
Max Radermacher
d38bbf3370 Lint 2022-05-17 10:28:11 -07:00
Max Radermacher
5734d15fbb Make AppUpdateNag.currentVersion non-optional
The underlying value isn’t optional, so the wrapper doesn’t need to be.
2022-05-17 10:28:11 -07:00
Max Radermacher
e6504560d2 Fix bug that asks users to upgrade prematurely
As of 9662b3cb1e, the app should wait for a week before notifying
users about a new version. However, the “has it been 7 days” marker
isn’t cleared when a user does upgrade, so the prompt can appear too
quickly when the next update is released.

For example:
- Assume it’s Apr 7 and a user is running v5.34.
- On Apr 8, v5.35 is released & the user sets the 7-day marker to Apr 8.
- On Apr 10, the user upgrades to v5.35; the marker isn’t cleared.
- On Apr 15, v5.36 is released.
- On Apr 16, the user launches the app and sees an update banner, even
  though the new version has been out for only 1 day.
2022-05-17 10:28:11 -07:00
Max Radermacher
b950b41165 Move app update version check off the main queue 2022-05-17 10:28:11 -07:00
Max Radermacher
2ecc71dbae Fix TSGroupMember migration constraint violation
Context:
- M1, from Apr 2021: `dataMigration_populateGroupMember`
  - Inserts TSGroupMembers into the database.

- M2, from Feb 2022: `dataMigration_reindexGroupMembershipAndMigrateLegacyAvatarDataFixed`
  - Adds TSGroupMembers to the FTS index.

In the happy path, M1 would have run several months ago, before there
was any FTS support for TSGroupMember objects. Then, when FTS support
was added, M2 would index the existing group members.

In the sad path, both M1 and M2 run at the same time. In this case, M1
knows how to insert group members into the FTS index, so it does. When
M2 tries to do the same thing, it fails the UNIQUE constraint.
2022-05-17 09:12:24 -07:00
Jordan Rose
c16713a4cb Don't reset SenderKey distribution records on stale devices
Resetting these records is a micro-optimization: while some of the
devices will still have the up-to-date sender key, we don't ever send
messages to just some of a recipient's devices, so updating the record
to be perfectly accurate is equivalent to deleting it altogether. In
either case the set of devices will be checked the next time we try to
send a message, including their registration IDs, but it's ever so
slightly faster to see that there's no record at all. That said, the
best code is no code, and removing this removes an extra database
write that might get blocked behind other work.
2022-05-17 09:08:41 -05:00
Max Radermacher
7512992b92 Ignore missing model_TSInteraction index
If this index doesn’t exist when the migration runs, continue instead of
throwing an error.
2022-05-17 09:07:00 -05:00
Nora Trapp
64c72a5092 "Bump build to 5.39.0.5." (nightly-05-17-2022) 2022-05-17 04:00:44 -07:00
Nora Trapp
67cb022737 Enable storiesMigration5 2022-05-16 13:13:20 -07:00
Nora Trapp
6cd853742d Update to LibSignalClient 0.17.0 2022-05-16 11:14:12 -07:00
igor-signal
e3f5b27cfa
Always allow to turn off multi-mode while in in-app camera. (#4320)
[camera] Always allow to turn off multi-mode while in in-app camera.

Previously user couldn't turn off multi-mode if they have already
taken some photos/videos. Now they'll be able to do so after confirming
that all their media drafts will be lost.
2022-05-16 10:56:24 -07:00
Evan Hahn
91a3f67ebe "Facetime" → "FaceTime" in English translations
FaceTime uses a capital T ("FaceTime" instead of "Facetime"), so we
should capitalize it.

See [Apple's documentation][0].

[0]: https://apple.com/ios/facetime
2022-05-16 12:27:05 -05:00
Evan Hahn
4c0e511793 Fix typos in localization string comments
I noticed a few typos in localization string comments while working on
c5bdf6c094. This fixes those.

This should have no (direct) user impact.
2022-05-16 12:26:31 -05:00
igor-signal
6d7a2789f6
Stop rounding up camera zoom labels
Previously, a zoom level of 0.98x would round up to 1x.

This rounds it down to display 0.9x.
2022-05-16 10:46:42 -05:00
Evan Hahn
9906485a50 Consolidate donation currency picker views
There are two currency picker views that are nearly identical.

We plan to add a third, so I consolidated them to make that easier. I
think this is a useful change on its own, too.
2022-05-16 09:19:17 -05:00
Nora Trapp
e6fc125aa6 "Bump build to 5.39.0.4." (nightly-05-15-2022) 2022-05-15 04:00:26 -07:00
Evan Hahn
29c0ddf60e Fix violations of SwiftLint's attributes rule
_I recommend reviewing this with whitespace changes disabled._

Most of these were `@objc` being on the same line, which I fixed with [a
silly script][1]—probably could've used `sed` if I were wiser. The rest
were manual fixes.

See [the SwiftLint documentation for this rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
[1]: https://gist.github.com/EvanHahn-Signal/d353c93fa269c82b96baca0a1086521f
2022-05-14 09:07:42 -05:00
Nora Trapp
4e5a64bd8e "Bump build to 5.39.0.3." (nightly-05-14-2022) 2022-05-14 04:00:22 -07:00