1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-01-25 00:06:49 +01:00

fix #190, post to misskey without attachment failed.

This commit is contained in:
tateisu 2022-06-05 03:15:58 +09:00
parent fe10a48c95
commit 895bfed506

View File

@ -383,12 +383,11 @@ class PostImpl(
suspend fun runSuspend(): PostResult { suspend fun runSuspend(): PostResult {
if (account.isMisskey) { if (account.isMisskey) {
val duplicateCheck = buildMap { attachmentList
attachmentList?.forEach { ?.notEmpty()
put(it.id.toString(), (get(it.id.toString()) ?: 0) + 1) ?.map { it.id.toString() }
} ?.takeIf { it != it.distinct() }
} ?.let {
if (duplicateCheck.values.all { it >= 2 }) {
activity.errorString(R.string.post_error_attachments_duplicated) activity.errorString(R.string.post_error_attachments_duplicated)
} }
} }