Prevent incompatible items from being pasted on compose screen

This commit is contained in:
Shadowfacts 2020-03-16 17:31:43 -04:00
parent e76b719c6a
commit bebf47f05c
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 4 additions and 0 deletions

View File

@ -108,6 +108,10 @@ class ComposeAttachmentsViewController: UITableViewController {
} }
override func canPaste(_ itemProviders: [NSItemProvider]) -> Bool { override func canPaste(_ itemProviders: [NSItemProvider]) -> Bool {
guard itemProviders.allSatisfy({ $0.canLoadObject(ofClass: CompositionAttachment.self) }) else {
return false
}
switch mastodonController.instance.instanceType { switch mastodonController.instance.instanceType {
case .pleroma: case .pleroma:
return true return true