Commit Graph

115 Commits

Author SHA1 Message Date
Harry
ef1dfc1316
Add messageBody as a type of DisplayableText 2023-07-07 13:41:24 -07:00
Max Radermacher
3664cafe88
Simplify and fix issues with chat colors 2023-07-07 13:15:21 -05: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
Max Radermacher
ebc5e15b9e Improve code to fetch thread for a given message 2023-06-23 12:48:30 -05:00
Harry
9be80f0bb2
Merge message body styles of the same type that overlap 2023-06-15 08:41:35 -07:00
Igor Solomennikov
0686b39547 Add necessary imports to Swift files.
Those would be required for future PRs.
2023-06-13 14:46:12 -07:00
Harry
f728457039
Update build target to iOS 13.0 2023-06-08 16:21:20 -07:00
Igor Solomennikov
b736a1c205
Convert BlockListUIUtils to Swift. 2023-06-07 11:44:08 -07:00
Igor Solomennikov
c457cefc94
Convert UIViewController+Permissions to Swift. 2023-06-07 11:36:46 -07:00
Igor Solomennikov
fd665ad9b9 Remove unused OWSAnyTouchGestureRecognizer 2023-06-06 16:49:58 -07:00
Igor Solomennikov
c58de3bb5e
Convert RecipientPickerVC to Swift. 2023-06-05 09:59:34 -07:00
Max Radermacher
ca3b018734
Add & use DisappearingMessagesConfigurationStore 2023-06-05 11:00:38 -05:00
Igor Solomennikov
c0b01db156
Convert Environment from SignalMessaging to Swift as SMEnvironment. 2023-06-02 20:53:07 -07:00
Igor Solomennikov
0ed81d560a
Convert OWSPreferences in SignalMessaging to Swift as Preferences. 2023-06-01 11:29:08 -07:00
Igor Solomennikov
064346e45a
Convert OWSSounds to Swift. 2023-05-30 10:23:08 -07:00
Max Radermacher
94f96fcd8e
Migrate SignalRecipient to SDSCodableModel 2023-05-24 15:50:17 -07:00
Max Radermacher
6cfab06a3c Fetch mentioned messages as part of async loads 2023-05-24 09:51:23 -07:00
Igor Solomennikov
7790837eb5
Remove unnecessary "@objc" in SignalMessaging. 2023-05-16 16:41:49 -07:00
Igor Solomennikov
c054f3de91
Remove unnecessary "@objc" in SignalUI. 2023-05-16 16:39:19 -07:00
Marissa Le Coz
4be334c5ad
Migrate SignalAccount to use SDSCodableModel 2023-05-11 17:34:15 -04:00
Harry
1fe5612cff
Support text formatting in text stories 2023-05-11 10:42:37 -07:00
Harry
c8da382654
Handle text formatting styles in conversation list snippets 2023-05-03 22:04:05 -07:00
Harry
b3700d07ce
Refactor mention/style/search result attribute application 2023-05-01 13:57:07 -07:00
Igor Solomennikov
6dd3d9a6f2
Convert all convenience methods in UIFont+OWS to Swift. 2023-04-18 17:14:51 -07:00
Max Radermacher
e5baf249e2 Be delicate with earpiece proximity 2023-04-13 10:40:02 -07:00
Evan Hahn
58e276d0f0
Remove UIUtil.h 2023-04-12 14:59:59 -05:00
Max Radermacher
a0a552682d
Improve search perf with lots of group members 2023-04-10 19:31:46 -07:00
Max Radermacher
3b75249144
Stop performing searches if they’ve been canceled 2023-04-10 13:38:14 -07:00
Harry
224e5a7c6b
Parse text formatting styles in MessageBody
* add deserialization test for MessageBodyRanges

* Add style ranges to MessageBodyText

* add deserialization tests and fix small other test

* add basic mention hydration tests

* Add RTL support for @mention hydration

* Add a test with accents for unicode shenanigans

* unique-ify TODOs

* Add emoji test and fix implementation to account for multi-point unicode that is captured in NSString.length but not String.count

* Add more TODOs for text formatting

* Collapse style ranges on init

* Handle mention overlaps on MessageBodyRanges init

* add tests, update existing tests, fix bugs

* Update v2 deserialization test; the meaning of Style raw values has changed

