Commit Graph

200 Commits

Author SHA1 Message Date
Nora Trapp
1845834dc9 Show error when you try and share too many photos 2021-04-13 08:50:57 -07:00
Nora Trapp
4e535fa7ef Make database recovery async 2021-04-01 12:50:41 -07:00
Nora Trapp
c40a786050 Fix extensions in post YDB world 2021-03-27 12:13:20 -07:00
Matthew Chen
86b8eb08b8 Remove YapDatabase.
Apply asset from design.

Fix rebase breakage.
2021-03-25 11:41:16 -03:00
Matthew Chen
b4aa2aa1c3 Clean up app readiness. 2021-03-25 09:36:16 -03:00
Matthew Chen
d0cbf8cfd0 Rework dependency access. 2021-03-25 09:24:27 -03:00
Nora Trapp
3669066e42 Begone OWSBatchMessageProcessor 2021-02-23 10:45:50 -08:00
Nora Trapp
91d2953843 Begone OWSMessageReceiver 2021-02-23 10:45:50 -08:00
Matthew Chen
645bd76bd5 Rework app readiness. 2021-02-04 09:55:39 -03:00
Matthew Chen
23dc0f021c Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00
Matthew Chen
0931081de1 Avoid OOM crashes in SAE. 2021-01-22 23:22:43 -03:00
Matthew Chen
fdaff8918e Disable system contact fetches in SAE. 2021-01-22 23:22:43 -03:00
Nora Trapp
7230dabbc8 Add support for sharing suggestions 2021-01-21 20:00:29 -08:00
Nora Trapp
c073d8e204 Speed up presentation of conversation picker, eliminate 'loading' state 2021-01-21 20:00:29 -08:00
Jordan Rose
c799f663c8 Always re-encode video attachments
This is more consistent, results in smaller videos, and makes sure
we're stripping metadata.
2021-01-12 16:43:01 -08:00
Nora Trapp
08baf57151 Allow sharing to multiple threads 2021-01-12 15:33:54 -08:00
Nora Trapp
81b3b5552b Fix sharing of heic images taken on iPhone 12 Pro 2020-11-06 20:04:34 -03:00
Fumiaki Yoshimatsu
3afd472829 Accepts PDF data from Sarari to share to Signal. Fixes #4377 2020-09-23 14:54:23 -07:00
Matthew Chen
239fbbc8ba DRY singleton accessors. 2020-09-17 21:13:14 -03:00
Matthew Chen
ad6bda8a44 Rename singleton accessors. 2020-09-17 21:11:07 -03:00
Matthew Chen
137114ac2d Fix races in share extension completion. 2020-08-13 12:40:33 -03:00
Matthew Chen
02e812deef Tweak readiness checking. 2020-07-08 15:02:14 -03:00
Matthew Chen
c3a9daf224 Recover off main thread. 2020-06-07 11:45:07 -03:00
Matthew Chen
6b4f192b1b Remove usage of retainUntilComplete. 2020-05-22 09:51:12 -03:00
Matthew Chen
16bf7288f5 Tweak SAE's 'dismiss in background' behavior. 2020-04-08 10:08:42 -03:00
Michael Kirk
f198d9037d Merge tag '3.5.0.5' 2020-02-19 19:26:05 -07:00
Michael Kirk
2560b05f32 suppress some actions until onboarded 2020-02-18 18:39:15 -07:00
Nora Trapp
e43140a5c2 Fix sharing of URLs. 2020-01-30 20:13:17 -08:00
Nora Trapp
88ac10de05 Notification Service Extension
The NSE should only run on iOS 13.3 or later where the "filtering" entitlement
is available since our notifications don't contain any content and will often
not trigger any user visible content. We control this by setting the deployment
target to iOS 13.3.

This does not handle calls as it's currently impossible to wake the main app or
launch CallKit from within the NSE. Should we reach a point where we need to use
this extension in production the service will need to be able to differentiate
between call and non-call messages and deliver them as VOIP or Vanilla pushes as
appropriate. Alternatively, Apple may introduce some way for us to signal the
main app that a call message has been received.

This does not currently address the potential for the NSE and the main app to be
running and trying to process messages at the same time. As long as the
websocket is connected and the main app is processing messages in a timely
fashion the NSE will never be called since the service will not send pushes for
these messages, but censorship circumvention users and users where the websocket
is disconnected for some reason will legitimately receive pushes and we will
want to process those messages. How we will handle these cases requires further
thought since just terminating the NSE when the app launches is not sufficient.
We could potentially do something like terminate the NSE everytime the main app
runs the message fetcher job which should only happen if either the user
pulls-to-refresh on the conversation list or the websocket is actively connected
and receiving messsages. I plan to address this in a follow-up pull request.

