Commit Graph

7947 Commits

Author SHA1 Message Date
Harry
63661ba4c8
Add feature flag for system onboarding story
* Add feature flag for system onboarding story

* switch to dev
2022-08-24 14:51:06 -07:00
Harry
33e26b6c4c
Migrate OWSSignalService from objc to swift, and split it into a protocol and implementation
* 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
2022-08-24 14:36:52 -07:00
Max Radermacher
0f749fdb06 Update CDS MrEnclave
Tested lookups with a contact that exists and one that doesn’t.
2022-08-24 13:58:21 -07:00
Harry
2950667ac9
Split OWSURLSession into a protocol and implementation
* Split OWSURLSession into a protocol and implementation

* Add OWSURLSessionMock

* Rename from basename + impl to protocol + basename

* add simple init for mock session

* nits from pr comments

* pr comments 2
2022-08-24 13:33:27 -07:00
Max Radermacher
91008dd29e Fix indentation in SDSKeyValueStore 2022-08-24 12:17:05 -07:00
Jordan Rose
50e8ef7ed8 Extract TSGroupThread.sortedGroupMembers(...) from FullTextSearcher
This will be used for deterministically listing group members in the
group call lobby, hence some customization that FullTextSearcher
doesn't need.
2022-08-24 12:15:48 -07:00
george-signal
87533d2b67
Improve phone number parsing.
* 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>
2022-08-23 11:56:06 -07:00
Jordan Rose
11cf13a255 Avoid intermediate copies when using dictionary keys as collections
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.
2022-08-23 10:42:11 -07:00
Max Radermacher
4e4b9ec9fd Remove unused code for creating a new group
All call sites use the `avatarData` parameter, not `avatarImage`.
2022-08-22 17:19:50 -07:00
Adam Mork
aac2f37150
[Payments] Update the MobileCoin dependency to the latest 1.2.2 release
* 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>
2022-08-22 13:08:40 -07:00
Max Radermacher
686f99f039 Fix ContactDiscoveryOperationTest
Make `encodeE164s` a static method since it doesn’t need to access any
details from the operation instance.

Also move the test to SignalServiceKitTests.
2022-08-22 09:11:42 -07:00
Nora Trapp
89076ed822 Fix stories tab badging 2022-08-20 15:01:03 -07:00
Nora Trapp
b4c9aa8e64 Fix linting 2022-08-19 14:25:28 -07:00
Nora Trapp
43b010d9be Allow TSOutgoingMessage to build its own transcript, that subclasses can override 2022-08-19 14:23:59 -07:00
Nora Trapp
73e5d939bd future proof story receivedState storage 2022-08-19 14:23:59 -07:00
Nora Trapp
f340250194 Support remote delete of stories 2022-08-19 14:23:59 -07:00
Evan Hahn
48c3c08c10 Fix vertical_parameter_alignment SwiftLint violations
This fixes violations of [SwiftLint's `vertical_parameter_alignment`
rule][0]. This should have no user impact.

[0]: https://realm.github.io/SwiftLint/vertical_parameter_alignment.html
2022-08-18 10:37:09 -05:00
Evan Hahn
da322d3bf9 Add "urgent" boolean to outgoing messages
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
2022-08-18 07:35:41 -05:00
Jordan Rose
e76f81e934 Watch group membership changes in the group call lobby
...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.
2022-08-17 17:59:19 -07:00
Jordan Rose
f434ca0419 Add an outgoing group ring button 2022-08-17 17:59:19 -07:00
Jordan Rose
9819c92464 Add groupRings and maxGroupRingSize to RemoteConfig 2022-08-17 17:59:19 -07:00
Jordan Rose
f8829e341a Stop tracking attachments specifically in ObservedDatabaseChanges
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.
2022-08-17 14:08:16 -07:00
Jordan Rose
7c78505a5b Add an NSNotification for new downloaded attachments
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).
2022-08-17 14:08:16 -07:00
Sasha Weiss
7146a02821
Serialize group updates using OWSOperation 2022-08-17 13:18:31 -07:00
Evan Hahn
e858a0d916
Use subclass of outgoing message for group updates
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.
2022-08-16 14:45:51 -05:00
Evan Hahn
4dffd80aae
Shorten disappearing countdown description in message details
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
2022-08-16 14:35:15 -05:00
Evan Hahn
8c6d2ebe8c Test OWSRequestFactory.submitMessageRequest 2022-08-16 14:12:35 -05:00
Evan Hahn
402b117221 Test OWSRequestFactory.submitMultiRecipientMessageRequest 2022-08-16 14:12:35 -05:00
Nora Trapp
6b48d27bcd PR Feedback 2022-08-15 14:15:11 -07:00
Nora Trapp
66a268f759 Auto-download group stories if the author is from an auto-downloadable context, even if the group isn't 2022-08-15 14:15:11 -07:00
Nora Trapp
9e4faf335e Auto-download stories from people whose stories you have recently viewed 2022-08-15 14:15:11 -07:00
Nora Trapp
0aa84ad80b Ensure stories viewed on other devices are automatically downloaded 2022-08-15 14:15:11 -07:00
Nora Trapp
e2e0585ba8 Record last viewed time on story context 2022-08-15 14:15:11 -07:00
Nora Trapp
1d9a8a8995 Add lastViewedStoryTimestamp to TSThread 2022-08-15 14:15:11 -07:00
Jordan Rose
e5e4e4b2bf Fix message for an ongoing group call with three people
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.
2022-08-15 13:42:05 -07:00
Evan Hahn
2ba0cd764d Update comments that reference server code
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.
2022-08-15 11:54:48 -05:00
Evan Hahn
9c4412ef18
Remove nested compiler conditionals
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.
2022-08-15 09:13:51 -05:00
george-signal
bb33925499
Persist quoted replies
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.
2022-08-11 13:44:50 -07:00
Nora Trapp
0448e9e06a Fix sender-key retry behavior for stories 2022-08-11 13:21:38 -07:00
Nora Trapp
97f1483c03 Implement auto-download logic for stories 2022-08-11 13:08:50 -07:00
Sasha Weiss
43943ca621
Organize GroupV2UpdatesImpl.swift 2022-08-10 16:50:23 -07:00
harry-signal
2a23f61a3f
Video Story muting/unmuting
* 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
2022-08-10 16:25:49 -07:00
harry-signal
4561f0afb8
make threadassociateddata audioPlaybackRate column non-null 2022-08-09 09:55:38 -07:00
Nora Trapp
edc5c7beae Fix schema.sql for 2022-08-08 14:34:51 -07:00
Evan Hahn
e670730637 Update server params for LibSignalClient upgrade
We updated LibSignalClient in 9a5ffcb821.
We also needed to update these server public params.
2022-08-08 11:23:29 -05:00
Nora Trapp
eddba94f51 Allow 4k video playback 2022-08-07 09:19:45 -07:00
Evan Hahn
266a4663e9 Add basic test for outgoing reaction message
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.
2022-08-07 08:57:54 -05:00
Evan Hahn
6305cdc0e6
SignalServiceKit: no longer a separate pod
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>
2022-08-05 16:14:15 -05:00
harry-signal
202c137ced
Propagate ThreadAssociatedData audioPlaybackRate down to CVComponentAudioAttachment
* Propagate ThreadAssociatedData audioPlaybackRate down to CVComponentAudioAttachment

* remove audioplaybackrate from component state; keep only on view state
2022-08-04 15:53:11 -07:00
Sasha Weiss
d1a455b1a2
Collapse join/cancel request events in the chat 2022-08-04 13:07:27 -07:00