enabled retweet protected user for fanfou
disabled retweet button when no comment text
This commit is contained in:
parent
5434e21cdb
commit
40309753bd
|
@ -2,6 +2,7 @@ package org.mariotaku.twidere.extension.model
|
||||||
|
|
||||||
import org.mariotaku.ktextension.addAllTo
|
import org.mariotaku.ktextension.addAllTo
|
||||||
import org.mariotaku.microblog.library.mastodon.annotation.StatusVisibility
|
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.model.*
|
||||||
import org.mariotaku.twidere.util.UriUtils
|
import org.mariotaku.twidere.util.UriUtils
|
||||||
import org.mariotaku.twidere.util.Utils
|
import org.mariotaku.twidere.util.Utils
|
||||||
|
@ -69,6 +70,7 @@ inline val ParcelableStatus.is_my_retweet: Boolean
|
||||||
|
|
||||||
inline val ParcelableStatus.can_retweet: Boolean
|
inline val ParcelableStatus.can_retweet: Boolean
|
||||||
get() {
|
get() {
|
||||||
|
if (user_key.host == USER_TYPE_FANFOU_COM) return true
|
||||||
if (user_is_protected) return false
|
if (user_is_protected) return false
|
||||||
return when (extras?.visibility) {
|
return when (extras?.visibility) {
|
||||||
StatusVisibility.PRIVATE -> false
|
StatusVisibility.PRIVATE -> false
|
||||||
|
|
|
@ -171,10 +171,11 @@ class RetweetQuoteDialogFragment : AbsStatusDialogFragment() {
|
||||||
} else if (canQuoteRetweet(account)) {
|
} else if (canQuoteRetweet(account)) {
|
||||||
if (editComment.empty) {
|
if (editComment.empty) {
|
||||||
positiveButton.setText(R.string.action_retweet)
|
positiveButton.setText(R.string.action_retweet)
|
||||||
|
positiveButton.isEnabled = status.can_retweet
|
||||||
} else {
|
} else {
|
||||||
positiveButton.setText(R.string.action_comment)
|
positiveButton.setText(R.string.action_comment)
|
||||||
|
positiveButton.isEnabled = true
|
||||||
}
|
}
|
||||||
positiveButton.isEnabled = true
|
|
||||||
} else {
|
} else {
|
||||||
positiveButton.setText(R.string.action_retweet)
|
positiveButton.setText(R.string.action_retweet)
|
||||||
positiveButton.isEnabled = status.can_retweet
|
positiveButton.isEnabled = status.can_retweet
|
||||||
|
|
Loading…
Reference in New Issue