Commit Graph

8014 Commits

Author SHA1 Message Date
Evan Hahn
42055d6f50 Actually test an APNG in detector code
This change should have no user impact.

`NSData#isAnimatedPngData` detects whether something is an animated
PNG. Its tests don't actually check a real APNG, though. This adds such
a test.
2022-09-12 20:27:53 +00:00
Evan Hahn
9b9e2b2aca Only compute chunks once in APNG detector
This should not change functionality, but may slightly improve
performance.
2022-09-12 19:15:29 +00:00
Nora Trapp
44791879b4 Remove text story sending feature flag 2022-09-12 12:04:22 -07:00
Nora Trapp
b5fada0529 Update batch identity key fetch to support PNP 2022-09-12 12:01:12 -07:00
Nora Trapp
ad34089ffe Sync group stories with storage service 2022-09-12 12:00:14 -07:00
Evan Hahn
59dde0bc05 APNG tests don't need special Signal-specific behavior
This change should have no user impact.

These tests don't need to inherit from `SSKBaseTestSwift`. They can just
inherit from `XCTestCase`.
2022-09-12 18:59:19 +00:00
Evan Hahn
d17fb06160
Update documentation for APNG detection function 2022-09-12 11:54:09 -07:00
Igor Solomennikov
a6ff75a24c
Text story composer
* Hide camera controls when switching to TEXT.

* Streamline camera capture session state tracking.

Stop camera when switching to TEXT.

* Basic text story composer.

All UI works, but needs fine-tuning and tapping on Next (->) doesn't do anything.

* Run auto-genstrings.

* Adjust text size and alignment as user enters text.

1..49 characters: 34 pt, center-aligned.
50..199 characters: 24 pt, center-aligned.
200.. characters: 18 pt, natural alignment.

* Change default text color in text story composer to white.

* Added support for changing background of text story composer.

Selection is allowed from palette of 5 gradients and 11 solid colors.

* Improve vertical alignment of text in text story composer.

Text (and possible link preview panel in the future) should be vertically
centered in the area above either bottom controls or onscreen keyboard.

* Add UI for attaching a link preview to a text story.

* Add support for posting text stories.

* Lint.
2022-09-12 11:38:28 -07:00
Nora Trapp
b42e12541f Fix a bug with story sender key resending 2022-09-12 10:43:25 -07:00
Nora Trapp
86be80dbd7 Add story info sheet 2022-09-12 10:36:15 -07:00
Nora Trapp
9bd91f66b6 Allow turning off stories 2022-09-12 10:14:09 -07:00
Nora Trapp
95ddec00b5 Redesigned story privacy settings 2022-09-12 10:14:09 -07:00
Max Radermacher
4b806213fb Simplify SignalServiceAddress.serviceIdentifier
The `uuidString` property calls `uuid?.uuidString`. If we use `if let`,
we can eliminate the first `owsFailDebug` at compile-time.

If the phone number isn’t set, there’s no point in returning
`uuidString` -- this is guaranteed to be `nil` if we reach this code.
2022-09-09 20:46:19 -07:00
Sasha Weiss
74852a3ebd
Merge almost-identical profile key fetch methods 2022-09-09 16:21:09 -07:00
Harry
ee1bfdcf1f
Add story viewer onboarding UX
* Add story viewer onboarding UX

* fonts and image tweaks

* trigger onboarding UX from everywhere, not just the story list

* remove usages of NSLayoutConstraint. Use ManualLayoutView for button layout
2022-09-09 14:06:45 -07:00
Nora Trapp
87a5f77254 Mark sync'd story reactions as sent 2022-09-09 13:34:00 -07:00
Nora Trapp
73316f2420 Notify for replies to group stories 2022-09-08 17:12:24 -07:00
Evan Hahn
e5f3367a54 "Flag database as corrupted" button in debug builds
This makes it easier to flag your own database as corrupted. It doesn't
actually corrupt the database, it just sets the "is corrupted" flag.
2022-09-08 16:48:24 -07:00
Nora Trapp
66c25a4afd Batch update identity keys and present safety number sheet on camera first and sharing flows 2022-09-08 09:42:43 -07:00
Nora Trapp
7d0efbc3a5 Allow providing custom threshold to identity keystore when checking for trust 2022-09-08 09:42:43 -07:00
Nora Trapp
54be3e5e21 Add API to lookup safety number changes for a batch of addresses 2022-09-08 09:42:43 -07:00
Nora Trapp
5f07acbaa9 Properly treat stories sync'd from a linked device as 'sent' 2022-09-08 09:24:28 -07:00
Nora Trapp
942ba23d87 Ignore unregistered errors from all non-contact threads 2022-09-08 09:04:07 -07:00
Harry
f768c7ff9e
ignore system stories when checking for expirable stories 2022-09-07 18:49:45 -07:00
Sasha Weiss
f37a0040ad
Replace AuthCredential with AuthCredentialWithPni 2022-09-07 15:39:50 -07:00
Nora Trapp
f58472352c Better handling of safety number errors during story send failure 2022-09-07 13:52:38 -07:00
Sasha Weiss
4085771309
Centralize force-casts in a VersionedProfilesSwift dependency 2022-09-07 12:43:09 -07:00
Max Radermacher
db19029769 Add MrEnclave type 2022-09-07 10:18:04 -07:00
Nora Trapp
f610d74f2b PR Feedback 2022-09-06 16:01:32 -07:00
Nora Trapp
e1f770c40b Allow viewing sending state and resending failed stories from 'My Stories' view 2022-09-06 16:01:32 -07:00
Nora Trapp
60f2ea5cbf Track sending state on StoryMessage 2022-09-06 16:01:32 -07:00
Sasha Weiss
07a5e95d6a
Show the MemberActionSheet for tapped names in group system messages, reapplied 2022-09-06 14:40:01 -07:00
Max Radermacher
fec0b0417b
Use UUID.data instead of reimplementing its logic
Also add a few more tests for remote config buckets.
2022-09-06 12:41:25 -07:00
Harry
9a585ac4c3
Show hidden stories in their own section of the stories list
* Add hidden stories section

* Observe ThreadAssociatedData in StoriesViewController. Update tableview when hidden state changes.

* pre-PR cleanup

* more little cleanup

* run translations script

* begin loading stories on storyVC init

* observe system story hidden state changes

* pr comments

* make filters lazy
2022-09-06 12:26:14 -07:00
Max Radermacher
222bec2fb4 Remove unused return statement 2022-09-06 19:23:26 +00:00
Harry
87d9e5df2a
Set story hidden state from stories view controller context menu
* Set hidden state from stories view controller context menu

* fix toasts when shown on controllers with UIScrollViews as their root views

* delete when hiding the onboarding story

* run translations script

* respond to pr feedback

* add hidden state to systemStoryManager

* use hidden state from SystemStoryManager for onboarding story

* remove unused method
2022-09-06 09:48:06 -07:00
Harry
877986d5ff
Sync story hidden state across devices
* update contactRecord and groupv2 protos to add hideStory flag

* sync contactRecord and groupv2Record with local storyHidden state on ThreadAssociatedData
2022-09-02 13:09:21 -07:00
Harry
de198f118b
Add story hidden state to ThreadAssociatedData
* Add story hidden state to ThreadAssociatedData

* make hideStory column non-null
2022-09-02 12:03:50 -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
Harry
d955e68468
Disable flaky SystemStoryManagerTest case 2022-09-01 13:56:31 -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
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
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
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
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