Commit Graph

98 Commits

Author SHA1 Message Date
Nora Trapp
09598d2e7a Add remote flag for stories 2022-08-31 13:34:24 -07:00
Evan Hahn
c77a8022ed Hide blocked contacts from recipient pickers
Because we don't show blocked contacts in the recipient picker, we can
also remove some code that checks for blocked contacts.
2022-08-30 22:36:59 +00:00
Nora Trapp
b420ad1f95 Cleanup AttachmentMultisend 2022-08-19 14:23:59 -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
Jordan Rose
0f694d318c Allow ToastController to present from the top as well 2022-08-17 17:59:19 -07: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
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
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
Max Radermacher
03944b813d Remove tableViewStyle 2022-07-28 16:28:33 -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
Igor Solomennikov
32fffd4308 Media Editor: fix an issue when Pen and Crop button might not be visible.
Repro steps:
* have an album of three media: the first two are static, the last one is a video.
* go to the video and tap into message text input to pop the keyboard.
* dismiss keyboard and swipe to the static image.

Expected:
Static image tools buttons to be visible.

Result:
Static image tools buttons not visible.

Issue is a very weird one and likely is caused by some obscure bug with UIKit / UIStackView.
2022-07-25 17:00:56 -07:00
Igor Solomennikov
77d1f2b5ab
Fix regression caused OWSTableSheetViewController not use all available height.
OWSTableViewSheetViewController is inherited from InteractiveSheetViewController
and has additional size calculation logic that updates current sheet size based
on UITableView's contentSize. However, there's also a "max height" constraint
that also needs updating  - this commits adds that.
2022-07-21 09:43:30 -07:00
Evan Hahn
c0c4a85d48 Fix InteractiveSheetViewController scrolling bug
Short story: we now properly decide whether the sheet is being resized
or scrolled, fixing the bug.

Long story:

Some users report that they can't scroll the forward message sheet
([example report 1][1], [example report 2][2]). This wasn't just a bug
with the forwarding sheet. It was a bug with all subclasses of
`InteractiveSheetViewController`.

When you gesture on the sheet, there are effectively two modes: "resize
the sheet mode", and "scroll the contents" mode. (See
`beginInteractiveTransitionIfNecessary` for a boolean that expresses
this.) The logic is effectively this:

    def getMode():
      if sheetHeight < maximumSheetHeight:
        # Note: there are some other ways to get this mode, e.g. by
        # grabbing the handle. But those aren't relevant for this bug.
        return "resize the sheet mode"
      else:
        return "scroll the contents mode"

Unfortunately, there was a bug in how we computed the max sheet height
if that height was larger than the height of the screen (e.g., in
landscape mode or on a shorter device). That bad height caused you to
get into "resize the sheet mode" incorrectly. This fixes that, and does
a few other cleanups.

[1]: https://github.com/signalapp/Signal-iOS/issues/5366
[2]: https://community.signalusers.org/t/beta-feedback-for-the-upcoming-ios-5-44-release/45401/3

Co-Authored-By: Igor Solomennikov <igor@signal.org>
2022-07-19 16:54:57 -05:00
Evan Hahn
486067130c Remove unused AttachmentCaptionViewController
It looks like this was removed in
7f4a5f3f7b.

