Commit Graph

29001 Commits

Author SHA1 Message Date
Sasha Weiss
6eafbc20d2
Check pending/delivered notifications in NSE 2022-09-01 17:06:11 -07:00
Jordan Rose
5cffe49cd2 CallKitIdStore: traffic in threads rather than addresses
This will be the interface used for storing IDs of group calls in the
future; for now there should be no functionality change, except if
there's an address mentioned with no associated thread. Previously
that thread would be created if needed; now the call action will fail.
This seems reasonable given that threads only go away if the user
explicitly deletes them.

While here, we don't need to save both the UUID and phone number of a
user's address; the UUID always wins anyway. Only worry about phone
numbers if there's no UUID.
2022-09-01 16:07:29 -07:00
Sasha Weiss
af6ff96975
Make notificationCenter a static var in UserNotificationsAdaptee 2022-09-01 15:12:43 -07:00
Sasha Weiss
f57fcca526
Set the badge count in the NSE with a closure 2022-09-01 15:12:17 -07:00
Harry
d955e68468
Disable flaky SystemStoryManagerTest case 2022-09-01 13:56:31 -07:00
Jordan Rose
27e50ffcec Report the callee's name to CallKit for an outgoing call
(unless preferences say we shouldn't)

Previously we only gave the callee's phone number to CallKit, which is
fine...when the callee is in your system contacts. Now we match the
behavior of incoming calls and always provide Signal's name for the
callee, though in the system call log a system contact name will
always win.
2022-09-01 12:11:47 -07:00
Evan Hahn
316e2718ec Rewrite [AppDelegate setupNSEInteroperation] in Swift
This should have no user impact.

A pretty mechanical change.

Most notably, I stopped getting a global queue by priority (because it's
deprecated) and switched to QOS. I switched from "high priority" to
"QOS: user initiated" based on [this documentation][0].

[0]: https://developer.apple.com/documentation/dispatch/dispatch_queue_priority_high
2022-09-01 17:24:51 +00:00
Jordan Rose
790b58a5f1 Fix "isVideo" CallKit property for outgoing 1:1 calls
RingRTC hasn't initialized the camera right when the call starts, so
it marks the call as not having local video at the point when we
report it to CallKit. Check the offer type instead.
2022-09-01 09:56:07 -07:00
Max Radermacher
2f3a88e4b1 Update Curve25519Kit
Changes:
- Update deployment target to 12.2
2022-09-01 09:33:29 -07:00
Harry
766f6e95c5
Don't show forward and share context menu options for system stories 2022-09-01 09:11:24 -07:00
Evan Hahn
03dd818cdb
"Add to Another Group": show archived groups, order by recency
Previously, archived groups didn't show up in the "Add to Another Group"
view. Now, they do!

This also orders groups entirely by recency.

This view used `ThreadViewHelper`, which (1) omitted archived groups
(2) had a bunch of dormant database observation code. I removed this
class and replaced it with some inline code that fetches groups.
2022-09-01 08:41:42 -05:00
Nora Trapp
5a6185d7df "Bump build to 5.53.0.1." (nightly-09-01-2022) 2022-09-01 04:01:23 -07:00
Jordan Rose
10dab0bd29 Fix typo ("Unute" -> "Unmute") 2022-08-31 17:51:12 -07:00
Jordan Rose
a13799f1fe Pull CallUIAdapter up to CallService (from IndividualCallService)
This is preparation for putting group calls in CallKit as well, but
for now there's no functionality change here, just moving things
around.
2022-08-31 17:51:12 -07:00
Jordan Rose
c6095d140d Remove unused transaction parameter from CallService.terminate 2022-08-31 17:51:12 -07:00
Jordan Rose
e2376bac02 Prepare call notifications for group call rings
This mainly means passing around SignalCalls instead of
IndividualCalls, but while here it makes sense to be more explicit
about who the caller is.
2022-08-31 17:51:12 -07:00
Jordan Rose
f0ccdd9787 Move localId up from IndividualCall to SignalCall
Group calls don't normally have stable IDs, but we need an opaque ID
to represent a particular ring for CallKit or notifications.

The next commit will drop the localId on IndividualCall, but right now
it's still needed for presenting notifications.
2022-08-31 17:51:12 -07:00
Igor Solomennikov
a74c7e0885
Modify link preview panel UI used in stories viewer to allow its re-use.
• Extract the code into a new TextAttachmentView.LinkPreviewView class.
• Modify the code to accept wider variety of link preview data.
2022-08-31 16:53:38 -07:00
Evan Hahn
6737d09e22
ThreadViewModel no longer needs Objective-C interoperability
The last Objective-C reference to `ThreadViewModel` was removed in
793101f0e4, so we can remove a bunch of
`@objc` annotations.
2022-08-31 15:51:25 -07:00
Jim Gustafson
895a895ed5
Update to RingRTC v2.21.0 2022-08-31 14:57:11 -07:00
Max Radermacher
690a9f0a47
Show precommit.py diff in GitHub Action 2022-08-31 16:53:02 -05:00
Harry Sanabria
e2317b1ee7 "Bump build to 5.53.0.0." (nightly-08-31-2022) 2022-08-31 14:43:45 -07:00
Harry Sanabria
c035828006 Update translations 2022-08-31 14:41:22 -07:00
Nora Trapp
09598d2e7a Add remote flag for stories 2022-08-31 13:34:24 -07:00
Nora Trapp
0b86fc3d0a Fix regression that broke syncing of story viewed state 2022-08-31 13:00:54 -07:00
Harry
8206766336
Up timeout for SystemStoryManagerTest for slow CI 2022-08-31 12:27:09 -07:00
Evan Hahn
793101f0e4 Remove unused isThreadPinned method from ChatListViewController
This change should have no user impact.

Neither Xcode nor `git grep isThreadPinned` yield any relevant results
for this method. At a glance, it seems like its last usage was removed
in d57bc7fe26.
2022-08-31 12:06:49 -07:00
Nora Trapp
7fb88663f7 "Bump build to 5.52.0.6." (nightly-08-31-2022) 2022-08-31 04:01:03 -07:00
Evan Hahn
787a688b08 Rewrite PhoneNumber.tryParsePhoneNumber tests
This change should have no user impact.

This commit:

- Rewrites the tests in Swift
- Removes some redundant tests
- For North American phone numbers, uses `555-01XX` phone numbers
  (because "only 555-0100 through 555-0199 are now specifically reserved
  for fictional use; the other numbers have been reserved for actual
  assignment)
2022-08-31 00:36:06 +00:00
Evan Hahn
a6b395b11f Remove long-skipped phone number tests for Mexico
This change should have no user impact.

This removes a test that's been skipped since 2020 (see
5c976b0acd). I think this is okay given
that (1) we've skipped it for over 2 years (2) [we already have some
tests for Mexican phone numbers][0].

