This commit is contained in:
Mariotaku Lee 2017-08-13 16:19:55 +08:00
parent 6da2717a3b
commit 8efe2b9472
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 7 additions and 1 deletions

View File

@ -119,7 +119,7 @@ class RetweetQuoteDialogFragment : AbsStatusDialogFragment() {
}
getButton(DialogInterface.BUTTON_POSITIVE).setOnClickListener {
if (status.is_my_retweet) {
if (!shouldQuoteRetweet(account) && status.is_my_retweet) {
twitterWrapper.cancelRetweetAsync(account.key, status.id, status.my_retweet_id)
dismiss()
} else if (retweetOrQuote(account, status, showProtectedConfirm)) {
@ -187,6 +187,12 @@ class RetweetQuoteDialogFragment : AbsStatusDialogFragment() {
textCountView.textCount = validator.getTweetLength(s.toString())
}
private fun DialogInterface.shouldQuoteRetweet(account: AccountDetails): Boolean {
if (this !is AlertDialog) return false
if (!canQuoteRetweet(account)) return false
return !editComment.empty
}
@CheckResult
private fun retweetOrQuote(account: AccountDetails, status: ParcelableStatus,
showProtectedConfirmation: Boolean): Boolean {