enabled retweet protected user for fanfou

disabled retweet button when no comment text
This commit is contained in:
Mariotaku Lee 2017-05-17 17:09:00 +08:00
parent 5434e21cdb
commit 40309753bd
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package org.mariotaku.twidere.extension.model
import org.mariotaku.ktextension.addAllTo
import org.mariotaku.microblog.library.mastodon.annotation.StatusVisibility
import org.mariotaku.twidere.TwidereConstants.USER_TYPE_FANFOU_COM
import org.mariotaku.twidere.model.*
import org.mariotaku.twidere.util.UriUtils
import org.mariotaku.twidere.util.Utils
@ -69,6 +70,7 @@ inline val ParcelableStatus.is_my_retweet: Boolean
inline val ParcelableStatus.can_retweet: Boolean
get() {
if (user_key.host == USER_TYPE_FANFOU_COM) return true
if (user_is_protected) return false
return when (extras?.visibility) {
StatusVisibility.PRIVATE -> false

View File

@ -171,10 +171,11 @@ class RetweetQuoteDialogFragment : AbsStatusDialogFragment() {
} else if (canQuoteRetweet(account)) {
if (editComment.empty) {
positiveButton.setText(R.string.action_retweet)
positiveButton.isEnabled = status.can_retweet
} else {
positiveButton.setText(R.string.action_comment)
positiveButton.isEnabled = true
}
positiveButton.isEnabled = true
} else {
positiveButton.setText(R.string.action_retweet)
positiveButton.isEnabled = status.can_retweet