Commit Graph

8061 Commits

Author SHA1 Message Date
Nora Trapp
e05a19d962 Handle backgrounding in relay server 2022-09-26 13:48:00 -07:00
Nora Trapp
8d1e038611 Fix bug with link previews 2022-09-26 13:48:00 -07:00
Nora Trapp
e5e9e544b3 Add UI for configuring proxy connection 2022-09-26 13:48:00 -07:00
Nora Trapp
286a930a79 Add support the Signal TLS Proxy 2022-09-26 13:48:00 -07:00
Max Radermacher
084a2b2274 Fix crash when toggling censorship circumvention
Changing the setting updates whether or not it’s enabled, which resulted
in a lock being re-entrantly acquired to check the current value.
2022-09-26 11:40:38 -07:00
Max Radermacher
85d8749048 Don’t check isNSE in LocalDevice.memoryUsageString
This can get called asynchronously during tests, and that can lead to
flakiness if we’re between two tests. There doesn’t seem to be a
compelling reason to only distinguish critical errors from warnings in
the NSE, so distinguish the two types everywhere.
2022-09-26 11:39:29 -07:00
Evan Hahn
0d059d1319
Clean up code for a debug flag
_This change should have no user impact._

This flag had a condition that would always evaluate to `false`. This PR
fixes that, and adds a comment about why it's a little verbose.
2022-09-26 10:20:36 -05:00
Evan Hahn
28e988c4a1 Remove unused thread method
This was added in a0df56a68e but never
used.
2022-09-23 15:39:54 -07:00
Sasha Weiss
9c74e8dfcd
Serialize canceling notifications with posting them 2022-09-23 13:48:05 -07:00
Evan Hahn
4da042c1d5
Clean up database corruption storage code
_This change should have no user impact._

The database corruption flag lives on `UserDefaults`. Currently, this
flag is controlled through `SSKPreferences`, but I kinda think that's
the wrong place—database corruption isn't really a user preference.

This moves it into its own file, tests it, and [drops booleans in favor
of an enum][0]. I think this is useful on its own, but also prepares us
for an upcoming change.

[0]: https://www.luu.io/posts/dont-use-booleans
2022-09-23 18:19:02 +00:00
Harry Sanabria
ad65ef501f Add lastReceivedStoryTimestamp to schema.sql 2022-09-22 17:05:06 -07:00
Sasha Weiss
121161e212
Clear StoryMessage instances when clearing all chat history 2022-09-22 15:22:52 -07:00
Nora Trapp
96d8abac67 PR Feedback 2022-09-22 14:53:29 -07:00
Nora Trapp
7553745603 Enable story sending to groups from sync message 2022-09-22 14:53:29 -07:00
Nora Trapp
1d5d14ac65 Record 'lastSentStoryTimestamp' when story sent sync is received 2022-09-22 14:53:29 -07:00
Nora Trapp
c8dc629351 Show active group stories in the conversation picker 2022-09-22 14:53:29 -07:00
Evan Hahn
c5b4f67613 Swiftify contact thread tests
_This change should have no user impact._

A very mechanical change. No surprises.
2022-09-22 14:41:59 -07:00
Evan Hahn
11c2cf0813
Add basic test for database migration
_This change should have no user impact._

This adds a basic test for database migration, and makes the necessary
changes to make that possible.
2022-09-22 17:24:40 +00:00
Evan Hahn
3cf796e55c
Add utility for remaining disk space 2022-09-22 09:28:42 -07:00
Igor Solomennikov
094fa0f30d
Allow attaching links to text stories with "Generate Link Previews" setting being OFF. 2022-09-21 14:55:49 -07:00
Max Radermacher
88bc6e43d8 Refactor encodeE164s
- Remove duplicate check for a `+` at the beginning of each value.

- Don’t return a big-endian UInt64 from a method. The type information
  (unfortunately) doesn’t include endianness, which makes that approach
  somewhat more error-prone.

- Add a type that tracks validated input/output pairs. Future changes
  will want to perform the validation and then use both input & output.
2022-09-21 12:47:29 -07:00
Max Radermacher
3fdaf367e1
Consolidate Int <-> Data logic 2022-09-21 12:08:45 -07:00
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
95566b6952 Swiftify group thread test
A very mechanical change.
2022-09-14 02:18:33 +00: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
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