don't create a CW when sharing text to Tusky (#1836)
This commit is contained in:
parent
74bd493878
commit
836b7f3f76
1 changed files with 14 additions and 17 deletions
|
@ -203,19 +203,17 @@ class ComposeActivity : BaseActivity(),
|
||||||
for (uri in uriList) {
|
for (uri in uriList) {
|
||||||
pickMedia(uri)
|
pickMedia(uri)
|
||||||
}
|
}
|
||||||
} else if (type == "text/plain") {
|
} else if (type == "text/plain" && intent.action == Intent.ACTION_SEND) {
|
||||||
val action = intent.action
|
|
||||||
if (action != null && action == Intent.ACTION_SEND) {
|
|
||||||
val subject = intent.getStringExtra(Intent.EXTRA_SUBJECT)
|
|
||||||
val text = intent.getStringExtra(Intent.EXTRA_TEXT)
|
|
||||||
val shareBody = text ?: subject
|
|
||||||
|
|
||||||
if (shareBody != null) {
|
val subject = intent.getStringExtra(Intent.EXTRA_SUBJECT)
|
||||||
if (!subject.isNullOrBlank() && subject !in shareBody) {
|
val text = intent.getStringExtra(Intent.EXTRA_TEXT).orEmpty()
|
||||||
composeContentWarningField.setText(subject)
|
val shareBody = if (!subject.isNullOrBlank() && subject !in text) {
|
||||||
viewModel.showContentWarning.value = true
|
subject + '\n' + text
|
||||||
|
} else {
|
||||||
|
text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shareBody.isNotBlank()) {
|
||||||
val start = composeEditField.selectionStart.coerceAtLeast(0)
|
val start = composeEditField.selectionStart.coerceAtLeast(0)
|
||||||
val end = composeEditField.selectionEnd.coerceAtLeast(0)
|
val end = composeEditField.selectionEnd.coerceAtLeast(0)
|
||||||
val left = min(start, end)
|
val left = min(start, end)
|
||||||
|
@ -226,7 +224,6 @@ class ComposeActivity : BaseActivity(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun setupReplyViews(replyingStatusAuthor: String?) {
|
private fun setupReplyViews(replyingStatusAuthor: String?) {
|
||||||
if (replyingStatusAuthor != null) {
|
if (replyingStatusAuthor != null) {
|
||||||
|
|
Loading…
Reference in a new issue