Commit Graph

385 Commits

Author SHA1 Message Date
Nora Trapp
b962b752cb Don't auto-migrate groups on app launch 2022-09-29 09:35:00 -07:00
Nora Trapp
6930ffe2fa Remove old group capabilities 2022-09-29 09:35:00 -07:00
Sasha Weiss
ac97aeba92
Migrate to using ExpiredProfileKeyCredentials 2022-09-26 14:33:57 -07:00
Sasha Weiss
bb03be620e
Use "modern" proto fields instead of presentation for incoming group changes 2022-09-20 10:44:42 -07:00
Sasha Weiss
fb1a4979d4
Remove guard around bannedAtTimestamp 2022-09-14 13:36:19 -07: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
Sasha Weiss
640cb03a79
Do not retry for GroupsV2Error.conflictingChange 2022-09-13 11:31:03 -07:00
Nora Trapp
ad34089ffe Sync group stories with storage service 2022-09-12 12:00:14 -07:00
Sasha Weiss
74852a3ebd
Merge almost-identical profile key fetch methods 2022-09-09 16:21:09 -07:00
Sasha Weiss
f80ed7964a
Only recover from errors in performServiceRequestAttempt 2022-09-09 09:47:57 -07:00
Sasha Weiss
f37a0040ad
Replace AuthCredential with AuthCredentialWithPni 2022-09-07 15:39:50 -07:00
Sasha Weiss
4085771309
Centralize force-casts in a VersionedProfilesSwift dependency 2022-09-07 12:43:09 -07:00
Sasha Weiss
569cdb2aad
Durable jobs for leaving groups 2022-08-26 13:13:23 -07:00
Sasha Weiss
11e2729c49
Auto-leave groups when added by a blocked contact 2022-08-25 16:20:15 -07:00
Sasha Weiss
24d3d0e68d
Remove requiredRevision arg from updateExistingGroupOnService, and make it private 2022-08-25 12:41:55 -07:00
Sasha Weiss
56b9b2c139
Wait for group updates before doing profile key updates 2022-08-25 11:54:01 -07:00
Harry
33e26b6c4c
Migrate OWSSignalService from objc to swift, and split it into a protocol and implementation
* Split OWSSignalService into a swift protocol and implementation, migrated from objc

* Put OWSSignalService under SSKEnvironment and use mock in mock environment

* Rename from basename + impl to protocol + basename

* extend mock functionality a bit

* pr feedback
2022-08-24 14:36:52 -07:00
Harry
2950667ac9
Split OWSURLSession into a protocol and implementation
* Split OWSURLSession into a protocol and implementation

* Add OWSURLSessionMock

* Rename from basename + impl to protocol + basename

* add simple init for mock session

* nits from pr comments

* pr comments 2
2022-08-24 13:33:27 -07:00
Sasha Weiss
7146a02821
Serialize group updates using OWSOperation 2022-08-17 13:18:31 -07:00
Sasha Weiss
c5f21a2e53
Allow a bannedAtTimestamp of 0 for incoming banned members 2022-08-17 12:52:48 -07:00
Sasha Weiss
9ff8c07e7e
Only auto-refresh groups that we know we are members of 2022-08-16 12:58:57 -07:00
Sasha Weiss
43943ca621
Organize GroupV2UpdatesImpl.swift 2022-08-10 16:50:23 -07:00
Sasha Weiss
7cf14333ad
Prevent empty group updates from clobbering that a member joined via invite link
Group snapshots fetched from the service do not store the
`didJoinFromInviteLink` field on their members, and when we parse a
snapshot into a group model we hardcode this value to `false` for all
members. However, we store that field locally on a `GroupMembership`'s
`MemberStateMap` when processing an "add members" change action, as the
field is provided in the `AddMember` change action proto.

This becomes an issue, since when we refresh the group's state from the
service (which we do periodically, e.g. when opening a group for the
first time after launch) the `GroupMembership` from the group's snapshot
on the service will not match the `GroupMembership` we have locally,
even though they are from the same revision, due to mismatched
`didJoinFromInviteLink` values (hardcoded in the snapshot).
Consequently, we believed we were "updating the group model in a user-
facing way", but the only change therein was clobbering a
`didJoinFromInviteLink: true` to `...: false`, which was 1) wrong and
2) did not have a description to show.

This commit changes `GroupMembership` to ignore values for
`didJoinFromInviteLink` when comparing equality. This means that when we
parse a snapshot into a `TSGroupModel` with all those values hardcoded
to false, but otherwise identical to our local, we will no longer see it
as different from our local (and subsequently clobber our local and
generate an empty update).
2022-08-03 15:04:31 -05:00
Sasha Weiss
5c69126ce0
Allow outgoing changes with only ban actions 2022-07-18 15:03:33 -07:00
Sasha Weiss (Signal)
9f6f4f1b5c
Remove correct request-denied-because-banned error from behind a feature flag 2022-07-18 11:18:35 -07:00
Sasha Weiss (Signal)
42e9608c73
Remove user from local group on request-to-join denied 2022-07-18 11:17:58 -07:00
Sasha Weiss (Signal)
9334ed3077
Ban and unban users as part of add/remove/deny group actions 2022-07-15 09:41:19 -07:00
Sasha Weiss (Signal)
98151dfd0d
Don't need transactions to build group models 2022-07-12 10:23:12 -07:00
Sasha Weiss (Signal)
ac341fdbbc
DRY out V2 group updates 2022-07-08 15:47:45 -07:00
Sasha Weiss (Signal)
86d9b8ea0a
Remove args always passed as nil that were later unused anyway 2022-06-29 09:19:02 -07:00
Nora Trapp
7bd167f815
Initial story sending support
* Little fix for context menu

