Commit Graph

7887 Commits

Author SHA1 Message Date
Nora Trapp
6930ffe2fa Remove old group capabilities 2022-09-29 09:35:00 -07:00
Nora Trapp
dd37ca526d Allow NSE to manage lifetime of proxy relay server 2022-09-27 17:05:05 -07:00
Sasha Weiss
063acc1419
Batch messageId notification cancellations 2022-09-27 14:26:44 -07:00
Evan Hahn
4de8ffa6af
Remove dead accessor from legacy message type
This change should have no user impact.

`TSInvalidIdentityKeyReceivingErrorMessage` had an unused method,
`theirSignalId`. This removes it.

`git grep -i theirSignalId` returns no results after this change.

I think this is a useful change on its own, but will also be useful in
an upcoming change.
2022-09-27 16:05:59 -05:00
Evan Hahn
653cb30a59 Use reserved in protobufs
_This change should have no user impact._ And you can see that the only
changes to generated files are in comments.

Before this change, we used comments to denote reserved or deprecated
fields. This works, but I think we should instead use the `reserved`
keyword, which offers a few advantages. From [the protobuf docs][0]:

> If you update a message type by entirely removing a field, or
> commenting it out, future users can reuse the field number when making
> their own updates to the type. This can cause severe issues if they
> later load old versions of the same .proto, including data corruption,
> privacy bugs, and so on. One way to make sure this doesn't happen is
> to specify that the field numbers (and/or names, which can also cause
> issues for JSON serialization) of your deleted fields are reserved.
> The protocol buffer compiler will complain if any future users try to
> use these field identifiers.

This updates our proto files to use `reserved` instead of comments. It
also adds support to our wrapper script. (I moved a few things around in
that script, too, for consistency.)

I think this is a useful change on its own, but I think it'll make
things a little better when we deprecate some fields, which we're
planning to do soon.

[0]: https://developers.google.com/protocol-buffers/docs/proto3#reserved
2022-09-27 18:45:38 +00:00
Harry
da06c1357c
Show my story privacy settings the first time you send to my story
* Add first send story privacy field to AccountRecord proto

* Store hasSetMyStoriesPrivacyKey on StoryManager

* sync hasSetMyStoriesPrivacy state

* Reuse MyStorySettingsViewController in a sheet view controller

* Show my story privacy settings from conversation picker if unset when selecting my story destination

* reload my story row to change subtitle

* pr feedback
2022-09-27 10:06:01 -07:00
Sasha Weiss
ac97aeba92
Migrate to using ExpiredProfileKeyCredentials 2022-09-26 14:33:57 -07:00
Nora Trapp
5e277b6eb4 Reduce logging 2022-09-26 13:48:00 -07:00
Nora Trapp
323bbb5a4b Add some doc comments and make restart clearer 2022-09-26 13:48:00 -07:00
Nora Trapp
9d021f50fe Allow specifying a port for a proxy to connect to 2022-09-26 13:48:00 -07:00
Nora Trapp
fb31679cc7 Validate proxy address and that we can connect to it 2022-09-26 13:48:00 -07:00
Evan Hahn
7a357a9cd3 Harden isValidProxyLink against strange URLs 2022-09-26 13:48:00 -07:00
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
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
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