mirror of
https://github.com/tateisu/SubwayTooter
synced 2025-01-26 16:56:28 +01:00
「フォロー推奨ユーザ」カラムはサーバのバージョンが3.4.0rc1以降だと/api/v2/suggestionsを読む
This commit is contained in:
parent
9e6b781912
commit
3f71b87125
@ -90,6 +90,7 @@ class Column(
|
||||
internal const val PATH_BLOCKS = "/api/v1/blocks?limit=$READ_LIMIT"
|
||||
internal const val PATH_FOLLOW_REQUESTS = "/api/v1/follow_requests?limit=$READ_LIMIT"
|
||||
internal const val PATH_FOLLOW_SUGGESTION = "/api/v1/suggestions?limit=$READ_LIMIT"
|
||||
internal const val PATH_FOLLOW_SUGGESTION2 = "/api/v2/suggestions?limit=$READ_LIMIT"
|
||||
internal const val PATH_ENDORSEMENT = "/api/v1/endorsements?limit=$READ_LIMIT"
|
||||
|
||||
internal const val PATH_PROFILE_DIRECTORY = "/api/v1/directory?limit=$READ_LIMIT"
|
||||
|
@ -1470,7 +1470,14 @@ enum class ColumnType(
|
||||
misskeyParams = access_info.putMisskeyApiToken()
|
||||
)
|
||||
} else {
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION)
|
||||
val (ti, ri) = TootInstance.get(client)
|
||||
when {
|
||||
ti ==null -> ri
|
||||
ti.versionGE(TootInstance.VERSION_3_4_0_rc1) ->
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION2)
|
||||
else ->
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -1482,7 +1489,14 @@ enum class ColumnType(
|
||||
misskeyParams = access_info.putMisskeyApiToken()
|
||||
)
|
||||
} else {
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION)
|
||||
val (ti, ri) = TootInstance.get(client)
|
||||
when {
|
||||
ti ==null -> ri
|
||||
ti.versionGE(TootInstance.VERSION_3_4_0_rc1) ->
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION2)
|
||||
else ->
|
||||
getAccountList(client, Column.PATH_FOLLOW_SUGGESTION)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -1495,11 +1509,22 @@ enum class ColumnType(
|
||||
misskeyParams = access_info.putMisskeyApiToken()
|
||||
)
|
||||
} else {
|
||||
getAccountList(
|
||||
client,
|
||||
Column.PATH_FOLLOW_SUGGESTION,
|
||||
mastodonFilterByIdRange = false
|
||||
)
|
||||
val (ti, ri) = TootInstance.get(client)
|
||||
when {
|
||||
ti ==null -> ri
|
||||
ti.versionGE(TootInstance.VERSION_3_4_0_rc1) ->
|
||||
getAccountList(
|
||||
client,
|
||||
Column.PATH_FOLLOW_SUGGESTION2,
|
||||
mastodonFilterByIdRange = false
|
||||
)
|
||||
else ->
|
||||
getAccountList(
|
||||
client,
|
||||
Column.PATH_FOLLOW_SUGGESTION,
|
||||
mastodonFilterByIdRange = false
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
gapDirection = gapDirectionMastodonWorkaround,
|
||||
|
@ -243,6 +243,7 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||
val VERSION_3_1_0_rc1 = VersionString("3.1.0rc1")
|
||||
val VERSION_3_1_3 = VersionString("3.1.3")
|
||||
val VERSION_3_3_0_rc1 = VersionString("3.3.0rc1")
|
||||
val VERSION_3_4_0_rc1 = VersionString("3.4.0rc1")
|
||||
|
||||
val MISSKEY_VERSION_11 = VersionString("11.0")
|
||||
val MISSKEY_VERSION_12 = VersionString("12.0")
|
||||
|
Loading…
Reference in New Issue
Block a user