* Add 'My Stories' section to stories tab

* Add new story thread types

* Show stories in conversation picker

* Support for sending stories

* Update story list when sending stories

* Add basic 'My Stories' view controller

* Initial stories settings screens

* Consolidate TSPrivateStoryThread and TSMyStoryThread into one class

* Require an explicit read transaction to initialize an outgoing message

* Fix linting

* Allow enabling group story from internal settings

* Fix tests

* PR Feedback
2022-06-10 22:28:03 -04:00
Evan Hahn
5dbc030359 Fix violations of SwiftLint's closure_parameter_position rule
This commit should just change whitespace.

See [the docs for this rule][0].

[0]: https://realm.github.io/SwiftLint/closure_parameter_position.html
2022-06-06 13:58:23 +00:00
Evan Hahn
24ca5abf9c Remove unneeded breaks
This fixes our violations of [the SwiftLint `unneeded_break_in_switch`
rule][0].

[0]: https://realm.github.io/SwiftLint/unneeded_break_in_switch.html
2022-06-03 17:52:28 +00:00
Max Radermacher
2589f1e217
Remove GV2 rollout properties
* Remove manual groups v2 migration banner
* Remove “No UUID” subtitle when creating group
* Remove `areMigrationsBlocking`
* Remove `canManuallyMigrate`
* Remove `areManualMigrationsAggressive`
* Remove `canAutoMigrate`
* Remove `areAutoMigrationsAggressive`
2022-05-20 11:07:15 -07:00
Jordan Rose
4c8d7662a6 Add OWSIdentityManager.shouldSharePhoneNumber(with:transaction:)
When someone sends a message to your PNI, your responses (from your
ACI) must include a PNI signature, and the sealed sender certificate
you use during this period should include your phone number. This
confirms to the other user that your ACI is associated with your PNI.

This commit adds the state tracking that and ensures that both
TSOutgoingMessage and OWSUDManager check that state when building 1:1
messages and choosing certificates, respectively. Later commits will
set and clear this flag as needed.
2022-05-19 14:20:53 -07:00
Evan Hahn
29c0ddf60e Fix violations of SwiftLint's attributes rule
_I recommend reviewing this with whitespace changes disabled._

Most of these were `@objc` being on the same line, which I fixed with [a
silly script][1]—probably could've used `sed` if I were wiser. The rest
were manual fixes.

See [the SwiftLint documentation for this rule][0].

[0]: https://realm.github.io/SwiftLint/attributes.html
[1]: https://gist.github.com/EvanHahn-Signal/d353c93fa269c82b96baca0a1086521f
2022-05-14 09:07:42 -05:00
Max Radermacher
d4adfaff91
Fix protocol conformance warnings
There are some Swift-only features that are part of these protocols, so
they were split into Obj-C and Swift variants. However, the class itself
only reports conformance to the Swift variant, which leads to warnings
when using the class in Objective-C.
2022-05-09 11:44:05 -05:00
Michelle Linington
30cb1d5609 PR Feedback: Fix incorrect error case 2022-04-29 14:47:48 -07:00
Michelle Linington
b5c17b6c1c Improved handling of group bans 2022-04-29 14:47:48 -07:00
Igor Solomennikov
dc19eb835f Fix "the the" in comments. 2022-04-27 20:16:45 -07:00
Jordan Rose
bc222fdc86 Check all groups for an up-to-date profile key (at most once per week)
This is an expensive check, since it fetches the latest state of every
group we're in, but the cost of an out-of-date profile key is high.
2022-04-21 11:37:38 -07:00
Michelle Linington
84be44880e PR Feedback 2022-04-08 19:36:27 -07:00
Michelle Linington
988e6b8e14 Require transactions for the remainder of BlockingManager's interface 2022-04-08 19:01:43 -07:00
Nora Trapp
05313c3725 Update to LibSignalClient v0.15.0 2022-03-24 11:55:45 -07:00
Evan Hahn
de105468a4 Assume everyone is GV2-capable 2022-03-22 17:11:57 -05:00
Dimitris Apostolou
62724cf0be Fix typos 2022-03-18 11:31:06 -07:00
Michelle Linington
bd8e6ffedb Fixes an issue where group join requests aren't cancelled
Requesters are able to request to join a group by using data in the URL.
In order to cancel their request they need to use that data again. This
data wasn't being plumbed through.
2022-03-10 13:44:04 -08:00
Michelle Linington
b5264502b8 Present alert, avoid repeated fetching of expired links 2022-03-09 22:00:18 -08:00
Michelle Linington
c28e8b09b0 First pass at Group Link rejection
Several TODOs remain pending final server API and design
2022-03-09 22:00:18 -08:00
Jordan Rose
3742e5c329 Group updates: use an autoreleasepool for each group change processed
Helps avoid sawtooth-shaped memory usage when there are a lot of
changes to process, especially in a large group.
2022-02-10 10:35:29 -08:00