Split it based on whether the purpose is “editing” or “sharing”. If
we’re editing, it generally means we have full access to contacts, and
that we’ve checked which of the contacts are registered on Signal. If
we’re “sharing”, we don’t care whether or not they’re registered.
If we’re “sharing”, we check whether or not we’ve prompted for the
contacts permission yet. If not, we’ll show the prompt.
If we’re “editing”, we assume we’ve already prompted (which is already
the case today), so `.notDetermined` isn’t a possible state.
Other things to note:
- The `supportsContactEditing` was always true, so it’s been removed.
- The error when contacts access isn’t allowed is now shown more
consistently. Previously, it was sometimes shown in response to
initializing a view controller.
- Some RecipientPickerViewController code was moved from Obj-C to Swift.
This is probably useful on its own, but it’ll also make it easier to
build some new UI in subsequent commits.
This formats the text users enter on the card donation screen. For
example, "4242424242424242" becomes "4242 4242 4242 4242".
It uses [the `textField(_:shouldChangeCharactersIn:replacementString:)`
method of `UITextFieldDelegate`][0] to accomplish this, and implements a
helper that can handle all the cases (inserting, deleting, replacing,
pasting, and so on).
Tested this in an iPhone 14 simulator and on a physical iOS 12 device.
[0]: https://developer.apple.com/documentation/uikit/uitextfielddelegate/1619599-textfield
Currently, only some `JobQueue` types are initialized during startup
(as part of `Environment`, or `SSKEnvironment`). Initialization is
required, however, for a `JobQueue` type to restart any latent jobs.
That means that, for example, a durable `SendGiftBadge` job that failed,
and should be reattempted at a later date, will not in fact be restarted
since no `SendGiftBadgeJobQueue` will be initialized at launch.
This change adds `SSKJobQueues` and `SignalMessagingJobQueues` types,
which are intended to be singletons that hold within them a singleton
job queue for each of our `JobQueue` types. These wrappers are added to
`SSKEnvironment` and `Environment` (from SignalMessaging) respectively,
ensuring that all the `JobQueue`s they contain are initialized as part
of environment setup. The wrappers also avoid the need to add a new
property to the (already large) environment types for each new future
`JobQueue`.
This change also updates all existing call sites that accessed a
`JobQueue` from an environment object, to direct that access now through
the wrapper type.
Some changes:
- Convert most of the code to Swift.
- Update the search result section headers to “Find by Number”/“Find by
Username” instead of “Phone number search”/“Username search”.
- Remove “New message to:” from the rows & update the icons.
- Don’t look up phone numbers until the user taps the row. As a result,
there’s no “No user found. Invite via SMS?” row.
- Restore the invite via SMS feature if the user can’t be found. If a
number appears unregistered, we’ll offer to send an SMS.
- Start showing search results after 3 digits (approximately).
- Show potentially-invalid phone numbers to avoid results that disappear
if you happen to type a digit incorrectly.
This removes `showBlockSignalAccountActionSheet` and
`showUnblockSignalAccountActionSheet`, neither of which are used (nor
return any results with `git grep` after this change).
* Un-index deleted private story threads. Omit disabled private story threads from search results
* Fix bad debug assert on empty picker search results
* remove extra didRemove FTS check
This change may improve performance slightly but should have no other
user impact.
`myString.isEmpty` is faster than `myString.count == 0` or equivalent,
because computing `count` may require iterating over the string.
I tried to fix all occurrences of this.
Tested this by sending a message in a group and doing a full
re-registration, just in case I broke something there.
* Shuffle code around, adding UnsentTextAttachment
* Replace usages of TextAttachment with UnsentTextAttachment where applicable, creating an actual TextAttachment (and associated OWSlinkPreview image TSAttachment, if applicable) only per-recipient
* Only upload one text story link preview image attachment and propagate it to the individual TSAttachments created for each destination
* update comments so I don't lose my mind the next time I read this code
* Dedupe text stories sent to the same person via multiple private threads
* fix non-compiling tests
* pr feedback
* apply theme to cells when conversation picker theme changes
* Retain selection UI when reloading conversation picker cells
* Prioritize newly created story threads for conversation picker sort ordering
* Index private story threads for searching
* Add story search results to conversation picker and fix issues with reloading with stuff pre-selected
* PR feedback 1: efficient thread migration
* PR feedback 2: don't allow expansion of story search results
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
* initial approach commit, needs cleanup
* Keep >30s videos for non-story recipients, but split for stories
* Some cleanup
* fix too many chats toast offset
* show tooltip in the send flow
* pr feedback
* Hide camera controls when switching to TEXT.
* Streamline camera capture session state tracking.
Stop camera when switching to TEXT.
* Basic text story composer.
All UI works, but needs fine-tuning and tapping on Next (->) doesn't do anything.
* Run auto-genstrings.
* Adjust text size and alignment as user enters text.
1..49 characters: 34 pt, center-aligned.
50..199 characters: 24 pt, center-aligned.
200.. characters: 18 pt, natural alignment.
* Change default text color in text story composer to white.
* Added support for changing background of text story composer.
Selection is allowed from palette of 5 gradients and 11 solid colors.
* Improve vertical alignment of text in text story composer.
Text (and possible link preview panel in the future) should be vertically
centered in the area above either bottom controls or onscreen keyboard.
* Add UI for attaching a link preview to a text story.
* Add support for posting text stories.
* Lint.
* Start muted, unmute when pressing volume buttons
* move ringer switch observation into its own class
* observe ringer switch in stories
* add foreground time to AppContext; use to drive mute foregrounding behavior
* dont double observe
* mix story volume with others, show volume controls