Commit Graph

4527 Commits

Author SHA1 Message Date
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
Harry
e2b5570646
Compensate for extra status bar height on iPhone 14 pro devices
* Compensate for extra status bar height on iPhone 14 pro devices

* use string sysctlKey

* more commenting
2022-09-19 15:46:17 -07:00
Harry
299c76fedd
fix iPhone 14/Xcode14 issues 2022-09-19 08:17:28 -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
01e06e50a6 Don't record send message intents for stories 2022-09-16 11:28:34 -07:00
Nora Trapp
9776699137 Sync when contacts become unregistered 2022-09-15 14:09:03 -07:00
Sasha Weiss
fb1a4979d4
Remove guard around bannedAtTimestamp 2022-09-14 13:36:19 -07:00
Sasha Weiss
f19eb02565
Improve read sync logging 2022-09-14 09:59:25 -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
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
Nora Trapp
6b21e2c887 Add 'Views off' state to stories 2022-09-12 10:42:09 -07:00
Nora Trapp
9bd91f66b6 Allow turning off stories 2022-09-12 10:14:09 -07:00
Nora Trapp
de0ef9444b Fix some usage of NSLocalizedString 2022-09-11 10:36:23 -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
Nora Trapp
73316f2420 Notify for replies to group stories 2022-09-08 17:12:24 -07:00
Sasha Weiss
3790c9bfa1
Refactor VersionedProfilesImpl to centralize credential storage 2022-09-08 09:21:02 -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
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
Sasha Weiss
4d099bc53f
Show 3 digits of UUIDs in logs 2022-09-01 17:48:59 -07:00
Sasha Weiss
da19c8584b
Add logs to UserNotificationsAdaptee 2022-09-01 17:06:42 -07:00
Sasha Weiss
af6ff96975
Make notificationCenter a static var in UserNotificationsAdaptee 2022-09-01 15:12:43 -07:00
Jordan Rose
e2376bac02 Prepare call notifications for group call rings
This mainly means passing around SignalCalls instead of
IndividualCalls, but while here it makes sense to be more explicit
about who the caller is.
2022-08-31 17:51:12 -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
Max Radermacher
74c0bd93a7 Properly specify isComplete on contact syncs 2022-08-26 14:42:57 -07:00
Max Radermacher
fdc8633ab0 Remove ConversationConfigurationSyncOperation
It’s unused (except in debug code) since 8c0196077f.
2022-08-26 14:42:57 -07:00
Sasha Weiss
569cdb2aad
Durable jobs for leaving groups 2022-08-26 13:13:23 -07:00
Harry
8ab9505d75
Ignore failures to clean up dotfiles in logs directory on simulators 2022-08-25 16:24:19 -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
Jordan Rose
11cf13a255 Avoid intermediate copies when using dictionary keys as collections
The non-lazy map and filter always make a new array or dictionary,
which is often consumed immediately into a Set. Using `lazy` avoids
that intermediate allocation, as well as the need to loop over the
array or dictionary a second time.

This is a micro-optimization, but several of these accessors are
accessed fairly frequently, so we might as well make them faster.
2022-08-23 10:42:11 -07:00
Evan Hahn
48c3c08c10 Fix vertical_parameter_alignment SwiftLint violations
This fixes violations of [SwiftLint's `vertical_parameter_alignment`
rule][0]. This should have no user impact.

[0]: https://realm.github.io/SwiftLint/vertical_parameter_alignment.html
2022-08-18 10:37:09 -05: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
harry-signal
c935307563
Add logging for notification sound debugging
* add logging for notification sound debugging

* use NSString path appending
2022-08-15 14:07:20 -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
Jordan Rose
094c8290ce Remove unnecessary NotificationCenter.removeObserver calls
As of iOS 9, selector-based observers in NotificationCenter do not
need to be explicitly unregistered.
2022-08-02 17:43:52 -07:00
Jordan Rose
4f06a6d8a5 Fix incorrect uses of NotificationCenter block-based API
The block-based API returns a token that needs to be explicitly
unregistered, *and* the block should not capture 'self' strongly.
The fixes in this PR come in three flavors:

1. Switch to the selector-based API, sometimes taking advantage of
   the fact that extra arguments to an Objective-C method can be
   safely discarded (because they are passed at +0).

2. Save the observer token and unregister in deinit.

3. Comment why it's safe to leave the observer registered forever
   in this particular case.
2022-08-02 17:43:52 -07:00
Evan Hahn
cef1d330cd Improve logging for donations
This adds logging in various places to (hopefully) make it easier for us
to diagnose future problems.
2022-08-02 18:19:40 -05:00
Sasha Weiss
698180fbb3
Index name components if available 2022-08-02 11:52:20 -07:00