Commit Graph

28793 Commits

Author SHA1 Message Date
harry-signal
2d149b8525
allow playback of audio messages from the message detail view
* allow playback of audio messages from the message detail view

* Update UI when an audio message pauses because another one started playing

* pr feedback
2022-08-09 15:02:23 -07:00
Igor Solomennikov
17c3dba264
Allow to change font of text overlays in media editor.
Possible options match the ones used in text story viewer and currently are:
regular, bold, serif, script, condensed.
2022-08-09 14:21:18 -07:00
harry-signal
5c5de78a52
Add audio playback rate button UI
* Add audio playback rate button UI

* update animation values and remove feature flags since its now ready to go to prod

* address PR feedback

* PR nits
2022-08-09 14:03:59 -07:00
harry-signal
3a767cc31f
fix crash from using non designated initializer on UISegmentedControl 2022-08-09 13:02:05 -07:00
harry-signal
4561f0afb8
make threadassociateddata audioPlaybackRate column non-null 2022-08-09 09:55:38 -07:00
Nora Trapp
96de1622c3 "Bump build to 5.50.0.8." (nightly-08-09-2022) 2022-08-09 04:01:18 -07:00
Nora Trapp
eeab405752 "Bump build to 5.50.0.7." (Internal) 2022-08-08 16:07:47 -07:00
Nora Trapp
edc5c7beae Fix schema.sql for 2022-08-08 14:34:51 -07:00
Jordan Rose
e4bb6b6a5d Add a unit test to ensure the zkgroup server params are up to date 2022-08-08 12:08:01 -07:00
harry-signal
dce5402f9e
Fix VoiceOver when locking an audio message recording
While here, issue an accessibility layout notification as well, so that VoiceOver targets the send button once you lock the message.
2022-08-08 14:07:03 -05:00
george-signal
98acf9687a
Fix a crash in stories tableview. (#4692)
Commit 04737ff044
attempted to fix an assertion in
StoriesViewController due to UITableView
complaining about inconsistent state. The issue
continues to happen. This diff fixes it once and
for all (I hope!).

The scenario that caused a crash prior to
04737ff044 was:

  Initially:
  models = [a,b,c]

  Database changes to [a,b]

  reloadStories (loading queue)
      newModels = [a,b]
      schedule block to run on main queue

  Database changes to [x, b]

  updateStories (loading queue)
      captures self.models, value is [a,b,c] // cue ominous music
      load from database
      newModels = [x,b]
      schedule block to run on main queue; will delete c and change a to x

  reloadStories.block runs on main queue
      self.models=newModels, value is [a,b]
      tableView.reloadData()  // UITableView thinks c is deleted

  updateStories.block runs on main queue
      self.models=newModels, value is [x,b]
      tableView.beginUpdates()
      tableView.delete(index: 2)  // crashes because c was already deleted

Post-04737ff the following scenario causes a
crash:

  Initially:
  models = [a,b,c]

  Database changes to [a,b]

  updateStories (loading queue)
      load from database
      models.set([a,b])
      schedule block to run on main queue which will delete c

  iOS gets a wild hair and decides to call some
  UITableViewDataSource methods.

  tableView(_, numberOfRowsInSection:)
      return [a,b].count  // Now UIKit thinks c is gone

  updateStories.block runs on main queue
      tableView.beginUpdates()
      tableView.delete(index: 2)  // crashes because 2 is out of bounds vs number of rows

This commit fixes the problem by ensuring the
read-modify-write that happens in updateStories
never reads older data than what UITableView
has been told about and also that updates to the
model are properly synchronized with
beginUpdates()...endUpdates().

Here's how to think about it: the database goes
through a series of changes. Call them v1, v2,
..., vN.

The loading queue will see each in turn. For each,
it will enqueue a corresponding block on the main
queue to update `model` and tell UITableView about
it.

From the POV of the main queue, each update occurs
in the scope of a UITableView update.

From the POV of the loading queue, each update
reads from exactly the preceding version (from
`trueModels`) and writes to exactly the next
version of `trueModels`.

Therefore, there are no data races.
2022-08-08 10:34:39 -07:00
Evan Hahn
cfb88bfc8e "Bump build to 5.50.0.6." (nightly-08-08-2022) 2022-08-08 11:36:03 -05:00
Evan Hahn
e670730637 Update server params for LibSignalClient upgrade
We updated LibSignalClient in 9a5ffcb821.
We also needed to update these server public params.
2022-08-08 11:23:29 -05:00
Nora Trapp
26fea8a053 "Bump build to 5.50.0.5." (nightly-08-08-2022) 2022-08-08 04:00:47 -07:00
Nora Trapp
eddba94f51 Allow 4k video playback 2022-08-07 09:19:45 -07:00
Evan Hahn
266a4663e9 Add basic test for outgoing reaction message
This change should have no direct user impact.

`OWSOutgoingReactionMessage` was untested. This adds a basic test for
its `shouldBeSaved` method.

I think this is a useful change on its own, but may make future changes
easier, too.
2022-08-07 08:57:54 -05:00
Meher Kasam
22260f96c1 Improve VoiceOver support for the settings button
Co-Authored-By: Harry Sanabria <harry@signal.org>

See <https://github.com/signalapp/Signal-iOS/pull/5412>.
2022-08-07 08:23:15 -05:00
Nora Trapp
3d4eef5e04 "Bump build to 5.50.0.4." (nightly-08-07-2022) 2022-08-07 04:00:43 -07:00
Phil Larson
0c27a837bf
Fix path to SignalServiceKit-prefix.pch (#4717) 2022-08-06 13:41:58 -07:00
Nora Trapp
b44de0cc2c "Bump build to 5.50.0.3." (nightly-08-06-2022) 2022-08-06 04:01:00 -07:00
Nora Trapp
9a5ffcb821 Update to LibSignalClient 0.19.3 2022-08-05 15:01:21 -07:00
Evan Hahn
f5e098476f Update pods 2022-08-05 16:50:36 -05:00
Evan Hahn
6305cdc0e6
SignalServiceKit: no longer a separate pod
SignalServiceKit is currently a separate pod. This makes merges tedious
and error-prone. Ultimately, it slows us down. It might've made sense as
a standalone library before, but it's so tightly integrated now that it
isn't useful to have it be separate.

This changes that, and makes SignalServiceKit a "normal" target.

IMO, most of this change isn't that exciting—just a bunch of changes to
scaffolding. There's one slightly spicier change: our generated
`Acknowledgements.plist` is now a little more clever.

Co-authored-by: Max Radermacher <max@signal.org>
2022-08-05 16:14:15 -05:00
Igor Solomennikov
915f3bd4f9
Redo media quality picker sheet in media editor.
• provide visual feedback when user selects media quality.
• add VoiceOver support.
• fix retain cycle caused leak of ActionSheetController objects.
• correct bottom margin on non-notch devices.
2022-08-05 11:03:35 -07:00
Jordan Rose
07067fd03d Be more deliberate about starting/ending orientation notifications
- PhotoCapture's logic was correct, but hard to prove such.
- ScanQRCodeViewController left notifications on for the rest of the
  process lifetime.
- CallService was working around a WebRTC issue that appears to no
  longer be present (per inspection of the WebRTC code).
2022-08-05 08:11:38 -05:00
Igor Solomennikov
9f7850d4cd
Add camera + text controls to in-app camera 2022-08-05 08:07:44 -05:00
Evan Hahn
f8afc58b42 Prefer clang-format for sorting #import/#include
This should have no direct user impact.

We currently have two ways of sorting `#import` and `#include`
statements:

1. With our precommit script
2. With `clang-format` (via `git-clang-format`)

It *looks* like we aren't using `clang-format` (because of the
`SortIncludes: false` option in `.clang-format`) but we are,
which you can see by running `clang-format --dump-config`. As a separate
issue, it seems like we're not picking up the `clang-format`
configuration file (`clang-format --style=file:.clang-format
--dump-config` gives different results).

I've run into situations where the two of them "fight", so I think the
best thing to do is pick one. After some discussion, we decided to pick
`clang-format`.
2022-08-05 08:01:03 -05:00
Nora Trapp
0f232ce25b "Bump build to 5.50.0.2." (nightly-08-05-2022) 2022-08-05 04:00:39 -07:00
harry-signal
202c137ced
Propagate ThreadAssociatedData audioPlaybackRate down to CVComponentAudioAttachment
* Propagate ThreadAssociatedData audioPlaybackRate down to CVComponentAudioAttachment

* remove audioplaybackrate from component state; keep only on view state
2022-08-04 15:53:11 -07:00
harry-signal
f305b4a2aa
Allow changing playback rate on OWSAudioPlayer
* Allow changing playback rate on OWSAudioPlayer

* nits and remove audio playback rater getter

* add explicit thread and attachment ID types to CVAudioPlayback cache
2022-08-04 14:55:53 -07:00
Sasha Weiss
2cc4502fbf
Revert "Rotate call button icons when the phone is in landscape"
This reverts commit 54701df408.
2022-08-04 14:21:21 -07:00
Sasha Weiss
d1a455b1a2
Collapse join/cancel request events in the chat 2022-08-04 13:07:27 -07:00
Igor Solomennikov
26cfaf610c Fix last minute regression in ee2f39d3d1.
`setMode(animated:)` was calling `mode` setter which was calling `setMode(animated:)`
with `animated` being `false`.
2022-08-04 11:44:22 -07:00
Evan Hahn
adfda71472
Add remaining disappearing message time in detail view
This commit adds something new to the message detail view: the remaining
disappearing message time, if relevant.

For example, "Disappears: 6d 23h 58m 6s" (or something similar) will be
shown.

Builds off of 70eca7b99b and
846e802784.
2022-08-04 11:58:39 -05:00
Max Radermacher
df5437fb77
Remove "Linked Devices" item on linked devices
These aren't currently capable of modifying linked devices.
2022-08-04 08:39:59 -05:00
Nora Trapp
e844e0754a "Bump build to 5.50.0.1." (nightly-08-04-2022) 2022-08-04 04:00:45 -07:00
Igor Solomennikov
ee2f39d3d1
Fix an issue where buttons in text overlay toolbar could be too small.
The cause of this issue was that ImageEditorViewController's view was created
with zero dimensions. Those dimensions were then used to pre-calculate size
of the toolbar which ended up being incorrect.

The fix is to let UIKit create the root view and move everything we did in `loadView`
to `viewDidLoad`.
2022-08-03 17:59:53 -07:00
Igor Solomennikov
2a738fb459
Animate change in visibility of buttons at the top of in-app camera view.
When user starts video recording some buttons in the top part of the screen disappear and recording duration indicator appears. This commit adds simple fade-in/fade-out animation to those changes.
2022-08-03 16:50:56 -07:00
sashaweiss-signal
952df6ab44 "Bump build to 5.50.0.0." (nightly-08-03-2022) 2022-08-03 16:15:19 -07:00
sashaweiss-signal
e256819676 Update translations again 2022-08-03 16:09:51 -07:00
sashaweiss-signal
08705c318b Update translations 2022-08-03 15:52:53 -07:00
sashaweiss-signal
74139e672f Update release notes 2022-08-03 15:52:53 -07:00
Jordan Rose
54701df408 Rotate call button icons when the phone is in landscape 2022-08-03 15:22:32 -07:00
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