Commit Graph

174 Commits

Author SHA1 Message Date
Harry
190c56b68b
Fix broken navigation when interactive back swiping on root nav controller 2022-11-09 11:59:38 -08:00
Harry Sanabria
fe96c75920 Apply rotation+keyboard updates properly in OWSViewController 2022-11-09 08:51:39 -06:00
Harry
ca64272c56
Fix janky animation caused by uneccessary navbar hidden state changes
* Fix janky animation caused by uneccessary navbar hidden state changes

* Temporary fix for layout crash issues that re-introduces navbar sizing issue
2022-11-08 16:56:03 -08:00
Igor Solomennikov
6a7d6c0fae
Switify some code related to ConversationInputToolbar.
* Remove "@objc" attribution in places related to ConversationInputToolbar where that is no longer necessary.
* Swiftify LinkPreviewState protocol.
* Convert ConversationScrollButton to Swift.
2022-11-07 16:32:59 -08:00
Max Radermacher
9439cc5191
Clean up recipient picker contact/group cells
- Move recipient picker code to the correct file.

- Add a helper to fetch typed reusable table view cells.

- Only set shouldUseAsyncSelection in the one place that uses it.

- Remove some code that was duplicated between sync/async selection.

- Fix some strong references in the async preparation flow.

- Allow network errors when preparing recipients -- these may do network
  fetches, and those can fail for non-interesting reasons.

- Move FindByPhoneNumberDelegate to Swift & make some code private.
2022-11-07 13:02:45 -08:00
Harry
5a42e0e608
A few stories fixes
This change:

- Ensures that the tab bar stays hidden when disabling stories from
  within the stories tab
- Updates the keyboard constraint when orientation changes
- Updates the stories search bar constraint to never resize the safe
  area layout guide
2022-11-07 14:31:37 -06:00
Harry
b415f4f70e
Fix some issues with OWSNavigationController.swift
* this is the dumbest bug fix I have ever experienced

* Fix uneccesary setNavigationBarHidden messing with scroll gestures

* update comment
2022-11-04 16:21:13 -07:00
Max Radermacher
49d7896f8e
Update “Find by Number/Username” to latest designs
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.
2022-11-04 13:40:13 -07:00
Harry
520faa95df
Refactor OWSNavigationController
* make shouldCancelNavigationBack a var

* rename OWSNavigationView->OWSNavigationChildController

* forward delegate calls to OWSNavigationController

* apply theme and style to OWSNavigationBar consistently

fix themeing on gif picker controller

* Use topPinned navbar position. Size the blur effect view using the background view

* Use fade animation when hiding the navigation bar

* fix issues with reduced transparency setting

* pr feedback
2022-11-03 16:40:47 -07:00
Harry
d06babf59f
Translate OWSNavigationController to swift
* Translate OWSNavigationController to swift

* pr feedback
2022-11-03 15:33:02 -07:00
Harry
c745f9a6ae
Refactor OWSViewController
* Remove the useless shouldUseTheme

* Remove the useless shouldBottomViewReserveSpaceForKeyboard

* Add ViewControllerLifecycle

* Use more sensible constraints for keyboard layouts

* Consistent theme updates. themeDidChange is what you subclass, applyTheme is each class' internal application of theme changes, if needed

* Add app lifecycle hooks

* pr feedback

* pass through touches on the keyboard layout view(s)

* fix lint
2022-11-03 13:12:13 -07:00
Harry
2b6d1da564
Un-index deleted private story threads. Omit disabled private story threads from search results
* 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
2022-11-02 11:18:55 -07:00
Evan Hahn
a941c82c14
Prefer isEmpty with strings
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.
2022-11-01 17:53:46 -05:00
Evan Hahn
b72449490c Use contains instead of filter(...).count > 0
This small change should speed up the attachment approval process.
2022-10-31 17:15:31 -07:00
Evan Hahn
f07735f706 Precommit script should fail if lint fails
This change should have no user impact.

I thought I did this in 1b00741b6d7dbfbe48e5b1c46f856902d0e6d02a...this
*actually* does it.
2022-10-28 15:51:02 -07:00
Harry
5865a0a478
Translate OWSViewController to swift 2022-10-28 10:24:55 -07:00
Max Radermacher
f7b18c5ea9 Remove unused BaseMemberViewController code 2022-10-25 00:41:24 -07:00
Max Radermacher
ef1bd4064f Don’t fetch UUIDs when opening BaseMemberVC
(Also, don’t call out recipients that don’t support New Groups.)

We try to populate this picker with users we believe are registered. Now
that GV2 is fully rolled out, all the recipients we believe are
registered should have a UUID. (If any don’t, we’ll resolve that on
launch via UUIDBackfillTask.) Since these proactive fetches *shouldn’t*
run, prevent them from running by removing them entirely.

If we hit a rare race condition where a recipient is missing a UUID,
we’ll still perform a lookup when trying to select that recipient.

In these rare edge cases where a recipient doesn’t have a UUID (which,
again, shouldn’t happen), the subtitle indicating that they don’t
support New Groups will be out of date. By removing proactive fetches,
it’ll remain out of date until the user taps the row. To avoid
confusion, defer showing an error until the user taps on the recipient.
2022-10-25 00:41:24 -07:00
Max Radermacher
ab55cf3929 Import SignalMessaging where it’s needed
The next commit removes a file that, through assorted Swift/Obj-C bridge
magic, resulted in SignalMessaging being available to all these files.
2022-10-24 10:19:06 -07:00
Max Radermacher
09e3c7e3d4 Only show non-empty “Contacts” search results
If the only result is blocked, we’ll show an empty “Contacts” section.
2022-10-24 09:18:28 -05:00
Harry
87db4ab0aa
Better multisend of text stories
* 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
2022-10-20 11:04:25 -07:00
Max Radermacher
1ea74d9266 Fix recipient picker nav bar when theme changes
On iOS 16, the nav bar itself is transparent, so the container view
controller’s background is visible. The color of that view wasn’t being
updated, which resulted in the nav bar appearing the wrong color.

