From aa105c6d2b2795f59b5d2d8f34c52b91ab93e1ae Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 20 Apr 2020 10:56:58 +0200 Subject: [PATCH 1/2] Fix #1150 Receive 422 errors on certain image uploads to Mastodon --- .../extension/model/AccountDetailsExtensions.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/AccountDetailsExtensions.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/AccountDetailsExtensions.kt index 92998a6aa..4007130fb 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/AccountDetailsExtensions.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/extension/model/AccountDetailsExtensions.kt @@ -71,6 +71,16 @@ fun AccountDetails.getMediaSizeLimit(@MediaCategory mediaCategory: String? = nul } return UpdateStatusTask.SizeLimit(imageLimit, videoLimit) } + AccountType.MASTODON -> { + val imageLimit = AccountExtras.ImageLimit().apply { + maxSizeSync = 8 * 1024 * 1024 + maxSizeAsync = 8 * 1024 * 1024 + maxHeight = 1280 + maxWidth = 1280 + } + val videoLimit = AccountExtras.VideoLimit.twitterDefault() + return UpdateStatusTask.SizeLimit(imageLimit, videoLimit) + } else -> return null } } From 619a020b93617bf64b273dfe4efcf64a13eac1ed Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Mon, 20 Apr 2020 11:42:04 +0200 Subject: [PATCH 2/2] When you reply in a conversation on Mastodon, the reply option add yourself in the message. It's annoying --- .../kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt index 92f675f62..258354b19 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/activity/ComposeActivity.kt @@ -1000,6 +1000,7 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener } AccountType.MASTODON -> { addMastodonMentions(status.text_unescaped, status.spans, mentions) + mentions.remove("${accountUser.screen_name}@${accountUser.key.host}") } else -> if (status.mentions.isNotNullOrEmpty()) { status.mentions.filterNot {