1
0
mirror of https://github.com/tateisu/SubwayTooter synced 2025-02-06 05:33:50 +01:00
This commit is contained in:
tateisu 2020-09-13 23:37:02 +09:00
parent 3721d03919
commit 8305cb8ee3
2 changed files with 16 additions and 15 deletions

View File

@ -80,11 +80,9 @@ class Column(
internal const val MISSKEY_HASHTAG_LIMIT = 30
// ステータスのリストを返すAPI
internal const val PATH_HOME = "/api/v1/timelines/home?limit=$READ_LIMIT"
internal const val PATH_DIRECT_MESSAGES = "/api/v1/timelines/direct?limit=$READ_LIMIT"
internal const val PATH_DIRECT_MESSAGES2 = "/api/v1/conversations?limit=$READ_LIMIT"
internal const val PATH_LOCAL = "/api/v1/timelines/public?limit=$READ_LIMIT&local=true"
internal const val PATH_FAVOURITES = "/api/v1/favourites?limit=$READ_LIMIT"
internal const val PATH_BOOKMARKS = "/api/v1/bookmarks?limit=$READ_LIMIT"

View File

@ -23,7 +23,6 @@ internal inline fun <reified T : TimelineItem> addAll(
}
}
internal fun addOne(
dstArg : ArrayList<TimelineItem>?,
item : TimelineItem?,
@ -309,16 +308,25 @@ internal fun Column.makeMisskeyParamsProfileStatuses(parser : TootParser) =
if(! dont_show_boost) put("includeMyRenotes", true)
}
const val PATH_LOCAL = "/api/v1/timelines/public?local=true&limit=$READ_LIMIT"
internal fun Column.makePublicLocalUrl() : String {
return when {
access_info.isMisskey -> "/api/notes/local-timeline"
with_attachment -> "${Column.PATH_LOCAL}&only_media=true" // mastodon 2.3 or later
else -> Column.PATH_LOCAL
with_attachment -> "${PATH_LOCAL}&only_media=true" // mastodon 2.3 or later
else -> PATH_LOCAL
}
}
internal fun Column.makeMisskeyHybridTlUrl() : String {
return when {
access_info.isMisskey -> "/api/notes/hybrid-timeline"
else -> makePublicLocalUrl()
}
}
internal fun Column.makeDomainTimelineUrl() : String {
val base = "/api/v1/timelines/public?limit=$READ_LIMIT&domain=$instance_uri"
val base = "/api/v1/timelines/public?domain=$instance_uri&limit=$READ_LIMIT"
return when {
access_info.isMisskey -> "/api/notes/local-timeline"
with_attachment -> "$base&only_media=true"
@ -326,13 +334,6 @@ internal fun Column.makeDomainTimelineUrl() : String {
}
}
internal fun Column.makeMisskeyHybridTlUrl() : String {
return when {
access_info.isMisskey -> "/api/notes/hybrid-timeline"
with_attachment -> "${Column.PATH_LOCAL}&only_media=true" // mastodon 2.3 or later
else -> Column.PATH_LOCAL
}
}
internal fun Column.makePublicFederateUrl() : String {
@ -346,11 +347,13 @@ internal fun Column.makePublicFederateUrl() : String {
}
}
const val PATH_HOME = "/api/v1/timelines/home?limit=$READ_LIMIT"
internal fun Column.makeHomeTlUrl() : String {
return when {
access_info.isMisskey -> "/api/notes/timeline"
with_attachment -> "${Column.PATH_HOME}&only_media=true"
else -> Column.PATH_HOME
with_attachment -> "$PATH_HOME&only_media=true"
else -> PATH_HOME
}
}