* Split OWSSignalService into a swift protocol and implementation, migrated from objc
* Put OWSSignalService under SSKEnvironment and use mock in mock environment
* Rename from basename + impl to protocol + basename
* extend mock functionality a bit
* pr feedback
* Improve phone number parsing.
Previously, if you entered a phone number
including a country code during registration you'd
have a duplicate country code. Signal on Android
did not have this bug because it uses a different
API inlibphonenumber. This diff changes iPhone to
use the same API, which is smart enough to remove
the country code from the phone number the user
entered if needed.
Co-authored-by: Evan Hahn <evanhahn@signal.org>
The non-lazy map and filter always make a new array or dictionary,
which is often consumed immediately into a Set. Using `lazy` avoids
that intermediate allocation, as well as the need to loop over the
array or dictionary a second time.
This is a micro-optimization, but several of these accessors are
accessed fairly frequently, so we might as well make them faster.
* update MobileCoin to release v1.2.x, add new 1.2.x testNet enclave
values, migrate deprecated function calls to new alternatives.
* Add new top-level error to convertMCError
use staging for now
* Add mainnet enclave values, revert production/staging environment change from testing. Add comment about libmobilecoin static libraries needing to be built on signal build machine.
* add 2.x series enclave measurements
* Add intel hardening advisory for the new 2.x series of enclaves. This hardening advisory being added has no effect on the 1.2.x enclaves, but is required for the 2.x enclaves.
* Remove commented enclave measurements, change Logger.error to Logger.warn (some failed requests is expected for long-living connections), Add in new testNet enclave measurements
* Update to LibMobileCoin v1.2.2
Co-authored-by: Nora Trapp <nora@signal.org>
Make `encodeE164s` a static method since it doesn’t need to access any
details from the operation instance.
Also move the test to SignalServiceKitTests.
To improve message reliability, we're adding an urgency flag to outgoing
messages. For example, outgoing calls are urgent, but delivery receipts
are not. [Android][] and [Desktop][] have already done this work.
At a high level, I added an `isUrgent` property to `TSOutgoingMessage`s.
It defaults to `true`. Some subclasses, like
`OWSReceiptsForSenderMessage`, override it to return `false`.
Builds off of a few other commits (not necessary to understand this
commit, but might be useful for posterity):
- e858a0d916
- 8c6d2ebe8c
- 402b117221
- 2ba0cd764d
- 266a4663e9
- 8e5009bbf7
[Android]: dc04c8ed98
[Desktop]: 06190b1434
...so we can enable and disable the ring button live. And do so
preserving the user's preferences in case they turn off ringing, then
someone joins the group and it goes over the limit, then someone
leaves the group and it's back under.
MediaGallery and the conversation settings view were the only clients
of this, and both are better served by explicit notifications for the
state transitions they care about.
Both MediaGallery and the conversation settings view care about added
or deleted media attachment streams (that is, attachments that are
downloaded and accessible), but not other updates to the attachments
table. Listening for just those notifications is more efficient than
listening to all database changes (though we still have to handle
background changes coming from other processes, like the share
extension).
Additionally, while here, don't immediately refresh the conversation
settings view if it's not currently showing (say, because it's covered
by the All Media view).
Currently, group (v2) updates are just instances of `TSOutgoingMessage`.
This works, but is inconsistent with other outgoing messages, which
subclass it.
This refactor changes that to make things consistent.
I think this is a useful change on its own, but it will also make future
changes easier.
In adfda71472, we added a disappearing
countdown to the message details screen. It would say something like "6d
23h 58m 6s". Now it just says "6 days 23 hours".
I also reverted some stuff from that commit, because it's no longer
necessary.
Our UI now [matches Android][0].
[0]: 4656cf4bef
There's no reason to special-case "three" vs "four or more" in our
current format (rather than using "three or more"), and in fact the
"three" case wasn't using correct English (it was correct in the
PluralAware table, though). Update both the in-call title text and the
conversation item to use the PluralAware "many" version for "three or
more" people in a call.
This change should have no user impact because it only changes
comments.
We had some comments that referenced the Signal server repo. They
referenced a commit that was a little out of date (from March 2022).
This updates the links.
This change should have no user impact.
We effectively had code like this:
#if TESTABLE_BUILD
foo()
#if TESTABLE_BUILD
bar()
#endif
#endif
The inner ones are unnecessary, so I removed them.
When you compose reply to a message but do not
send it, we would persist the text you entered but
would lose the quoted message to which you were
replying.
This commit adds support for persisting that
information.
ThreadReplyInfo is a new class that uses the
key-value store to associate a single optional
reference to a message with each thread.
The following behaviors are nw:
* When you enter the CVC the input toolbar is
updated to have the quoted message.
* When you exit the CVC the quoted message is
saved.
* When a thread is deleted, the quoted message is
deleted.
* Start muted, unmute when pressing volume buttons
* move ringer switch observation into its own class
* observe ringer switch in stories
* add foreground time to AppContext; use to drive mute foregrounding behavior
* dont double observe
* mix story volume with others, show volume controls
This change should have no direct user impact.
`OWSOutgoingReactionMessage` was untested. This adds a basic test for
its `shouldBeSaved` method.
I think this is a useful change on its own, but may make future changes
easier, too.
SignalServiceKit is currently a separate pod. This makes merges tedious
and error-prone. Ultimately, it slows us down. It might've made sense as
a standalone library before, but it's so tightly integrated now that it
isn't useful to have it be separate.
This changes that, and makes SignalServiceKit a "normal" target.
IMO, most of this change isn't that exciting—just a bunch of changes to
scaffolding. There's one slightly spicier change: our generated
`Acknowledgements.plist` is now a little more clever.
Co-authored-by: Max Radermacher <max@signal.org>
* Propagate ThreadAssociatedData audioPlaybackRate down to CVComponentAudioAttachment
* remove audioplaybackrate from component state; keep only on view state