mirror of
https://github.com/accelforce/Yuito
synced 2025-02-15 19:10:44 +01:00
Revert "When a plaintext share contains EXTRA_TEXT and a distinct EXTRA_SUBJECT, use EXTRA_SUBJECT as the content warning for the shared status"
This reverts commit dd8abad8cac3726406045fcfe0e0bd073cc2941f.
This commit is contained in:
parent
095e7b96fe
commit
87707be3df
@ -253,14 +253,15 @@ class ComposeActivity : BaseActivity(),
|
||||
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
|
||||
val shareBody = if (subject != null && text != null) {
|
||||
if (subject != text && !text.contains(subject)) {
|
||||
String.format("%s\n%s", subject, text)
|
||||
} else {
|
||||
text
|
||||
}
|
||||
} else text ?: subject
|
||||
|
||||
if (shareBody != null) {
|
||||
if (!subject.isNullOrBlank() && subject !in shareBody) {
|
||||
composeContentWarningField.setText(subject)
|
||||
viewModel.showContentWarning.value = true
|
||||
}
|
||||
|
||||
val start = composeEditField.selectionStart.coerceAtLeast(0)
|
||||
val end = composeEditField.selectionEnd.coerceAtLeast(0)
|
||||
val left = min(start, end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user