Commit Graph

508 Commits

Author SHA1 Message Date
Evan Hahn
2ba0cd764d Update comments that reference server code
This change should have no user impact because it only changes
comments.

We had some comments that referenced the Signal server repo. They
referenced a commit that was a little out of date (from March 2022).
This updates the links.
2022-08-15 11:54:48 -05:00
Evan Hahn
028d97c2cb
Use remote config for gift badges
This removes `FeatureFlags.giftBadgeReceiving` and
`FeatureFlags.giftBadgeSending`, replacing them with
`RemoteConfig.canReceiveGiftBadges` and
`RemoteConfig.canSendGiftBadges`.
2022-07-20 08:50:58 -05:00
Evan Hahn
f4714b1a83 Basic support for sending gift badges
If you've got the `giftBadgeSending` flag enabled, you can now send gift
badges to anyone who has the capability.

This commit doesn't complete the feature, though. It is missing:

- Proper durability and error handling (to be addressed separately)
- Saving of receipts
- A few other cleanups
2022-06-22 15:50:51 +00:00
Evan Hahn
a1eb9e3042 Clean up boostCreatePaymentIntent()
This makes a few small changes to `OWSRequestFactory.boostCreatePaymentIntent()`:

- Adds tests
- Rewrites the function in Swift

I made sure I could do a boost (in staging) in the simulator.
2022-06-21 17:33:28 +00: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
Max Radermacher
c404773145 Add giftBadge capability 2022-05-23 15:25:19 +00: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
Max Radermacher
f7f129cdc5 Remove unnecessary error handler wrapper
This only calls the block, and the formatting in the old design made it
particularly difficult to read. (It also makes this path and the success
path more similar in their construction.)
2022-05-09 09:41:25 -07:00
Evan Hahn
5be42da750 Change references from master to main
_I recommend reviewing this with whitespace changes disabled._

Signal has renamed its primary branch to `main`. This updates references
to the old name, `master`, to either reference `main` or a specific
commit hash.

I also fixed a couple of small whitespace issues in a file I was
editing.
2022-05-02 10:30:40 -05:00
Max Radermacher
88a28c3457 Fix typos: Reciept → Receipt 2022-04-29 12:14:09 -07:00
Jordan Rose
5ecb9519b9 Refresh PNI pre-keys along with ACI pre-keys
Pre-keys are refreshed at regular (throttled) intervals, but the
"refresh" operation will only actually upload new pre-keys if the
server says we're running low. In addition, after the "refresh",
there's a "rotation" operation for the signed pre-key if the current
one is more than two days old. This only runs if the refresh was
skipped, since uploading new one-time pre-keys is already an
opportunity to rotate the signed pre-key (and it's worth doing so,
since pre-keys running low can indicate high traffic).

None of this has changed. However, we can now do this for both ACI and
PNI pre-keys. This reworked +[TSPreKeyManager
checkPreKeysWithShouldThrottle:] quite a bit to declare the proper
operation dependencies, which isn't *strictly* necessary because the
queue they're executed on is already limited to a
maxConcurrentOperationCount of 1. We could remove that at this point
with proper use of "barrier" operations, but since all the operations
are hitting the server and account updates have to be serialized on
*that* end, there doesn't seem to be much of a benefit.
2022-04-07 14:06:27 -07:00
Jordan Rose
f0de694156 Rotate the PNI signed pre-key along with the ACI signed pre-key
This only applies to explicit rotations of *just* the signed pre-key.
Including this for regular pre-keys as well is more complicated.
2022-04-07 10:23:39 -07:00
Michelle Linington
29dc1eefcd Lint 2022-04-01 14:55:30 -07:00
Michelle Linington
fc69576a74 Include status code in network request success log message 2022-04-01 14:55:30 -07:00
Nora Trapp
e662b099dd Check if a user is stories capable when sending group replies 2022-03-31 00:37:56 -07:00
Nora Trapp
b88b3ce396 Process incoming story context 2022-03-31 00:34:32 -07:00
Chris Eager
b66e80dd21 Update message reporting to use sender ACI instead of E164 2022-03-28 16:23:51 -07:00
Evan Hahn
de105468a4 Assume everyone is GV2-capable 2022-03-22 17:11:57 -05:00
Jordan Rose
39042a8234 Create PNI identity keys and pre-keys upon registration
This doesn't handle
- device linking (we need to send the PNI identity key as well as the
  ACI identity key)
