* fix story views + replies sheet header update when swiping
* fix my story privacy show more off-by-one
* Disable story sends when hiding a group story. Unhide when enabling story sends to a group story.
* More consistent story tab bar badge offset
* 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
We use RequestMaker in three places: fetching pre keys, sending
messages, and fetching profiles. In the former two cases, we want to
kick off profile fetches when certain errors occur.
However, in the latter case, we’re already doing a profile fetch, so we
don’t need to kick off another.
- If the UD request fails for a profile fetch, the next thing we try
will be a non-UD profile fetch. In the prior version of the code, we’d
also kick off a fresh profile fetch; since we just marked UD as
disabled, this would initiate a redundant non-UD profile fetch.
Instead, we can just rely on the non-UD request that’s underway.
- When a UD request succeeds & we didn’t know the UD access mode, we
update the access mode to the one we used. In the prior version of the
code, we’d also kick off a profile fetch with this access mode.
However, if this is part of a profile fetch, we’ve *just* gotten the
latest profile with the access mode we just saved, so there isn’t a
reason to immediately initiate another fetch.
* 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
* remove unecessary owsFailDebug
* fix context menu icon positioning
* fix layout of custom context menus near the left side of the screen in RTL languages
* UX tweaks for my story cell
* status
* apply theme changes to tab bar that happened while it was hidden
* pr feedback 1
* pr feedback 2
* Fix faulty logic in validation of a URL parsed from string.
`OWSLinkPreview.isPermittedLinkPreviewUrl(parsedFrom:)` has logic to extract
hostname from a string that matches a detected URL. The logic was assuming that
every string begins with a scheme prefix (eg "http://"). That assumption isn't
always correct because NSDataDetector uses HTTP scheme when scheme prefix is not
present (eg "google.com" would result in "http://google.com" being detected).
* Two improvements to "attach link" UX.
• any valid HTTPS url can be attached to a text story, even if the link wouldn't
actually work.
• show progress indicator while fetching a link preview.
* Add "https://" to address in "attach link preview" UI if necessary.
* Use read timestamp in story badge count
* Add StoryBadgeCountManager
* Manager stories tab bar badge count in StoryBadgeCountManager
* Don't mark stories read while the app is backgrounded. Mark them read when foregrounding and on the tab bar
* Only mark the latest story per context as read
* fix tests
* 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
* Add readOnboardingStory to AccountRecord
* Add onboarding story read state to SystemStoryManager
* Sync onboarding story read state with storage service
* fix incorrect delete of unviewed system stories
* Add last read timestamp to StoryContextAssociatedData
* Write lastReadTimestamp on StoryContextAssociatedData
* Copy lastViewedTimestamp over to lastReadTimestamp to simplify badge query
* apply didSets for data that changed at rest
* Add read timestamp to incoming story manifest
* send story message read syncs to linked devices
* Process incoming story message read syncs from linked devices
This change should have no user impact.
We use `NSDecimalNumber` and `Decimal`. This tries to standardize on
`Decimal` where possible (though the former is still needed in a few
places).
Mostly a mechanical change, though a few little things changed.
All of these use `runNowOrWhenMainAppDidBecomeReadyAsync`, and that only
runs the block in the main app, so there’s no need to skip the block if
we’re in an extension.
When using `_isDebugAssertConfiguration()`, one of the two branches will
always be unused. As a result, the compiler complains about unused code.
By putting the entire check inside `assert`, it’s still executed only
when assertions are enabled, but there’s no longer a warning.
Also, use [`ObjectIdentifier`][0] rather than `String(describing:)` as
it’s a more canonical way to uniquely identify types.
[0]: https://developer.apple.com/documentation/swift/objectidentifier
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
• text story composer now has three options: colored text with no background,
colored text on white background, white text on colored background.
• text/background color is switched to black if user chooses background/text
color close to white, to avoid white on white look.
• photo editor has three options from above + white text with colored underline.