Accept audio attachments

pull/1718/head
Alex Baker 3 years ago
parent 8839be611d
commit f734d9ff75

@ -286,6 +286,7 @@
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain" />
<data android:mimeType="image/*" />
<data android:mimeType="audio/*" />
<data android:mimeType="application/*" />
</intent-filter>
<intent-filter>

@ -103,8 +103,10 @@ class ShareLinkActivity : InjectingAppCompatActivity() {
return result
}
private fun hasAttachments(intent: Intent): Boolean {
val type = intent.type
return type != null && (type.startsWith("image/") || type.startsWith("application/"))
private fun hasAttachments(intent: Intent) =
intent.type?.let { type -> ATTACHMENT_TYPES.any { type.startsWith(it) } } ?: false
companion object {
private val ATTACHMENT_TYPES = listOf("image/", "application/", "audio/")
}
}
Loading…
Cancel
Save