[0]: 895c1b7576/SignalServiceKit/tests/Contacts/PhoneNumberTest.swift (L10-L25)
2022-08-30 16:46:37 -07:00
Harry
b9dd5cb63c
Use final avatar for system author (onboarding story)
* Use final avatar for system author (onboarding story)

* remove onboarding story feature flag
2022-08-30 16:45:37 -07:00
Evan Hahn
27d5d0bbe4 Rewrite [Pastelog showFailureAlertWithMessage] in Swift
This change should have no user impact.

This was a pretty mechanical change.
2022-08-30 16:45:18 -07:00
Evan Hahn
c77a8022ed Hide blocked contacts from recipient pickers
Because we don't show blocked contacts in the recipient picker, we can
also remove some code that checks for blocked contacts.
2022-08-30 22:36:59 +00:00
Harry
7ee39eef63
Add SystemStoryManager
* Add OnboardingStoryManager

* mark onboarding story viewed

* Add tests and fix issues that came up from testing

* up test timeout for slower CI

* rename SystemStoryManager and put into dependency injecton container

* Use viewed state on StoryMessage itself. Have SystemStoryManager observe app lifecyle events to automatically manage the onboarding story

* use iOS assets which are now in s3

* todo cleanup

* increment timestamp for uniqueness

* pr comments

* change literal delimiter

* Add ChainedPromise utility, tests, and use in SystemStoryManager

* discretionarily observe app backgrounding in SystemStoryManager

* renaming from PR comments
2022-08-30 14:49:59 -07:00
Jordan Rose
8a83a04866 SenderKeyStore: Handle cross-process updates
Otherwise the main app can fail to find a new chain key even though
the NSE has already processed the appropriate SKDM, or vice versa.
2022-08-30 12:50:05 -07:00
Igor Solomennikov
b5ee24febe
Fix an issue causing incorrect line wraps in media editor's text overlays.
When calculating layout size of the photo overlay text max width is capped at
how wide UITextView was during editing, with the purpose of preserving wrapping
between editor (UITextView) and overlay (CATextLayer).
Previously though, UITextView was set to auto-shrink its width to content size,
which caused max width to not be not enough after changing the font to a bolder variant.
The fix is to pin UITextView's width to view margins so that all available width
is always used when measuring text overlay height.
2022-08-30 10:36:41 -07:00
Nora Trapp
f8f17e0770 "Bump build to 5.52.0.5." (nightly-08-30-2022) 2022-08-30 04:00:59 -07:00
Evan Hahn
2cadfc6524 Remove debug-only "send to self" debug logs action 2022-08-30 01:41:20 +00:00
Jordan Rose
4b9308f965 Handle video calls for INStartCallIntent
And use @available to avoid having to refer to classes and methods by
name instead of directly.