A few view controllers worked around this by manually updating just the
background color to the same value used by the table view. It seems
cleaner to re-apply the overall styling when the theme changes.
2022-10-19 13:20:00 -07:00
Max Radermacher
3b11c52177
Move all ContactDiscoveryTask callers to Swift
* Move `intersectContacts:…` to Swift
* Move RecipientPickerVC contact discovery to Swift
* Remove ObjC support from ContactDiscoveryTask
2022-10-19 08:34:50 -07:00
Max Radermacher
721d0d662f
Consolidate “Find by Phone Number” validation
There were some redundant checks as a result of the duplication between
the validation and lookup methods. Shift more of the logic into the
shared method to avoid repeating the same thing multiple times.

Also, return a single item rather than an `Array`. We only expect a
single result, so there’s no need to pass around an `Array.`
2022-10-19 08:33:48 -07:00
Harry Sanabria
1e227641c9 Once reply sheet is focused and maximized, keep it maximized 2022-10-18 22:38:36 -07:00
Harry
df51a9f837
Story-related conversation picker fixes
* 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
2022-10-18 16:14:16 -07:00
Nora Trapp
8c633c718e Private Story -> Custom Story 2022-10-18 15:41:04 -07:00
Nora Trapp
5be184dc21 Add the ability to view all your signal connections 2022-10-18 13:39:00 -07:00
Nora Trapp
88eafd3458 Don't allow creating a group story for a group we can't message in 2022-10-18 11:09:10 -07:00
Nora Trapp
5f048550e1 Add always dark support to blocking announcement only view 2022-10-18 11:09:10 -07:00
Nora Trapp
d5f4c92018 Update new story button 2022-10-17 23:45:00 -07:00
Nora Trapp
2c59b2f7b3 Fix localization in safety number sheet 2022-10-17 23:43:56 -07:00
Harry
150fb036cb
Fix scaleAspectFill 2: electric boogaloo 2022-10-14 18:11:13 -07:00
Harry Sanabria
da147d9676 Fix MediaMessageView scale fill constraints for portrait images with smaller aspect ratios 2022-10-14 10:09:39 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
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
2022-10-13 08:25:37 -05:00
Harry
9d4fb97dfd
Add story media previews to conversation picker in story send flow
* Support scale aspect fill in MediaMessageView

* show image/video previews on conversation picker when in stories only send flow

* show text story previews in conversation picker

* fix media preview border color

* update rotation for RTL

* PR feedback
2022-10-12 09:59:49 -07:00
Harry
e4316d3a39
A bunch of story fixes
* Hide story video duration tooltip when changing selection

* update story row swipe action title font

* Update tab bar icons

* Fix ghost safe area shown when cancelling an interactive dismiss of a chat view

* Use forced dark theme background color for cell selection in story info sheet

* Exclude hidden story contexts from conversation picker

* remove unused asset

* pr feedback
2022-10-12 09:54:50 -07:00
Max Radermacher
3ffa2dca2c
Fix nullability for countryNameFromCountryCode 2022-10-11 17:30:58 -07:00
Harry
3f0fe34089
Disable view once media in stories send flow
* Disable view once media in stories send flow

* Remove stories from picker if sending a view once media

* dont show view once button if sending to stories from sharesheet
2022-10-11 13:11:48 -07:00
Max Radermacher
ef91c13909 Remove unused RecipientPickerDelegate method
It appears unused since 8e4fd443cc.
2022-10-11 10:13:56 -07:00
Max Radermacher
db2677b0a7 Fix typo in shouldUseAsyncSelection 2022-10-11 10:13:56 -07:00
Evan Hahn
3318cbbb86
Add method to add multiple table sections at once
This should have no user impact.

I think this change is useful on its own, but may also make an upcoming
change easier.
2022-10-11 09:11:25 -07:00
Evan Hahn
2084c90715 Fix genstrings warning for stories string
Quiets this warning:

> genstrings: warning: Key "STORY_SETTINGS_WHO_CAN_VIEW_THIS_FOOTER"
> used with multiple comments "Section footer for the 'viewers' section
> on the 'story settings' view" & "Section footer for the 'viewers'
> section on the 'story settings' view."

Also changes another string for consistency (removes the trailing
period).
2022-10-07 17:10:53 -05:00
Evan Hahn
1b00741b6d
Fix remaining SwiftLint failures, lint more strictly
This fixes our remaining SwiftLint violations, which were small.

It also updates the precommit script to fail if any violations are
found, even warnings. This will cause CI to fail if you include a file
that isn't SwiftLint-compatible.
2022-10-07 12:00:26 -05:00
Max Radermacher
61fd33fa07 Remove redundant property assignments 2022-10-06 17:10:46 -07:00
Nora Trapp
3e9f51e512
Fix some stories strings 2022-10-06 13:06:48 -07:00
Harry
88ed7a0376
Fix group call member sheet header blur effect
* Fix group call member sheet header blur effect

* pr feedback
2022-10-05 12:23:43 -07:00
Harry
29fbb192d5
Add my story privacy settings learn more
* Add my story privacy settings learn more

* light fixes for boost sheet

* PR feedback

* audit usages of InteractiveSheetViewController
2022-10-04 15:11:16 -07:00
Nora Trapp
b9842b5eb2 Allow forwarding to stories 2022-10-03 21:35:32 -07:00
Nora Trapp
ba90b3989d Fix the number of stories rendered on conversation picker 2022-10-03 21:35:32 -07:00