`git grep -w AttachmentCaptionDelegate` and `git grep -w
AttachmentCaptionViewController` both return no results after removing
this file.
2022-07-15 17:15:53 -05:00
Nora Trapp
c2d9787cf7 PR Feedback 2022-07-15 15:05:03 -07:00
Nora Trapp
b67069e251 Add the editing of private stories 2022-07-15 15:05:03 -07:00
Nora Trapp
192c612bab Allow creation of private stories 2022-07-15 15:05:03 -07:00
Nora Trapp
d9c0a92ed4 Move dependencies needed for private story creation to SignalUI 2022-07-15 15:05:03 -07:00
Nora Trapp
b82cd6c654 Add ability to send to group stories 2022-07-15 15:05:03 -07:00
Nora Trapp
0dae510d07 Add '+ New Story' button to conversation picker 2022-07-15 15:05:03 -07:00
Igor Solomennikov
a71c59b9ad Fix issue making it impossible to activate popup menu in media editor's review screen.
Placeholder text view (the one that displays "Add Message") was stealing
focus and the fix is to disable user interaction for it.
2022-07-14 12:35:29 -07:00
Igor Solomennikov
cb4a9bb9e5 Minor UI fix for the review screen in media editor.
Long recipient name in the top right corner would not be faded at the
end upon initial presentation.
This was happening because subviews did not have their final frames at
the end of `layoutSubviews`.
The fix is to call method that updates fading on next run loop run.
2022-07-14 12:09:35 -07:00
igor-signal
a02c18c972
Animate UI changes in the bottom toolbar in media review screen.
Animate UI changes in the bottom toolbar in media review screen.
2022-07-13 12:12:48 -07:00
igor-signal
8b5ef88a88
Use "translucent dark" style for action sheets in media flow. (#4559) 2022-07-12 19:11:12 -07:00
igor-signal
0c02bf9f29
[Media Editor] Fixes for text field in review screen.
• improvement: correct amount of padding between text field and keyboard.
• fix: text field isn't tall enough when there's a message draft and
  keyboard isn't up.
• fix: onscreen keyboard briefly changes style to 'light' upon dismissal.
2022-07-12 16:13:06 -07:00
igor-signal
c64320e75b
Improve crop view presentation.
Keep image center intact when transitioning to/from crop view to
eliminate unpleasant "jump".
2022-07-12 12:03:55 -07:00
Igor Solomennikov
70f4ab3fab [Media Editor] Do not wrap image editing tool VCs in a nav controller.
Two VCs: photo editor and crop view don't need a UINavigationController
and are fine presented as is.

Also remove unused `completion` parameter.
2022-07-07 15:38:25 -07:00
igor-signal
bf2ce630d9
Fix layout of mention picker in media editor's Review screen. 2022-07-07 11:42:05 -07:00
Igor Solomennikov
7f4a5f3f7b Merge branch igor/media-editor-updates. 2022-07-06 14:54:26 -07:00
Evan Hahn
d0c7de494a Computed accessors shold always be in the same order
`get`, then `set`. This fixes violations of [SwiftLint's
`computed_accessors_order` rule][0].

A very mechanical change.

[0]: https://realm.github.io/SwiftLint/computed_accessors_order.html
2022-06-24 09:35:07 -07:00
Evan Hahn
576d854c6f Remove unnecessary break statements
This fixes all of our violations of [SwiftLint's
`unneeded_break_in_switch` rule][0].

[0]: https://realm.github.io/SwiftLint/unneeded_break_in_switch.html
2022-06-24 09:32:34 -07:00
Sasha Weiss (Signal)
2f4ded9d03
Fix reentrant DB read on mentions processing 2022-06-20 13:21:22 -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
Max Radermacher
66a2638edd Don’t attach canceled link previews 2022-06-09 15:10:50 -07:00
Evan Hahn
c2e7f0ca93 Prefer implicit getters
_I recommend reviewing this with whitespace changes disabled._

This fixes violations of [SwiftLint's `implicit_getter` rule][0] by
removing explicit getters when an implicit one would do.

[0]: https://realm.github.io/SwiftLint/implicit_getter.html
2022-06-06 14:00:15 +00:00
Igor Solomennikov
db0c4e7c73 Fix crash when opening media flow with message pre-populated.
Steps to reproduce:
• open group chat and type a message containing "@" but don't send it.
• tap on + and select last photo/video from the strip.
• observe app crashing.

Cause of crash:
Attempting to access a child view controller of UIPageViewController
while using force unwrap when UIPageViewController's view is not yet loaded.

The fix:
• Remove force unwrapping (linter was complaining about that too).
• Add "isViewLoaded" check to the method that was causing the crash.
2022-05-25 11:42:04 -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
Evan Hahn
df8592fa23 Fix SwiftLint switch_case_alignment violations
_I recommend reviewing this with whitespace changes disabled._

Bad:

```swift
switch foo {
    case .one: return 1
    case .two: return 2
}
```

Good:

```swift
switch foo {
case .one: return 1
case .two: return 2
}
```

See [the rule's documentation][0] for more.

[0]: https://realm.github.io/SwiftLint/switch_case_alignment.html
2022-05-03 12:15:05 -05:00
igor-signal
4a6473b448
Localize user-visible file sizes.
Use ByteCountFormatter with default settings to localize any download sizes that user might see.
2022-04-29 09:57:56 -05:00
Martin Böttcher
54b743de2d
moved older stringsdict changes into new branch; minor changes (#4205)
moved older stringsdict changes into new branch
2022-04-28 17:41:43 +02:00
Igor Solomennikov
dc19eb835f Fix "the the" in comments. 2022-04-27 20:16:45 -07:00
Igor Solomennikov
8fe9963f16 Address PR feedback. 2022-04-22 11:15:21 -07:00
Igor Solomennikov
9349af7fa5 Fix incorrect (old) media editor layout in landscape on non-plus size devices. 2022-04-22 11:15:21 -07:00
Michelle Linington
37fe097812 Lint 2022-04-13 20:23:22 -07:00
Michelle Linington
d54d654cfc PR Feedback: Remove notImplemented altogether 2022-04-13 20:21:47 -07:00
Michelle Linington
6b2f8d31d6 Lint 2022-04-13 20:21:46 -07:00
Michelle Linington
cca09295e6 Adopt notImplemented() where it's unadopted
notImplemented() ends up forwarding to fatalError() anyway, but before
it does so it flushes our logs. That's probably good to have. I think
most of these come from the default implementations Xcode provides for
you with a fix-it.
2022-04-13 20:21:46 -07:00
Evan Hahn
8b072620a6 Add "Donation Receipts" view 2022-04-11 16:21:12 -05:00