(And remove a very old, implemented TODO.)
2022-08-29 16:58:47 -07:00
Meher Kasam
44431f1920 Add "Speak Message" accessibility feature
If "Speak Selection" is enabled in your iOS settings, you can now choose
to speak the message.

See [#5417][0] for more details.

Co-Authored-By: Evan Hahn <evanhahn@signal.org>

[0]: https://github.com/signalapp/Signal-iOS/pull/5417
2022-08-29 16:25:04 -05:00
Jordan Rose
73fdd49d9a Use conversation state to decide if the user can ring a group at first
- Refactor the enum RingMode into an option set RingRestrictions
- Keep track of whether the call is empty in RingRestrictions rather
  than by directly inspecting peek info every time
- Set the initial callInProgress restriction by looking for unended
  calls in the database (the same thing used to show the "Join Call"
  button in the conversation view)
- Use the more-reliable callInProgress restriction everywhere we need
  to check if there's a call in progress
- If we think there's a call in progress but don't have peek info,
  wait until we get peek info to show status text in the call lobby

This provides a more orthogonal model for ring restrictions, which is
important for tracking "group too large" and "call in progress"
independently. Either can change but the state of the other still
determines how the UI should be updated.
2022-08-29 13:35:27 -07:00
Evan Hahn
c1eede8384 Rewrite [Pastelog collectLogsWithErrorString] in Swift
This change should have no direct user impact.
2022-08-29 20:16:37 +00:00
Max Radermacher
7e8bf3a6d4 Update KBS MrEnclave
TEST CASES:

Restoring from the old enclave:
- Register on the old code.
- Delete the app.
- Register with the new code, restoring with a PIN.

Migrating to the new enclave & restoring:
- Register on the old code.
- Update and run the new code.
- Delete the app.
- Register with the new code, restoring with a PIN.

Registering a new account:
- Register with the new code, setting up a brand new account.

Registration lock via the old enclave:
- Register on the old code (#1) & enable registration lock.
- Delete the app.
- Register on the new code (#2).
- Run change number (#2 -> #1) on the new code.
- Confirm both enclaves were checked.

Registration lock via the new enclave:
- Register on the new code (#1) & enable registration lock.
- Delete the app.
- Register on the new code (#2).
- Run change number (#2 -> #1) on the new code.
- Confirm only the new enclave was checked.
2022-08-29 09:12:35 -07:00
Nora Trapp
8bd91e6571 "Bump build to 5.52.0.4." (nightly-08-29-2022) 2022-08-29 04:00:56 -07:00
Evan Hahn
4fc5d75793 Update libPhoneNumber-iOS
This updates our libPhoneNumber dependency. See [the libPhoneNumber-iOS
commit][0].

According to [the upstream libphonenumber release notes][1], they
updated the formatting for +49 numbers. That caused a test to break, so
I updated it (and tested a few additional dialing codes).

[0]: 8b6f552682
[1]: 90503ecef3/release_notes.txt (L21)
2022-08-28 15:31:06 +00:00
Nora Trapp
333d9e4a8e "Bump build to 5.52.0.3." (nightly-08-27-2022) 2022-08-27 04:00:49 -07:00
Igor Solomennikov
981382ab65
Add explicit public initializer for TextAttachment.Background.Gradient struct.
This would allow initializing TextAttachment.Background.Gradient outside
of SignalServiceKit module.
2022-08-26 20:58:30 -07:00
Igor Solomennikov
6c1ed8d0dd
GradientView API improvement.
Allow to set just the gradient colors, without locations, relying on CAGradientLayer's
uniform color distribution logic.

Also update all the uses of GradientView to only specify colors because all the
places were using just two locations: 0 and 1.
2022-08-26 20:58:04 -07:00
Max Radermacher
1e056bfe71 Remove debug code to prepopulate change number 2022-08-26 14:43:09 -07:00
Max Radermacher
74c0bd93a7 Properly specify isComplete on contact syncs 2022-08-26 14:42:57 -07:00