Merge remote-tracking branch 'origin/repository-test' into repository-test

This commit is contained in:
usbharu 2024-09-10 21:34:56 +09:00
commit e67eb788a7
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
4 changed files with 74 additions and 71 deletions

View File

@ -8,6 +8,4 @@ class MastodonReadTimeline(
val localOnly: Boolean, val localOnly: Boolean,
val remoteOnly: Boolean, val remoteOnly: Boolean,
val page: Page val page: Page
) { )
}

View File

@ -38,72 +38,76 @@ class MastodonReadTimelineApplicationService(
val readTimeline = timelineStore.readTimeline(timeline, readTimelineOption, command.page, principal) val readTimeline = timelineStore.readTimeline(timeline, readTimelineOption, command.page, principal)
return PaginationList(readTimeline.map { return PaginationList(
Status( readTimeline.map {
it.postId.id.toString(), Status(
it.post.url.toString(), it.postId.id.toString(),
it.post.createdAt.toString(), it.post.url.toString(),
account = Account( it.post.createdAt.toString(),
id = it.postActor.id.id.toString(), account = Account(
username = it.postActor.name.name, id = it.postActor.id.id.toString(),
acct = Acct(it.postActor.name.name, it.postActor.domain.domain).toString(), username = it.postActor.name.name,
url = it.postActor.url.toString(), acct = Acct(it.postActor.name.name, it.postActor.domain.domain).toString(),
displayName = it.postActor.screenName.screenName, url = it.postActor.url.toString(),
note = it.postActor.description.description, displayName = it.postActor.screenName.screenName,
avatar = it.postActorIconMedia?.url.toString(), note = it.postActor.description.description,
avatarStatic = it.postActorIconMedia?.thumbnailUrl.toString(), avatar = it.postActorIconMedia?.url.toString(),
header = "", avatarStatic = it.postActorIconMedia?.thumbnailUrl.toString(),
headerStatic = "", header = "",
locked = false, headerStatic = "",
fields = emptyList(), locked = false,
fields = emptyList(),
emojis = emptyList(),
bot = false,
group = false,
discoverable = true,
createdAt = it.postActor.createdAt.toString(),
statusesCount = it.postActor.postsCount.postsCount,
noindex = true,
moved = it.postActor.moveTo != null,
suspended = it.postActor.suspend,
limited = false,
lastStatusAt = it.postActor.lastPostAt?.toString(),
followersCount = it.postActor.followersCount?.relationshipCount,
followingCount = it.postActor.followingCount?.relationshipCount,
),
content = it.post.content.content,
visibility = when (it.post.visibility) {
PUBLIC -> Status.Visibility.public
UNLISTED -> Status.Visibility.unlisted
FOLLOWERS -> Status.Visibility.private
DIRECT -> Status.Visibility.direct
},
sensitive = it.post.sensitive,
spoilerText = it.post.overview?.overview.orEmpty(),
mediaAttachments = it.postMedias.map { MediaAttachment(it.id.id.toString()) },
mentions = emptyList(),
tags = emptyList(),
emojis = emptyList(), emojis = emptyList(),
bot = false, reblogsCount = 0,
group = false, favouritesCount = it.reactionsList.sumOf { it.count },
discoverable = true, repliesCount = 0,
createdAt = it.postActor.createdAt.toString(), url = it.post.url.toString(),
statusesCount = it.postActor.postsCount.postsCount, text = it.post.content.text,
noindex = true, application = null,
moved = it.postActor.moveTo != null, inReplyToId = it.replyPost?.id?.toString(),
suspended = it.postActor.suspend, inReplyToAccountId = it.replyPostActor?.id?.toString(),
limited = false, reblog = null,
lastStatusAt = it.postActor.lastPostAt?.toString(), poll = null,
followersCount = it.postActor.followersCount?.relationshipCount, card = null,
followingCount = it.postActor.followingCount?.relationshipCount, language = null,
), editedAt = null,
content = it.post.content.content, favourited = it.favourited,
visibility = when (it.post.visibility) { reblogged = false,
PUBLIC -> Status.Visibility.public muted = false,
UNLISTED -> Status.Visibility.unlisted bookmarked = false,
FOLLOWERS -> Status.Visibility.private pinned = false,
DIRECT -> Status.Visibility.direct filtered = emptyList(),
}, )
sensitive = it.post.sensitive, },
spoilerText = it.post.overview?.overview.orEmpty(), readTimeline.next?.id,
mediaAttachments = it.postMedias.map { MediaAttachment(it.id.id.toString()) }, readTimeline.prev?.id
mentions = emptyList(), )
tags = emptyList(),
emojis = emptyList(),
reblogsCount = 0,
favouritesCount = it.reactionsList.sumOf { it.count },
repliesCount = 0,
url = it.post.url.toString(),
text = it.post.content.text,
application = null,
inReplyToId = it.replyPost?.id?.toString(),
inReplyToAccountId = it.replyPostActor?.id?.toString(),
reblog = null,
poll = null,
card = null,
language = null,
editedAt = null,
favourited = it.favourited,
reblogged = false,
muted = false,
bookmarked = false,
pinned = false,
filtered = emptyList(),
)
}, readTimeline.next?.id, readTimeline.prev?.id)
} }
companion object { companion object {

View File

@ -67,7 +67,8 @@ class SpringTimelineApi(
minId?.toLongOrNull(), minId?.toLongOrNull(),
limit limit
) )
), principal ),
principal
).asFlow() ).asFlow()
) )
} }

View File

@ -65,7 +65,7 @@ jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-
blurhash = { module = "io.trbl:blurhash", version = "1.0.0" } blurhash = { module = "io.trbl:blurhash", version = "1.0.0" }
aws-s3 = { module = "software.amazon.awssdk:s3", version = "2.27.21" } aws-s3 = { module = "software.amazon.awssdk:s3", version = "2.27.22" }
jsoup = { module = "org.jsoup:jsoup", version = "1.18.1" } jsoup = { module = "org.jsoup:jsoup", version = "1.18.1" }