Currently this code will not ever be run since the service never sends vanilla
push notifications. Eventually we will need to add logic into the main app to:
a) detect we're on iOS 13.3 or later and b) update a flag on the service telling
it to stop using VOIP pushes for non-call messages. The API for requesting this
from the service does not yet exist.
2020-01-30 11:44:41 -08:00
Matthew Chen
2734f01dcd Merge tag '3.3.0.5' 2020-01-27 12:00:09 -03:00
Nora Trapp
f522313198 Fix sharing of URLs. 2020-01-25 14:13:19 -08:00
Matthew Chen
26ecb2b371 Rewrite queue to process incoming group v2 messages. 2020-01-23 12:00:42 -03:00
Michael Kirk
f8aabeea76 FIX: can't share from screenshot app
fall back to UIImage provider if URL provider is not available
2020-01-22 07:55:15 -07:00
Michael Kirk
cce628a069 fixup! Merge branch 'mkirk/pdf-share' 2020-01-14 09:24:06 -07:00
Michael Kirk
1ac44de0d5 FIX: some PDF's fail to share
Some PDF shares (and presumably other files) were not shareable due to a failure to convert.

The root of this is that the behavior of
NSItemProvider.loadItemForTypeIdentifier(_:,options:,completionHandler:)
depends on the signature of the completion handler.

The documented signature of the completion handler is: (NSSecureCoding, NSError) -> Void

For example, if you want an NSURL back, it's expected that you'll pass in a
`(NSUrl, NSError)` block, or if you want a Data you'll pass in a `(NSData, NSError)`.

However, that's not possible with Swift strict typing. The type of the block must match.

```
loadItmForTypeIdentifier('myType', nilOptions) { loadedItem, error in

}
```

The type of `loadedItem` is SecureCoding. What we were seeing is that we were
getting returned to us unexpected classes, e.g. private iOS internal classes
like "_NSSandboxedDocument", which indeed do conform to NSSecureCoding.

Instead, we should cut with the grain of the existing API design and request
the exact type of object we want. We do this is ObjC, since this isn't possible in swift,
and provide some bespoke Swift wrappers.

Doing this requires tracking some information about the itemprovider, and
funneling that through the extensionItem -> SignalAttachment process.
2020-01-14 09:21:04 -07:00
Michael Kirk
901bb83a39 FIX: all file attachments labeled Contact.vcf 2020-01-14 09:21:04 -07:00
Matthew Chen
663e015d77 Tweak order of share extensions launch checks. 2020-01-02 12:12:18 -08:00
Matthew Chen
b47a94d381 Handle error cases in share extension including GRDB migration. 2020-01-02 12:12:18 -08:00
Matthew Chen
748f3ec3b0 Merge remote-tracking branch 'private/release/3.0.0' 2019-11-18 21:12:54 -03:00
Michael Kirk
f8b411b15e Fix crash when canceling SAE
Seeing on iOS13 at least, an error while trying to bridge error types:

0   libswiftFoundation.dylib        0x00000001b6714580 $sSo10CFErrorRefas5Error10FoundationsACP7_domainSSvgTW + 44 (NSError.swift:343)
1   libswiftCore.dylib              0x000000018e43f77c $ss23_getErrorDomainNSStringyyXlSPyxGs0B0RzlF + 44 (ErrorType.swift:140)
2   libswiftCore.dylib              0x000000018e6bfab8 _swift_stdlib_bridgeErrorToNSError + 216 (ErrorObject.mm:434)
3   SignalShareExtension            0x0000000102f4f348 closure #1 in ShareViewController.shareViewWasCancelled() + 748 (ShareViewController.swift:512)
4   SignalShareExtension            0x0000000102f498ec thunk for @escaping @callee_guaranteed () -> () + 28 (<compiler-generated>:0)
5   UIKitCore                       0x0000000184889f04 __99-[UIViewController _dismissViewControllerWithAnimationController:interactionController:comple... + 32 (UIViewController.m:8103)

Passing back a swift error avoids this. Presumably setting a domain on the NSError would also work.
2019-11-18 14:30:19 -07:00
Matthew Chen
e46eefe50e Remove readReturningResult(). 2019-11-14 10:39:33 -03:00
Michael Kirk
0fca274e62 Sync Groups and Contacts 2019-11-04 14:06:54 -08:00
Nora Trapp
65d54e7282 UIAlertController -> ActionSheetController 2019-10-28 14:43:59 -07:00
Matthew Chen
e343a7da6d Add LaunchJobs. 2019-09-27 16:10:48 -03:00
Matthew Chen
b09da45672 Rework isStorageReady. 2019-09-23 13:04:39 -03:00
Matthew Chen
8e4cd299be Merge tag '2.43.0.17' 2019-09-23 12:19:18 -03:00
Nora Trapp
7c4f12d43e Include the OS build number in debug logs. 2019-09-20 12:17:56 -07:00
Nora Trapp
c697630ab2 Fix share sheet for iOS 13 2019-09-16 10:26:00 -07:00
Matthew Chen
85756b0fe9 Merge remote-tracking branch 'private/release/2.42.0' 2019-08-16 13:21:38 -03:00
Matthew Chen
eb5db2fd79 Respond to CR. 2019-08-15 17:24:15 -03:00