as the last remaining objective-c file, this removed direct dependency
from the SignalMessaging framework headers on SignalServiceKit and
thus required adding lots of import statements
Before this change, you could tap "Donate" and be taken to a screen that
had just one button: "Donate".
Now, you'll only see this screen if there's anything _else_ to do on
that screen.
For example:
1. User installs the app fresh.
2. User goes to the settings and taps "Donate". They're taken to the
donate screen, not the donate _settings_ screen. They donate.
3. Later, they go to the settings and tap "Donate" again. They're now
taken to the donate settings screen.
This change should have no user impact.
`DonationViewController` is now `DonationSettingsViewController`.
I think this is a better name on its own, but it'll seem even better
after upcoming change.
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
Co-Authored-By: Michelle Linington <66273351+michelle-signal@users.noreply.github.com>
There are various things you might want to do as a donor to Signal:
- Start, modify, or stop a monthly subscription
- Do a one-time donation
- Manage your badges
- See your receipts
Previously, `SubscriptionViewController` was your gateway to all of this
stuff. However, this had some problems:
- You could only see receipts if you had an active subscription.
One-time donors, or relapsed sustainers, could not get receipts
- It didn't work well if Apple Pay was disabled
- It wasn't extensible (e.g., for adding badge gifting)
This change breaks that single screen into two:
- `SubscriptionViewController` is responsible for letting users start,
modify, or stop a monthly subscription
- `DonationViewController` is your "donation homepage", which links to
everything else: `SubscriptionViewController`, `BoostViewController`
for one-time donations, `DonationReceiptsViewController` for receipts,
etc.
Because the new `DonationViewController` takes on more responsibility,
you'll see `SubscriptionViewController` and
`DonationReceiptsViewController` getting smaller.
This change also:
- Reorganizes the top-level app settings to match new designs
- Adds behavior for users who don't have Apple Pay
- Adds basic error handling if your network is down
- Uses enums with associated values to prevent invalid states
This small change cleans up two things for the donate URL:
1. Moves it into a constant in `TSConstants`
2. Adds a trailing slash to the URL (because the server will redirect
you without one)
I think these cleanups are useful by themselves, but I'll be using the
constant again in an upcoming change and split this off into its own
small commit.
Made sure I could still open the URL in the app.
_I recommend reviewing this with whitespace changes disabled._
We have a kill switch that disables badge acquisition. If that kill
switch is active, we show a one-time donation view.
That kill switch has been off since January of 2021, so I think we can
remove this one-time donation view. That lets us remove hundreds of
lines of code, but it will also make future donation-related changes a
bit easier.