* Add deprecated prefix to all existing onboarding/registration types. (Will be forked to new versions later, potentially untouched)
* Mark old requests deprecated
This is similar to 227f05e932.
This change should have no user impact.
This changes the "delete subscriber ID" request in the following ways:
- Adds tests
- Converts it to Swift
- Renames `deleteSubscriptionIDRequest` to `deleteSubscriberID`
- Serializes the data inside the method, rather than requiring callers
to do so
This change should have no user impact.
This changes the "set subscriber ID" request in the following ways:
- Adds tests
- Converts it to Swift
- Renames `setSubscriptionIDRequest` to `setSubscriberID`
- Serializes the data inside the method, rather than requiring callers
to do so
Tested this with automated tests and manually starting a subscription in
staging.
This change should have no user impact. It makes a few cleanups to
`OWSRequestFactory.requestPreauthChallengeRequest`:
- Adds tests
- Converts it to Swift
- Renames it to `requestPreauthChallenge`
- URL-encodes the parameters. This required some additional scaffolding;
see `URLPathComponents`.
This change should have no user impact. It makes a few changes to
`OWSRequestFactory.deviceProvisioningRequestWithMessageBody`:
- Adds tests
- Converts it to Swift
- Renames it to `provisionDevice`
- URL-encodes one of the parameters
(I was thankful for `OWSDeviceProvisionerTest` when I made this change,
as it increased my confidence that this was safe.)
This change should have no user impact.
This makes the following changes to `OWSRequestFactory.reportSpam`:
- Converts it to Swift
- Adds tests
- Handles a server GUID that couldn't be URL-encoded. For example, if it
contained spaces, we'd crash constructing the URL. No longer!
- Handles an empty server GUID
This change should have no user impact.
We commonly pair a currency, like USD, and an amount, like 1.23. This
adds the `FiatMoney` struct. It's a simple struct with two fields.
After adding it, I tried to use it everywhere. (It's possible I missed a
spot.)
I think this is a useful change on its own, but it'll be nice for an
upcoming change, too.
See also: [Android's equivalent class][0].
[0]: cb65347bb3/core-util/src/main/java/org/signal/core/util/money/FiatMoney.java (L1)
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
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
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
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.
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.