This included:
- Removing unavailable inits wholesale if no longer `required`
- Marking a few classes `final` so they could continue using
`Self(...)` rather than `OWSWhatever(...)`
Also:
- Remove AtomicUInt's @objc, it's no longer used from ObjC
- Remove Codable conformances, they would implicitly use shared locks
and weren't used in practice
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
Previously, one-time donations were on one screen and monthly donations
were on another. Now, they're on a single screen with a picker.
Most of the interesting changes are in `DonateViewController`.
Other things of note:
- There are some new TODOs here for existing bugs I didn't fix. For
example, one-time donations don't do so well if there are any problems
at all.
- Even though we only support Apple Pay, there's code that alludes to
additional payment methods. For example,
`DonateChoosePaymentMethodSheet`. We'll expand on this in the future.
- Users should only be able to select currencies that the server
supports. For example, you shouldn't be able to select EUR if the
server doesn't support euros. This wasn't working correctly before,
but is fixed here.
We already fixed one part, where users could change to an unsupported
currency (see dab02f30ae). However, if
your _default_ currency is unsupported and you didn't change it,
that's no good. This is unlikely for most users but could happen.
I fixed this by changing it from (effectively)
`Locale.current.currencyCode ?? "USD"`, which might not be supported,
to a preference list, choosing the first one the server likes.
- I skip animations if the Reduce Motion setting is enabled.
- On the donation screen, the logic for the preview badge has changed
slightly. If you already have a badge, we'll always use that.
* Observe story viewed ring changes in ConversationAvatarView itself
* Manage ConversationAvatarView's story observation based on the context
* remove story state from thread view model, now unused
* pr feedback renames
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
* refactored async loading of avatar images in HomeView
* async loading avatars does not use extra DispatchWorkItems anymore
* minor code changes, added comments
* made async avatar loading in homeview more robust
* async loading of avatar images in the background should not interfere with foreground operations anymore
* corrected handling of loading avatars not triggered from the home view
* better separation between existing avatar load calls (sync and async) and new async-only call used in HomeViewCell. Should eliminate side-effects and improve performance.
Our AvatarBuilder caches were cleared in their entirety any time a
profile changes. If a profile update raced with a avatar fetch in
ConversationAvatarView, they'd blink briefly while the cached items were
removed.
This change ensures that we're only clearing out avatars that are
associated with an updated profile.
- Adjusts delegate interface to be useful in both cases
- Subscription view controller will now save updated badge settings
Also, a bonus change to disable badges on avatars
- Design speced out explicit offsets for 24pt and 112pt avatars
- We won't show badges in call views
Also fixes a couple bugs:
- Incorrect interpolation of interstitial badge sizes
- We should badge conversation headers and typing indicators
A few people reported this issue during the badges bug bash. Avatars
would show stale avatars in incorrect places.
This was due to async model updates being kicked off shortly before a
call to `reset()` the view. Resetting would only clear the image data
and data source but wouldn't do anything to cancel async updates that
were in-progress.
The fix is to tweak the implementation of reset() to go through existing
paths that account for this by incrementing the model generation. This
ensures that the async update will be dropped when it resolves and sees
that the model generation was incremented underneath it.
- Clear out avatar cache on local profile changes too
- ConversationAvatarView properly handles local profile updates
- Fix some tiny UI bugs in group calls