* comment nit
2023-04-04 12:46:09 -07:00
Max Radermacher
a254819cc7 Improve performance of link fetcher unit tests 2023-03-27 11:30:21 -07:00
Evan Hahn
690bea4349
Improve handling of ambiguously-typed audio messages from Android
See <https://github.com/signalapp/Signal-iOS/issues/3590>.
2023-03-24 16:13:31 -05:00
Max Radermacher
93d97da82b
Split “in progress” & “saved” voice message drafts 2023-03-08 15:31:56 -08:00
Max Radermacher
7ac03076e6
Consolidate link preview fetching code 2023-02-21 12:49:25 -08:00
Ehren Kret
c0d77ee5c3
use consistent sign on last interaction row id 2023-02-18 00:33:44 -06:00
Max Radermacher
9a4bb85c44 Fix text story sharing from the share extension 2023-02-10 15:54:37 -08:00
Harry
003cc19e62
Update SignalCoreKit. Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params
* Use explicit DispatchQueue instead of relying on the implicit type on promise 'on' params

* Update SignalCoreKit
2023-02-07 16:14:39 -08:00
Evan Hahn
b95a1c4363
Make FullTextSearchFinder stateless
This change should have no user impact. I think this is a useful
cleanup.
2023-02-06 13:33:43 -06:00
Evan Hahn
2f384bf7a9 Remove unused methods from FullTextSearcher
This removes `filterThreads`, `filterGroupThreads`, and their
dependencies.
2023-02-03 11:53:02 -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
Max Radermacher
386ca8a006
Simplify InviteFlow 2023-01-10 18:45:48 -08:00
Max Radermacher
103f9ed8b8 Fix typo: Convsersation → Conversation 2022-12-30 09:18:49 -06:00
Igor Solomennikov
41b1469f7a
Convert OWSAudioPlayer to swift and lose 'OWS' prefix.
Also rename OWSAudioSession to AudioSession for consistency with everything else.
2022-12-06 16:00:58 -08:00
Evan Hahn
53642df893 Format credit/debit card donation inputs
This formats the text users enter on the card donation screen. For
example, "4242424242424242" becomes "4242 4242 4242 4242".

It uses [the `textField(_:shouldChangeCharactersIn:replacementString:)`
method of `UITextFieldDelegate`][0] to accomplish this, and implements a
helper that can handle all the cases (inserting, deleting, replacing,
pasting, and so on).

Tested this in an iPhone 14 simulator and on a physical iOS 12 device.

[0]: https://developer.apple.com/documentation/uikit/uitextfielddelegate/1619599-textfield
2022-11-23 18:49:21 -06:00
Sasha Weiss
242dfd2bce
Add all JobQueues to environment, via a wrapper
Currently, only some `JobQueue` types are initialized during startup
(as part of `Environment`, or `SSKEnvironment`). Initialization is
required, however, for a `JobQueue` type to restart any latent jobs.
That means that, for example, a durable `SendGiftBadge` job that failed,
and should be reattempted at a later date, will not in fact be restarted
since no `SendGiftBadgeJobQueue` will be initialized at launch.

This change adds `SSKJobQueues` and `SignalMessagingJobQueues` types,
which are intended to be singletons that hold within them a singleton
job queue for each of our `JobQueue` types. These wrappers are added to
`SSKEnvironment` and `Environment` (from SignalMessaging) respectively,
ensuring that all the `JobQueue`s they contain are initialized as part
of environment setup. The wrappers also avoid the need to add a new
property to the (already large) environment types for each new future
`JobQueue`.

This change also updates all existing call sites that accessed a
`JobQueue` from an environment object, to direct that access now through
the wrapper type.
2022-11-09 14:08:44 -06: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
Evan Hahn
25aef2ee45 Remove two unused blocklist methods
This removes `showBlockSignalAccountActionSheet` and
`showUnblockSignalAccountActionSheet`, neither of which are used (nor
return any results with `git grep` after this change).
2022-11-03 11:41:41 -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
Sasha Weiss
e924cb50df
Hide the dropped-members banner more permanently when dismissed 2022-10-29 13:26:26 -07:00
Max Radermacher
a51ce6ba2d Remove presentAddThreadToProfileWhitelist
It’s unused as of aab95db806.
2022-10-24 10:19:06 -07:00