Commit Graph

220 Commits

Author SHA1 Message Date
Sasha Weiss
bcbf52101e
PayPal recurring donations
Co-Authored-By: Evan Hahn <evanhahn@signal.org>
2023-01-18 14:48:50 -08:00
Max Radermacher
fd3457b9a5 Update sending flow to use UUIDs 2023-01-09 12:00:51 -08:00
Max Radermacher
6c2eabaacb
Only use ACI when fetching pre keys 2023-01-09 12:00:07 -08:00
Max Radermacher
19a5143b3f Remove deprecated endpoint for acking messages 2023-01-02 15:30:20 -08:00
Max Radermacher
921301cdb0
Add CDSv2 2022-12-14 16:30:35 -08:00
Evan Hahn
c1da120d2a
Fully remove "gv1-migration" capability code
This was partly done in 6e6327b007. The
server now [hard-codes this capability to `true`][0] so it's completely
useless for us to set it.

[0]: fb4ed20ff5
2022-12-06 12:56:59 -08:00
Sasha Weiss
ee4799b506 One-time donations via PayPal 2022-12-01 14:39:03 -08:00
Sasha Weiss
40e765fa4f Integrate the /v1/subscription/configuration API 2022-12-01 14:39:03 -08:00
Max Radermacher
27c985dcfd Don’t try to fetch profiles for e164s 2022-11-03 13:06:00 -07:00
Max Radermacher
cc4af7b88e Remove CDSH 2022-10-18 16:08:33 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Max Radermacher
9953f99784 Remove unused donation code 2022-10-12 11:30:39 -07:00
Nora Trapp
53f6561543 Enable the stories capability for all linked devices 2022-10-12 11:24:51 -07:00
Evan Hahn
760e5c1c97
Add PNI registration ID to account attributes
Like "regular" registration IDs, this attaches a PNI registration ID to
account attributes. It's already synced at the right times (see
[`updateAccountAttributesIfNecessaryAttempt`][0]).

Tested this by registering and seeing the payload correctly sent to the
server.

See also: [Android's implementation][1].

[0]: 487405ef08/SignalServiceKit/src/Account/TSAccountManager.swift (L137)
[1]: 6e5f28339d/libsignal/service/src/main/java/org/whispersystems/signalservice/internal/push/PushServiceSocket.java (L378)
2022-10-05 16:13:33 -05:00
Nora Trapp
433d63f003 Flag on websocket and REST message requests that stories are enabled 2022-10-05 12:24:13 -07:00
Nora Trapp
1e613fe438 Use unrestricted sealed sender for story sends 2022-10-05 12:24:13 -07:00
Evan Hahn
56589799cb
Clean up registration ID generation
_This change should have no user impact._

This cleans up the way we generate registration IDs. It:

- Rewrites the generation code in Swift
- Removes the "sneaky transaction" method. I did this for clarity, and
  because we won't use it for much longer
- Turns a log warning into a regular log—generating a registration ID is
  not a problem
- Adds tests

I think this is a useful change on its own, but will be handy for an
upcoming change, too.
2022-10-05 14:09:07 +00:00
Sasha Weiss
ac97aeba92
Migrate to using ExpiredProfileKeyCredentials 2022-09-26 14:33:57 -07:00
Sasha Weiss
f37a0040ad
Replace AuthCredential with AuthCredentialWithPni 2022-09-07 15:39:50 -07:00
Nora Trapp
09598d2e7a Add remote flag for stories 2022-08-31 13:34:24 -07:00
Evan Hahn
5a0f836f0d Use "timestamp" instead of "timeStamp"
This change should have no user impact.

We use "timestamp", all lowercase, in most of the codebase. This makes
it consistent.
2022-08-26 14:17:12 -05:00
Evan Hahn
da322d3bf9 Add "urgent" boolean to outgoing messages
To improve message reliability, we're adding an urgency flag to outgoing
messages. For example, outgoing calls are urgent, but delivery receipts
are not. [Android][] and [Desktop][] have already done this work.

At a high level, I added an `isUrgent` property to `TSOutgoingMessage`s.
It defaults to `true`. Some subclasses, like
`OWSReceiptsForSenderMessage`, override it to return `false`.

Builds off of a few other commits (not necessary to understand this
commit, but might be useful for posterity):

- e858a0d916
- 8c6d2ebe8c
- 402b117221
- 2ba0cd764d
- 266a4663e9
- 8e5009bbf7

[Android]: dc04c8ed98
[Desktop]: 06190b1434
2022-08-18 07:35:41 -05:00
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
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
Max Radermacher
c404773145 Add giftBadge capability 2022-05-23 15:25:19 +00: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
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
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
Michelle Linington
e00e43ec95 Perform CDS requests against HSM backed service 2022-02-22 12:41:04 -08:00
Nora Trapp
41dd7a14d9 Add support for IASv4 enclaves 2022-01-27 15:58:47 -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
513a37892e Tweak change phone number feature flags 2022-01-21 10:16:35 -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
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
Nora Trapp
095b54d13d Add boost view controller 2021-11-15 13:24:58 -08:00