Commit Graph

12 Commits

Author SHA1 Message Date
Igor Solomennikov
444d7046cb
Update "Add to System Contacts" for contact shares.
Always present the flow modally + simplify code.
2024-01-07 17:18:33 -08:00
Igor Solomennikov
8b5e737098
Re-worked Add to System Contacts flow.
The main user-visible change is that adding to system contacts UI will now always be presented modally instead of views being pushed onto current navigation stack.

I have refactored repeated permissions check + view presentation code from individual call sites into a new "flow" class that is now also responsible for presenting contact editing UI.

These changes also fix two issues:
• "Add to Existing Contact" option was missing from group participant's info sheet.
• "Contact Details" was opened in editing mode from individual chat settings screen.
2023-12-08 13:20:42 -08:00
Igor Solomennikov
208579c6de
Convert ContactViewHelper to Swift. 2023-11-14 20:27:25 -08:00
Igor Solomennikov
d923b145b9
Separate text for alert when attempting to share a contact with no permissions. 2023-11-14 20:20:20 -08:00
Harry
aa0e250cb7
[Death to TSAccountManager, long live TSAccountManager][9] Migrate usages of old TSAccountManager to new 2023-10-05 08:56:08 -07:00
Max Radermacher
0935c7e70e
Add PNI column to SignalRecipient 2023-09-06 17:31:16 -05:00
Igor Solomennikov
c054f3de91
Remove unnecessary "@objc" in SignalUI. 2023-05-16 16:39:19 -07:00
Max Radermacher
015803297a
Add .notAllowed to editingAuthorization for iPad 2023-02-01 11:33:37 -08:00
Max Radermacher
3a1556ca46 Clean up & Swiftify allSortedContacts 2023-01-30 12:15:11 -08:00
Max Radermacher
1311d3f665
Refactor contact access code
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.
2023-01-12 09:55:30 -08: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
Matthew Chen
c416609108 Add SignalUI framework target. 2021-10-19 09:39:53 -03:00