From 40309753bd8817eb96c252cbb405f066fb3350fc Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Wed, 17 May 2017 17:09:00 +0800 Subject: [PATCH] enabled retweet protected user for fanfou disabled retweet button when no comment text --- .../twidere/extension/model/ParcelableStatusExtensions.kt | 2 ++ .../twidere/fragment/status/RetweetQuoteDialogFragment.kt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableStatusExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableStatusExtensions.kt index ef1eaf870..40025db4e 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableStatusExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/ParcelableStatusExtensions.kt @@ -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 diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/status/RetweetQuoteDialogFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/status/RetweetQuoteDialogFragment.kt index 73124192d..62ea5227d 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/status/RetweetQuoteDialogFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/status/RetweetQuoteDialogFragment.kt @@ -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