Commit Graph

58 Commits

Author SHA1 Message Date
Max Radermacher
456f2037ee
Stop putting kLocalProfileUniqueId in addresses 2024-04-23 13:58:27 -05:00
Jordan Rose
b0de59f2e2 Remove required from every init that is not dynamically dispatched
This included:
- Removing unavailable inits wholesale if no longer `required`
- Marking a few classes `final` so they could continue using
  `Self(...)` rather than `OWSWhatever(...)`
2024-04-01 15:27:20 -07:00
Jordan Rose
2727a70b90 Make AtomicValue's lock-sharing explicit
Also:
- Remove AtomicUInt's @objc, it's no longer used from ObjC
- Remove Codable conformances, they would implicitly use shared locks
  and weren't used in practice
2024-03-27 10:57:32 -07:00
Max Radermacher
be4cada92d
Clean up some info lines 2024-03-27 12:08:43 -05:00
Ehren Kret
d4e17730f3 remove import SignalMessaging statements 2024-03-12 03:35:34 -05:00
Ehren Kret
9c7078b3f8 migrate OWSContactsManager to swift
as the last remaining objective-c file, this removed direct dependency
from the SignalMessaging framework headers on SignalServiceKit and
thus required adding lots of import statements
2024-03-09 10:45:55 -06:00
Elaine
b9969f676e
Add full screen avatars to contact spoofing prevention sheet 2024-02-12 14:35:26 -07:00
Max Radermacher
d24c370cb1
Convert OWSUserProfile to SDSCodableModel 2024-01-24 17:14:10 -06:00
Max Radermacher
208e234692
Remove a bunch of debug()/verbose() lines 2023-11-17 16:40:49 -06:00
Max Radermacher
dc6057f69c
Remove some remote configs that aren’t needed 2023-11-15 19:04:09 -06:00
Sasha Weiss
06e1a416cc
Remove the "Any...Finder" pattern from a bunch of types 2023-08-21 10:27:07 -07:00
Max Radermacher
3f522fa57a
[ServiceId] Update StoryMessage 2023-08-15 12:45:20 -05:00
Elaine
80b11735eb
Group stories on share sheets 2023-07-27 09:35:19 -06:00
Igor Solomennikov
0e9d511d1d
SignalUI cleanup.
• convert ObjC code from UIView+SignalUI to Swift.
• separate code from UIView+SignalUI to smaller files by functionality.
2023-06-23 14:36:21 -07:00
Igor Solomennikov
c054f3de91
Remove unnecessary "@objc" in SignalUI. 2023-05-16 16:39:19 -07:00
Igor Solomennikov
bb2b665f6f
Convert Theme to Swift. 2023-05-02 12:49:36 -07:00
Max Radermacher
898fd2c4d5
Clean up queue names 2023-02-27 14:16:09 -08:00
Evan Hahn
198fc1784a
Consolidate one-time & monthly donation screens
Previously, one-time donations were on one screen and monthly donations
were on another. Now, they're on a single screen with a picker.

Most of the interesting changes are in `DonateViewController`.

Other things of note:

- There are some new TODOs here for existing bugs I didn't fix. For
  example, one-time donations don't do so well if there are any problems
  at all.

- Even though we only support Apple Pay, there's code that alludes to
  additional payment methods. For example,
  `DonateChoosePaymentMethodSheet`. We'll expand on this in the future.

- Users should only be able to select currencies that the server
  supports. For example, you shouldn't be able to select EUR if the
  server doesn't support euros. This wasn't working correctly before,
  but is fixed here.

  We already fixed one part, where users could change to an unsupported
  currency (see dab02f30ae). However, if
  your _default_ currency is unsupported and you didn't change it,
  that's no good. This is unlikely for most users but could happen.

  I fixed this by changing it from (effectively)
  `Locale.current.currencyCode ?? "USD"`, which might not be supported,
  to a preference list, choosing the first one the server likes.

- I skip animations if the Reduce Motion setting is enabled.

- On the donation screen, the logic for the preview badge has changed
  slightly. If you already have a badge, we'll always use that.
2022-11-08 16:27:50 -06:00
Harry
075133be72
Observe story viewed ring changes in ConversationAvatarView
* 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
2022-10-25 12:57:52 -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
Nora Trapp
3c2096ad71 fix reversal of photo and story view buttons 2022-10-03 21:35:32 -07:00
Nora Trapp
b60a862e17 allow choosing if you want to view story or avatar 2022-09-12 11:23:23 -07:00
Evan Hahn
29c0ddf60e Fix violations of SwiftLint's attributes rule
_I recommend reviewing this with whitespace changes disabled._

Most of these were `@objc` being on the same line, which I fixed with [a
silly script][1]—probably could've used `sed` if I were wiser. The rest
were manual fixes.

