Commit Graph

7855 Commits

Author SHA1 Message Date
Max Radermacher
73c70d328f
Add UUID.from(data:) that returns the byte count
Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
2022-09-21 11:34:41 -07:00
Michelle Linington
4ada6b3a3f Derive bundle ID from an Xcode build setting
See [#5423][5423].

[5423]: https://github.com/signalapp/Signal-iOS/pull/5423
2022-09-21 18:10:42 +00:00
Sasha Weiss
bb03be620e
Use "modern" proto fields instead of presentation for incoming group changes 2022-09-20 10:44:42 -07:00
Evan Hahn
02494b048a
Hide left groups from various pickers
If you've left a group, we shouldn't show it in any pickers except the
blocking manager (`AddToBlockListViewController`). Before this commit,
we were showing it in a few places. That might let you sorta-send a
message to a group you'd left.

I enumerated all the places where we have pickers, and what their
behavior should be.

| Description                                                           | Code                                        | Show groups?             | Show left groups?        |
| --------------------------------------------------------------------- | ------------------------------------------- | ------------------------ | ------------------------ |
| Various group member pickers (adding members, group story recipients) | `BaseMemberViewController`                  | No                       | N/A                      |
| Send payment screen                                                   | `PaymentsSendRecipientViewController`       | No                       | N/A                      |
| Gift badging “choose recipient” screen                                | `BadgeGiftingChooseRecipientViewController` | No                       | N/A                      |
| Composer                                                              | `ComposeViewController`                     | Yes, only when searching | No                       |
| Add to block list (in Settings → Privacy)                             | `AddToBlockListViewController`              | Yes, only when searching | Yes, only when searching |
| Share sheet                                                           | `SharingThreadPickerViewController`         | Yes                      | No                       |
| Message forwarding                                                    | `ForwardMessageViewController`              | Yes                      | No                       |
| In-app camera                                                         | `CameraFirstCaptureSendFlow`                | Yes                      | No                       |
| Share group link via Signal                                           | `GroupLinkViewController`                   | Yes                      | No                       |
| Share sticker pack, from in a chat                                    | `StickerPackViewController`                 | Yes                      | No                       |
| Share sticker pack, from sticker management screen                    | `ManageStickersViewController`              | Yes                      | No                       |
| “New Group Story” screen                                              | `NewGroupStoryViewController`               | Yes (exclusively)        | No                       |

This doesn't intend to change the behavior of *deleted* groups. Those
will show up when searching if groups are shown at all. For example, a
deleted group will show in the composer if you search for it just like
any other group. A deleted group will *not* show in the "send payment"
screen because groups are never shown there. Again, the behavior around
deleted groups should remain unchanged.

Co-authored-by: Max Radermacher <max@signal.org>
2022-09-20 14:36:36 +00:00
Nora Trapp
10d3e6509e Render 'Partially Sent' story failure state 2022-09-18 00:00:49 -07:00
Harry
ae4837e600
Segment story videos longer than 30s
* initial approach commit, needs cleanup

* Keep >30s videos for non-story recipients, but split for stories

* Some cleanup

* fix too many chats toast offset

* show tooltip in the send flow

* pr feedback
2022-09-16 15:29:44 -07:00
Nora Trapp
4c35bc4201 Make sure sending stories are marked failed at app launch 2022-09-16 11:28:34 -07:00
Nora Trapp
9776699137 Sync when contacts become unregistered 2022-09-15 14:09:03 -07:00
Evan Hahn
48c3946204 Re-enable gift badging on internal/debug builds 2022-09-15 13:54:32 -07:00
Evan Hahn
5a15f2f224
Move message padding to Data
Message padding is currently on `NSData`.

This moves it to Data, and rewrites everything in Swift.

Tested this by sending and receiving a message.
2022-09-15 12:50:20 -05:00
Max Radermacher
896957d610 Add CDSv2 constants 2022-09-15 10:28:09 -07:00
Nora Trapp
6807ad8f02 Properly drop stories from untrusted sources 2022-09-15 10:26:34 -07:00
Evan Hahn
4d55d95869 Autofix SwiftLint whitespace issues
I recommend reviewing this with whitespace changes disabled.
2022-09-15 16:37:44 +00:00
Evan Hahn
5ca3ad15a9
Temporarily disable gift badging 2022-09-14 17:10:50 -07:00
Nora Trapp
5acc8ae695 Store profile keys received on story messages 2022-09-14 15:40:31 -07:00
Sasha Weiss
0d71fe2c67
Cut-paste extension to its own file 2022-09-14 15:11:25 -07:00
Sasha Weiss
1650a216af
Adjust comment about UUIDs in SignalServiceAddress 2022-09-14 14:32:17 -07:00
Sasha Weiss
28709f9b27
Remove GroupManager#GroupUpdate enum 2022-09-14 11:23:12 -07:00
Evan Hahn
76f83eaa46 Fix crash when trying to fetch -1 as a UInt from the database
Here's a simplified version of the code we currently have:

      let sql = """
        SELECT COUNT(*) - 1
        FROM my_table
        WHERE id >= :current_id
      """
      return try UInt.fetchOne(db, sql: sql)

This causes GRDB to throw an error when the result of the query is `-1`
because `-1` can't be converted to an unsigned integer. This caused a
crash.

I believe the `- 1` subtraction exists to filter out the current
interaction, so I updated the SQL to effectively be:

    SELECT COUNT(*)
    FROM my_table
    WHERE id > :current_id

This should prevent us from ever selecting `-1`, and therefore prevent
this crash.
2022-09-14 17:23:47 +00:00
Sasha Weiss
f19eb02565
Improve read sync logging 2022-09-14 09:59:25 -07:00
Igor Solomennikov
607fdc810e
Add support for multi-point gradient background in text stories.
Also update palette of background colors and gradients to latest spec.
2022-09-14 08:26:23 -07:00
Evan Hahn
4445f0cedf
Improvements to PNG transcoding 2022-09-13 23:22:50 +00:00
Sasha Weiss
edc9b13ba3
Use a dedicated error to recover from conflicts when updating a group on the service 2022-09-13 15:28:51 -07:00
Harry
5c5058c1d1
Sync onboarding story view state
* add hasViewedOnboardingStory to account record

* Post notifications for TSAccountManager onboarding state

* fix bug with local addressing when updating profile key data

* sync onboarding story view status with accountRecord

* do the bare minimum to keep tests working

* use asVoid
2022-09-13 14:05:34 -07: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
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