From 360db07ef2864ad7c045c53fdb2c508926fb5ae1 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Wed, 14 Dec 2022 09:47:17 -0500 Subject: [PATCH] Fix URLs getting pasted as broken attachments Closes #309 --- Tusker/Screens/Compose/MainComposeTextView.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Compose/MainComposeTextView.swift b/Tusker/Screens/Compose/MainComposeTextView.swift index 830b3f71..5a162ef3 100644 --- a/Tusker/Screens/Compose/MainComposeTextView.swift +++ b/Tusker/Screens/Compose/MainComposeTextView.swift @@ -165,7 +165,9 @@ struct MainComposeWrappedTextView: UIViewRepresentable { } override func paste(_ sender: Any?) { - if UIPasteboard.general.contains(pasteboardTypes: CompositionAttachment.readableTypeIdentifiersForItemProvider) { + // we deliberately exclude the other CompositionAttachment readable type identifiers, because that's too overzealous with the conversion + // and things like URLs end up pasting as attachments + if UIPasteboard.general.contains(pasteboardTypes: UIImage.readableTypeIdentifiersForItemProvider) { uiState.delegate?.paste(itemProviders: UIPasteboard.general.itemProviders) } else { super.paste(sender)