See [the SwiftLint documentation for this rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
[1]: https://gist.github.com/EvanHahn-Signal/d353c93fa269c82b96baca0a1086521f
2022-05-14 09:07:42 -05:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Nora Trapp
0e66da0e67 Integrate design feedback 2022-03-17 14:29:44 -07:00
Nora Trapp
52a3182f13 Render story rings on avatars 2022-03-16 17:52:43 -07:00
Martin Böttcher
f670447fd9
removed some compiler warnings (#4027) 2022-03-02 09:26:58 +01:00
Martin Böttcher
9ce447de57
refactored async loading of avatar images in HomeView (#3886)
* refactored async loading of avatar images in HomeView

* async loading avatars does not use extra DispatchWorkItems anymore

* minor code changes, added comments
2022-01-13 09:13:12 +01:00
Martin Böttcher
9b3c809bdf
made async avatar loading in homeview more robust (#3881)
* made async avatar loading in homeview more robust

* async loading of avatar images in the background should not interfere with foreground operations anymore

* corrected handling of loading avatars not triggered from the home view

* better separation between existing avatar load calls (sync and async) and new async-only call used in HomeViewCell. Should eliminate side-effects and improve performance.
2022-01-08 08:46:12 +01:00
Martin Böttcher
b498b6552c code cleanup 2022-01-05 10:18:34 +01:00
Martin Böttcher
858261ee61 async avatar loading will be performed in a serial queue because it uses much less memory 2022-01-04 09:54:50 +01:00
Martin Böttcher
923d8714d4 async avatar loading will only be excecuted from new method called in HomeViewCell 2021-12-28 11:17:57 +01:00
Martin Böttcher
925297509c made changes more thread safe 2021-12-28 10:30:06 +01:00
Martin Böttcher
f510d5ca13 removed unnecessary code 2021-12-27 13:17:51 +01:00
Martin Böttcher
267e5fb22a avatar loading using concurrent queue 2021-12-23 10:05:19 +01:00
Martin Böttcher
c5aab9116c changed async loading of avatar images: no races and faster 2021-12-23 09:21:02 +01:00
Martin Böttcher
09ed7d26f5 added placeholder image during async avatar loading 2021-12-22 10:18:05 +01:00
Martin Böttcher
d8095af5fd home view: loading and displaying avatars asynchronously 2021-12-21 11:29:22 +01:00
Michelle Linington
5a645228b0 Fix issue where avatars flicker sporadically
Our AvatarBuilder caches were cleared in their entirety any time a
profile changes. If a profile update raced with a avatar fetch in
ConversationAvatarView, they'd blink briefly while the cached items were
removed.

This change ensures that we're only clearing out avatars that are
associated with an updated profile.
2021-11-22 17:01:07 -08:00
Michelle Linington
fdc1c66533 Add tap targets to badge in conversation settings
Also reorders the conversation settings page
2021-11-18 16:01:51 -08:00
Nora Trapp
355fd82e07 Add remote config for donor badges 2021-11-17 16:22:19 -08:00
Michelle Linington
1b82ffa6d7 Hook up badge configuration in subscription view
- Adjusts delegate interface to be useful in both cases
- Subscription view controller will now save updated badge settings

Also, a bonus change to disable badges on avatars
2021-11-16 17:44:23 -08:00
Michelle Linington
46b688dd35 Further updates to avatar badges:
- Design speced out explicit offsets for 24pt and 112pt avatars
- We won't show badges in call views

Also fixes a couple bugs:
- Incorrect interpolation of interstitial badge sizes
- We should badge conversation headers and typing indicators
2021-11-15 12:39:41 -08:00
Michelle Linington
f2c2c77c8b Fixes a bug around async avatar model updates
A few people reported this issue during the badges bug bash. Avatars
would show stale avatars in incorrect places.

This was due to async model updates being kicked off shortly before a
call to `reset()` the view. Resetting would only clear the image data
and data source but wouldn't do anything to cancel async updates that
were in-progress.

The fix is to tweak the implementation of reset() to go through existing
paths that account for this by incrementing the model generation. This
ensures that the async update will be dropped when it resolves and sees
that the model generation was incremented underneath it.
2021-11-15 12:38:04 -08:00
Michelle Linington
f723cedb89 Badges avatars with custom diameters
- We now lerp the badge sprite to the closest design spec available
- Also enables badges on internal builds
2021-11-11 20:18:30 -08:00
Michelle Linington
0b9c6727a6 Fixes various small bugs
- Clear out avatar cache on local profile changes too
- ConversationAvatarView properly handles local profile updates
- Fix some tiny UI bugs in group calls
2021-11-10 21:27:17 -08:00
Michelle Linington
cc4f5fe9d4 PR Feedback:
- Consistent use of ConversationStyle
- LocalUserDisplayMode is now a required initializer argument

Also a small bug fix around avatar file path URLs
2021-11-09 14:25:55 -08:00
Michelle Linington
905b7f6507 PR Feedback
- Rename the conversation avatar size class enum cases
- Add explanatory comment for explicit type declaration
2021-11-09 14:25:55 -08:00
Michelle Linington
e62bee59b5 Re-add badge to reactor cell
Also re-lints with swiftlint 0.45.0
2021-11-09 14:25:55 -08:00
Michelle Linington
d48d60c8e5 Minor cleanup 2021-11-09 14:25:55 -08:00