某タンスのプロフ絵文字に対応

This commit is contained in:
tateisu 2019-04-28 22:05:35 +09:00
parent c6fa3fa1a1
commit 331356a0c7
1 changed files with 6 additions and 2 deletions

View File

@ -186,9 +186,13 @@ open class TootAccount(parser : TootParser, src : JSONObject) {
// 絵文字データは先に読んでおく
this.custom_emojis = parseMapOrNull(CustomEmoji.decode, src.optJSONArray("emojis"))
this.profile_emojis =
parseMapOrNull(::NicoProfileEmoji, src.optJSONArray("profile_emojis"))
this.profile_emojis = when(val o = src.opt("profile_emojis")) {
is JSONArray -> parseMapOrNull(::NicoProfileEmoji, o, TootStatus.log)
is JSONObject ->parseProfileEmoji2(::NicoProfileEmoji, o, TootStatus.log)
else -> null
}
// 疑似アカウントにacctとusernameだけ
this.url = src.parseString("url")
this.username = src.notEmptyOrThrow("username")