* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
In text story composer, link preview might be collapsed to "compact" layout
after user enough text so that there's no more vertical room for both text
and link preview.
This change improves composer behavior to expand link preview back to
"regular" layout if user deletes some or all text and there's now room for both.
* 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
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
• Constrain text styling toolbar width to the width of the story card.
• Align Add Link and Background buttons with the leading edge of text story card.
* Allow to force "compact" style for a link preview view.
Link previews should be displayed in "compact" mode when there's a significant
amount of text.
* RoundMediaButton should never be allowed to be made smaller than its desired size.
* Improved layout for text stories: both composer and viewer.
There is now a shared UI layout logic between editor and viewer, editor being
a subclass of viewer.
New behavior for composer:
• text view will grow in height as much as possible and becomes scollable
when max height is reached.
• link preview starts in "regular" layout (image above the text) and then
is updated to "compact" layout (image on the left, text on the right)
as text view grows.
New behavior for viewer:
• updated font sizes for match spec.
• for extra tall stories text label is scaled down to fit.
* Fix bug where Proceed button would stay disabled after composing a text story.
* Fix two UX issues reported in PR review.