Commit Graph

28750 Commits

Author SHA1 Message Date
Jordan Rose
1fae99b7ff "Missed call while using Focus" / "while on Do Not Disturb"
If a ring is silenced because of Do Not Disturb, call that out
specifically.
2022-08-03 15:21:29 -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
Evan Hahn
70eca7b99b Use built-in date formatter when formatting lossless durations
Previously, `String#formatDurationLossless` rolled a custom formatter.
Now, it uses `DateComponentsFormatter`.

See also: the tests in `Signal/test/util/StringAdditionsTest.swift`,
which were untouched as part of this change.

I think this is a useful refactor anyway, but it should also fix rare
RTL bugs where duration components would be backwards. (I don't think
this ever happened under normal conditions, but it could happen if a
disappearing messages timer was set to something unusual like "1 day, 3
hours".)

I also plan to build off of this for an upcoming change, which is why
I did this now.
2022-08-03 14:51:39 -05:00
Evan Hahn
846e802784 Prefer String over NSString in Swift
This is a trivial change that should have no user impact.

`String.formatDurationLossless` calls `NSString.formatDurationLossless`,
so this is a no-op. I think it's slightly better to call a `String`
method from Swift than an `NSString` one.

I did this because it makes an upcoming change easier, but I think it's
useful on its own.
2022-08-03 12:54:12 -05:00
Sasha Weiss
ac05bfc690
Add the concept of a correlation ID to NSE logging 2022-08-03 10:33:15 -07:00
Nora Trapp
234c37ad15 "Bump build to 5.49.0.4." (nightly-08-03-2022) 2022-08-03 04:00:30 -07: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
Igor Solomennikov
9bb5df31d4
Camera view controller refactoring.
Refactoring around media sharing flow classes.

• extract camera controls classes into a separate .swift file.
• extract a few SendMediaNavDelegate methods into SendMediaNavDataSource.
• use block-based method for handling UIDevice.orientationDidChangeNotification.
• prepare PhotoCaptureViewController to add support for text story composer.• remove unnecessary `public` declarations.
• other minor stylistic changes.
2022-08-02 17:16:04 -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
Nora Trapp
6e2fcd00ac "Bump build to 5.49.0.3." (nightly-08-02-2022) 2022-08-02 04:00:39 -07:00
harry-signal
741c3961bd
Add audioPlaybackRate thread-level metadata to ThreadAssociatedData table 2022-08-01 15:34:40 -07:00
Evan Hahn
bd2b3c928e Move script out of SignalServiceKit
This change should have no direct user impact.

This is just a file move.

I think this is a useful change on its own, but it may be useful in
upcoming changes too (e.g., making SignalServiceKit not a pod).
2022-08-01 16:29:43 -05:00
Evan Hahn
e3fa7848e5 Upgrade libwebp to v1.2.3
This upgrades `libwebp` (a subdependency of `YYImage`) from v1.0.2 to its
latest version, v1.2.3.

As of this writing, the [libwebp pod does not have v1.2.3][0], so I
modified [the v1.2.1 podspec][1] and vendored it into the project. You
may wish to [compare the v1.2.1 podspec with my version][2]. In the long
term, I will try to get this change submitted upstream.

I tested this with a variety of stickers (usually sent as WebP), [WebP's
alpha test images][2], and [a test WebP image from the Desktop app][3].

[0]: 11f1b72927/Specs/1/9/2/libwebp
[1]: b04c376a0d/Specs/1/9/2/libwebp/1.2.1/libwebp.podspec.json
[2]: https://gist.github.com/EvanHahn-Signal/c87c301d2d7359df961bb85dd531a91c
[3]: https://developers.google.com/speed/webp/gallery2#webp_links
[4]: 412f07d2a2/fixtures/512x515-thumbs-up-lincoln.webp
2022-08-01 15:55:52 -05:00
Phil Larson
00466c7a18 Remove extra commas when running sds_codegen.sh 2022-08-01 15:47:24 -05:00
Nora Trapp
7a84d7605b Allow viewing your own sent stories 2022-08-01 12:44:31 -07:00
Nora Trapp
a4cd566b75 Add context menu and reloading to My Stories view 2022-08-01 12:44:31 -07:00
Evan Hahn
a45121f223 Update Pods 2022-08-01 12:01:48 -05:00
Evan Hahn
8e5009bbf7
Add simple test for TypingIndicatorMessage
This change should have no direct user impact.

This tests `TypingIndicatorMessage`'s `isOnline` getter.

I plan to add additional tests to this file in a future commit, but I
think this is a useful change on its own.
2022-08-01 11:44:16 -05:00
Evan Hahn
202ce3e6d3
Update to RingRTC v2.20.13
Co-authored-by: Jim Gustafson <jim@signal.org>
2022-08-01 08:45:27 -05:00
Max Radermacher
64fa5e5652 Add env var to connect to staging server 2022-08-01 08:09:47 -05:00
Nora Trapp
45a2d61089 "Bump build to 5.49.0.2." (nightly-07-30-2022) 2022-07-30 04:00:17 -07:00
Nora Trapp
7d1d133940 Dedupe when sending to multiple private story threads 2022-07-29 12:39:14 -07:00
Evan Hahn
088c3e5d85 Remove unused relay field from envelope proto 2022-07-29 11:35:55 -05:00
Max Radermacher
8d0f4c3535
Clean up old project settings
* Remove NEW_CV_ARCHITECTURE
* Remove unused search paths
2022-07-29 09:33:24 -07:00
Max Radermacher
f0f52ec0b0 Ignore packKey in isDefaultStickerPack
Sticker packs are uniquely identified by packId.
2022-07-29 08:37:55 -05:00
Nora Trapp
ae669976d5 "Bump build to 5.49.0.1." (nightly-07-29-2022) 2022-07-29 04:00:15 -07:00
Max Radermacher
03944b813d Remove tableViewStyle 2022-07-28 16:28:33 -07:00
Max Radermacher
6aee89fab1 Fix indentation in DefaultStickers 2022-07-28 13:29:03 -07:00
Evan Hahn
c988fdfee6 Convert OWSAnalyticsTests to Swift
This is a test-only change that shouldn't affect users.
2022-07-28 13:03:09 -05:00
Max Radermacher
2bec0dcc6f Fix Spanish App Store Connect language support
Use `es` for both `es-ES` and `es-MX`.
2022-07-28 09:43:50 -07:00
Evan Hahn
ecf53802fb "Bump build to 5.49.0.0." (nightly-07-28-2022) 2022-07-28 09:59:28 -05:00
Evan Hahn
bdf335720b Update translations 2022-07-28 08:17:20 -05:00
Max Radermacher
72d4736265 Remove iOS 11 disappearing contact workaround
We don’t support iOS 11, so this code is dead.
2022-07-28 08:05:50 -05:00
Nora Trapp
d9ff7bd6d9 "Bump build to 5.48.0.5." (nightly-07-28-2022) 2022-07-28 04:00:16 -07:00
Igor Solomennikov
cf003035a9
Animate transition from rounded image corners in Review to square in Draw tool. 2022-07-27 16:19:51 -07:00
Max Radermacher
a787b5596b Enable support for receiving gift badges 2022-07-27 15:32:10 -07:00
Max Radermacher
c6e0df5607
Fix initial height of table view sheets
When computing the height constraints, the table view wasn’t always
sized properly, which resulted in the wrong initial height.
2022-07-27 15:31:23 -07:00
Evan Hahn
9bcb16162f Update release notes 2022-07-27 17:09:32 -05:00
Evan Hahn
7480e5c015 Change default for "notify when contact joined Signal"
Also reorders imports, per the precommit script.
2022-07-27 16:58:06 -05:00
Max Radermacher
e709fa7629
Sort/rename some gift badge files
* Sort src/UserInterface/.../Donations in Xcode
* Rename to BadgeGiftingThanksSheet
2022-07-27 14:50:11 -07:00
Max Radermacher
14cd7bd051
Handle already-redeemed gift badges 2022-07-27 14:04:42 -07:00
Evan Hahn
864cc2cfb0 Debug logs: remove GitHub button 2022-07-27 15:29:20 -05:00
Evan Hahn
28f65b5b1c Debug logs: hide email button if you can't send emails
_I recommend reviewing this with whitespace changes disabled._

If your device can't send emails (e.g., because you uninstalled
Mail.app), we shouldn't show the "Email Support" option, as it will show
an error.
2022-07-27 15:25:32 -05:00
Max Radermacher
def8129ac8
Handle expired gift badges
- Show an error when trying to redeem them
- Show an error if your last remaining gift badge expires
2022-07-27 13:15:58 -07:00
Evan Hahn
bac5b0555b Revert "CI: make bigger check depend on lighter check"
This reverts commit 1e2422b6ba, because it
caused CI to be *entirely* skipped in some cases.
2022-07-27 15:04:23 -05:00
Evan Hahn
460f1d38c5 Log extended result code when db corruption happens
If we detect database corruption, we should log the [SQLite extended
result code][0], as it may offer insights.

This change also funnels the error handling through a single code path.

[0]: https://www.sqlite.org/rescode.html#extended_result_code_list
2022-07-27 13:44:11 -05:00
Evan Hahn
9d8e6b78ea Remove generic from flagDatabaseCorruptionIfNecessary
It is unnecessary, as far as I can tell.
2022-07-27 13:44:11 -05:00
Evan Hahn
5db672b039 Move checkSomeDiskSpaceAvailable to Swift
This change should have no user impact.
2022-07-27 12:17:00 -05:00