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.
* 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
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
This dims the button:
let button = OWSButton()
button.dimsWhenHighlighted = true
button.isHighlighted = true
This did not, and I think it should (last 2 lines are switched):
let button = OWSButton()
button.isHighlighted = true
button.dimsWhenHighlighted = true
This also removes an unnecessary `@objc` annotation.
I think this is a useful change on its own but I expect it to make an
upcoming change easier, too.
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.
• 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.
Also in photo editing UI - for text overlays.
Previous implementation used NSAttributedString's ability to set text background
color. Appearance wasn't impressive though as there wasn't a way to add padding
around the text or round corners for the background.
New approach is to add a rectangle background underneath the text - which
story viewer was already doing.
* 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.
* Set hidden state from stories view controller context menu
* fix toasts when shown on controllers with UIScrollViews as their root views
* delete when hiding the onboarding story
* run translations script
* respond to pr feedback
* add hidden state to systemStoryManager
* use hidden state from SystemStoryManager for onboarding story
* remove unused method
Previously, archived groups didn't show up in the "Add to Another Group"
view. Now, they do!
This also orders groups entirely by recency.
This view used `ThreadViewHelper`, which (1) omitted archived groups
(2) had a bunch of dormant database observation code. I removed this
class and replaced it with some inline code that fetches groups.
When calculating layout size of the photo overlay text max width is capped at
how wide UITextView was during editing, with the purpose of preserving wrapping
between editor (UITextView) and overlay (CATextLayer).
Previously though, UITextView was set to auto-shrink its width to content size,
which caused max width to not be not enough after changing the font to a bolder variant.
The fix is to pin UITextView's width to view margins so that all available width
is always used when measuring text overlay height.
Allow to set just the gradient colors, without locations, relying on CAGradientLayer's
uniform color distribution logic.
Also update all the uses of GradientView to only specify colors because all the
places were using just two locations: 0 and 1.
- Revert "More flexible selection styling in CVTextLabel"
(commit e1317d814c)
- Revert "Show the MemberActionSheet for tapped names in group system messages"
(commit 48bc3c07d0)
With more information on the group call lobby screen, it doesn't make
sense to have the entire camera feed replaced with a "Call is Full"
message. Instead, disable the Join button as before, and show a toast
if the user taps on it anyway.