(Misskey v11)アプリの権限リストをv11以降とそれ未満で切り替える
This commit is contained in:
parent
3f6f709e8a
commit
d7d04fc6db
|
@ -191,31 +191,57 @@ class TootApiClient(
|
|||
|
||||
fun getScopeArrayMisskey(@Suppress("UNUSED_PARAMETER") ti : TootInstance) =
|
||||
JSONArray().apply {
|
||||
// https://github.com/syuilo/misskey/issues/2341
|
||||
arrayOf(
|
||||
"account-read",
|
||||
"account-write",
|
||||
"account/read",
|
||||
"account/write",
|
||||
"drive-read",
|
||||
"drive-write",
|
||||
"favorite-read",
|
||||
"favorite-write",
|
||||
"favorites-read",
|
||||
"following-read",
|
||||
"following-write",
|
||||
"messaging-read",
|
||||
"messaging-write",
|
||||
"note-read",
|
||||
"note-write",
|
||||
"notification-read",
|
||||
"notification-write",
|
||||
"reaction-read",
|
||||
"reaction-write",
|
||||
"vote-read",
|
||||
"vote-write"
|
||||
|
||||
)
|
||||
if(ti.versionGE(TootInstance.MISSKEY_VERSION_11)) {
|
||||
arrayOf(
|
||||
"read:account",
|
||||
"write:account",
|
||||
"read:blocks",
|
||||
"write:blocks",
|
||||
"read:drive",
|
||||
"write:drive",
|
||||
"read:favorites",
|
||||
"write:favorites",
|
||||
"read:following",
|
||||
"write:following",
|
||||
"read:messaging",
|
||||
"write:messaging",
|
||||
"read:mutes",
|
||||
"write:mutes",
|
||||
"write:notes",
|
||||
"read:notifications",
|
||||
"write:notifications",
|
||||
"read:reactions",
|
||||
"write:reactions",
|
||||
"write:votes"
|
||||
)
|
||||
} else {
|
||||
// https://github.com/syuilo/misskey/issues/2341
|
||||
arrayOf(
|
||||
"account-read",
|
||||
"account-write",
|
||||
"account/read",
|
||||
"account/write",
|
||||
"drive-read",
|
||||
"drive-write",
|
||||
"favorite-read",
|
||||
"favorite-write",
|
||||
"favorites-read",
|
||||
"following-read",
|
||||
"following-write",
|
||||
"messaging-read",
|
||||
"messaging-write",
|
||||
"note-read",
|
||||
"note-write",
|
||||
"notification-read",
|
||||
"notification-write",
|
||||
"reaction-read",
|
||||
"reaction-write",
|
||||
"vote-read",
|
||||
"vote-write"
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
// APIのエラーを回避するため、重複を排除する
|
||||
.toMutableSet()
|
||||
.forEach { put(it) }
|
||||
|
|
|
@ -22,6 +22,8 @@ class TootInstance(parser : TootParser, src : JSONObject) {
|
|||
val VERSION_2_4_1 = VersionString("2.4.1")
|
||||
val VERSION_2_6_0 = VersionString("2.6.0")
|
||||
val VERSION_2_7_0_rc1 = VersionString("2.7.0rc1")
|
||||
|
||||
val MISSKEY_VERSION_11 = VersionString("11.0")
|
||||
}
|
||||
|
||||
// いつ取得したか(内部利用)
|
||||
|
|
|
@ -131,6 +131,7 @@ object LoginForm {
|
|||
if(s.isNotEmpty()) instance_list.add(s)
|
||||
}
|
||||
}
|
||||
instance_list.sort()
|
||||
} catch(ex : Throwable) {
|
||||
log.trace(ex)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
misskey.io
|
||||
best-friends.chat
|
||||
15m.icolectiva.org
|
||||
1oku.net
|
||||
3.distsn.org
|
||||
|
|
Loading…
Reference in New Issue