- existing devices that need PNI keys (that'll be an explicit check)
2022-03-18 12:34:11 -07:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Martin Böttcher
eedfd70f3e merged master and pod files 2022-03-15 12:49:11 +01:00
Jordan Rose
a9b9f58d0e Update clang-format with AllowShortEnumsOnASingleLine: false
And apply it to our sources.
2022-03-14 11:20:20 -07:00
Jon Chambers
f642376631 Accept HTTP/429 as a "rate-limited" status code 2022-03-10 16:03:56 -05:00
Martin Böttcher
8f9be31ba3 replaced NSLocalizedStringFromAppBundle with OWSLocalizedString 2022-03-08 10:17:25 +01:00
Michelle Linington
e00e43ec95 Perform CDS requests against HSM backed service 2022-02-22 12:41:04 -08:00
Michelle Linington
aadd176cb9 Add CDS Constants 2022-02-22 12:41:04 -08:00
Michelle Linington
1075bae92b Merge branch 'release/5.27.2' 2022-02-08 16:35:11 -08:00
Michelle Linington
a557af0603 Lint 2022-02-08 15:42:01 -08:00
Michelle Linington
0e2d6a3e7f IOS-866: Endless captcha
Fixes an issue where we would fail to respect the retry-after header of
a failed send response.
2022-02-08 15:19:15 -08:00
Nora Trapp
41dd7a14d9 Add support for IASv4 enclaves 2022-01-27 15:58:47 -08:00
Jordan Rose
a31100f0f5 Fix copyrights 2022-01-26 09:50:56 -08:00
Jordan Rose
01518551eb Import SignalMetadataKit wholesale into SignalServiceKit
The only modifications are those necessary to build as part of SSK.
The follow-up commits will clean that up a bit.
2022-01-26 09:50:55 -08:00
Nora Trapp
a2f51dc4a3 Cleanup old feature flags 2022-01-24 10:53:55 -08:00
Nora Trapp
513a37892e Tweak change phone number feature flags 2022-01-21 10:16:35 -08:00
Michelle Linington
e3bf2965af Lint 2022-01-06 11:26:06 -08:00
Michelle Linington
378e58431f Bug fix for lost avatars on profile update
Following a profile update, we need to reupload the avatar. Currently
we're uploading the avatar by writing it to a temporary file and kicking
off an NSURLSessionUploadTask.

If Class A keys aren't available, we'd fail to complete the upload. This
would remove the user's avatar from their profile.
2022-01-06 11:26:06 -08:00
Jordan Rose
d263372571 SSK: Copy in AFNetworking's multipart form data encoding impl
Matthew previously stripped this down in our fork of AFNetworking; at
this point there's no benefit to it living in a separate repo and
separate target.
2021-12-17 14:40:25 -08:00
Nora Trapp
9ed5e74b79 Sync additional badge info with storage service 2021-12-17 13:54:20 -08:00
Michelle Linington
8a19b8ed34 Merge branch 'release/5.26.4' 2021-12-06 13:06:06 -08:00
Michelle Linington
3d695404ab VisibleBadgeIds is now nonnull on PendingProfileUpdate
A nil array would clear badges anyway. This makes things a bit more
explicit. Also improves some logging.
2021-12-06 12:06:19 -08:00
Matthew Chen
1e05779c28 Change phone number. 2021-11-19 14:28:20 -03:00
Matthew Chen
fc749b4d72 Change phone number. 2021-11-19 14:28:18 -03:00
Nora Trapp
8107430ca3 Don't include stripe details in logs 2021-11-18 13:29:59 -08:00
Nora Trapp
02e35131f4 Fix the 'online' flag for sender key messages 2021-11-18 11:20:17 -08:00
Nora Trapp
355fd82e07 Add remote config for donor badges 2021-11-17 16:22:19 -08:00
Nora Trapp
18a7ad8b2c Fix badge visibility on acquisition 2021-11-17 16:05:58 -08:00
Nora Trapp
55664bde4c Remove description from boost creation 2021-11-16 15:49:39 -08:00
Nora Trapp
faba7621b3 Include the donor's email address for receipt purposes in the billing information 2021-11-16 15:39:39 -08:00
Nora Trapp
c89b0016f6 Add boost thank you flow 2021-11-16 11:40:40 -08:00
Michelle Linington
94c05bad09 Actually persist badge settings
- Augment profile settings to actually record the user's badge
  preferences
- Save these changes to the profile endpoint
2021-11-16 09:55:58 -08:00