improve #239, replace short_description, read thumbnail.url
This commit is contained in:
parent
8494bcf0d9
commit
ced96e983b
|
@ -150,11 +150,11 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||||
// A description for the instance
|
// A description for the instance
|
||||||
// (HTML)
|
// (HTML)
|
||||||
// (Mastodon: 3.0.0より後のWebUIでは全く使われなくなる見込み。 https://github.com/tootsuite/mastodon/pull/12119)
|
// (Mastodon: 3.0.0より後のWebUIでは全く使われなくなる見込み。 https://github.com/tootsuite/mastodon/pull/12119)
|
||||||
val description: String?
|
val descriptionOld: String?
|
||||||
|
|
||||||
// (Mastodon 3.0.0以降)
|
// (Mastodon 3.0.0以降)
|
||||||
// (HTML)
|
// (HTML)
|
||||||
val short_description: String?
|
val description: String?
|
||||||
|
|
||||||
// An email address which can be used to contact the instance administrator
|
// An email address which can be used to contact the instance administrator
|
||||||
// misskeyの場合はURLらしい
|
// misskeyの場合はURLらしい
|
||||||
|
@ -223,7 +223,7 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||||
this.contact_account = null
|
this.contact_account = null
|
||||||
|
|
||||||
this.description = src.string("description")
|
this.description = src.string("description")
|
||||||
this.short_description = null
|
this.descriptionOld = null
|
||||||
this.approval_required = false
|
this.approval_required = false
|
||||||
|
|
||||||
this.feature_quote = true
|
this.feature_quote = true
|
||||||
|
@ -246,7 +246,15 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||||
this.version = src.string("version")
|
this.version = src.string("version")
|
||||||
this.decoded_version = VersionString(version)
|
this.decoded_version = VersionString(version)
|
||||||
this.stats = parseItem(src.jsonObject("stats")) { Stats(it) }
|
this.stats = parseItem(src.jsonObject("stats")) { Stats(it) }
|
||||||
this.thumbnail = src.string("thumbnail")
|
this.thumbnail =
|
||||||
|
// mastodon /api/v2/instance
|
||||||
|
src.jsonObject("thumbnail")
|
||||||
|
?.jsonObject("versions")?.string("@2x")
|
||||||
|
// mastodon /api/v2/instance
|
||||||
|
?: src.jsonObject("thumbnail")
|
||||||
|
?.string("url")
|
||||||
|
// mastodon /api/v1/instance
|
||||||
|
?: src.string("thumbnail")
|
||||||
|
|
||||||
this.max_toot_chars = src.int("max_toot_chars")
|
this.max_toot_chars = src.int("max_toot_chars")
|
||||||
|
|
||||||
|
@ -277,8 +285,19 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.description = src.string("description")
|
when (val shortDesc = src.string("short_description")) {
|
||||||
this.short_description = src.string("short_description")
|
// /api/v2/instance
|
||||||
|
null -> {
|
||||||
|
this.descriptionOld = null
|
||||||
|
this.description = src.string("description")
|
||||||
|
}
|
||||||
|
// /api/v1/instance
|
||||||
|
else -> {
|
||||||
|
this.descriptionOld = src.string("description")
|
||||||
|
this.description = shortDesc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.approval_required =
|
this.approval_required =
|
||||||
// mastodon /api/v2/instance
|
// mastodon /api/v2/instance
|
||||||
src.jsonObject("registrations")?.boolean("approval_required")
|
src.jsonObject("registrations")?.boolean("approval_required")
|
||||||
|
@ -289,7 +308,10 @@ class TootInstance(parser: TootParser, src: JsonObject) {
|
||||||
|
|
||||||
this.feature_quote = src.boolean("feature_quote") ?: false
|
this.feature_quote = src.boolean("feature_quote") ?: false
|
||||||
|
|
||||||
this.invites_enabled = src.boolean("invites_enabled")
|
this.invites_enabled =
|
||||||
|
// removed on /api/v2/instance
|
||||||
|
// mastodon /api/v1/instance 3.1.4
|
||||||
|
src.boolean("invites_enabled")
|
||||||
|
|
||||||
this.fedibirdCapabilities =
|
this.fedibirdCapabilities =
|
||||||
src.jsonArray("fedibird_capabilities")?.stringList()?.toSet()
|
src.jsonArray("fedibird_capabilities")?.stringList()?.toSet()
|
||||||
|
|
|
@ -61,7 +61,7 @@ internal class ViewHolderHeaderInstance(
|
||||||
}
|
}
|
||||||
|
|
||||||
views.tvDescription.movementMethod = MyLinkMovementMethod
|
views.tvDescription.movementMethod = MyLinkMovementMethod
|
||||||
views.tvShortDescription.movementMethod = MyLinkMovementMethod
|
views.tvDescriptionLong.movementMethod = MyLinkMovementMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun showColor() {
|
override fun showColor() {
|
||||||
|
@ -81,7 +81,7 @@ internal class ViewHolderHeaderInstance(
|
||||||
btnEmail.text = "?"
|
btnEmail.text = "?"
|
||||||
btnEmail.isEnabledAlpha = false
|
btnEmail.isEnabledAlpha = false
|
||||||
tvDescription.text = "?"
|
tvDescription.text = "?"
|
||||||
tvShortDescription.text = "?"
|
tvDescriptionLong.text = "?"
|
||||||
ivThumbnail.setImageUrl(0f, null)
|
ivThumbnail.setImageUrl(0f, null)
|
||||||
tvLanguages.text = "?"
|
tvLanguages.text = "?"
|
||||||
tvInvitesEnabled.text = "?"
|
tvInvitesEnabled.text = "?"
|
||||||
|
@ -133,14 +133,14 @@ internal class ViewHolderHeaderInstance(
|
||||||
emojiSizeMode = accessInfo.emojiSizeMode(),
|
emojiSizeMode = accessInfo.emojiSizeMode(),
|
||||||
)
|
)
|
||||||
|
|
||||||
tvShortDescription.text = options
|
|
||||||
.decodeHTML("<p>${instance.short_description ?: ""}</p>")
|
|
||||||
.neatSpaces()
|
|
||||||
|
|
||||||
tvDescription.text = options
|
tvDescription.text = options
|
||||||
.decodeHTML("<p>${instance.description ?: ""}</p>")
|
.decodeHTML("<p>${instance.description ?: ""}</p>")
|
||||||
.neatSpaces()
|
.neatSpaces()
|
||||||
|
|
||||||
|
tvDescriptionLong.text = options
|
||||||
|
.decodeHTML("<p>${instance.descriptionOld ?: ""}</p>")
|
||||||
|
.neatSpaces()
|
||||||
|
|
||||||
val stats = instance.stats
|
val stats = instance.stats
|
||||||
if (stats == null) {
|
if (stats == null) {
|
||||||
tvUserCount.setText(R.string.not_provided_mastodon_under_1_6)
|
tvUserCount.setText(R.string.not_provided_mastodon_under_1_6)
|
||||||
|
|
|
@ -71,8 +71,8 @@ class DlgCreateAccount(
|
||||||
misskeyVersion = instanceInfo?.misskeyVersionMajor ?: 0
|
misskeyVersion = instanceInfo?.misskeyVersionMajor ?: 0
|
||||||
),
|
),
|
||||||
).decodeHTML(
|
).decodeHTML(
|
||||||
instanceInfo?.short_description?.notBlank()
|
instanceInfo?.description?.notBlank()
|
||||||
?: instanceInfo?.description?.notBlank()
|
?: instanceInfo?.descriptionOld?.notBlank()
|
||||||
?: TootInstance.DESCRIPTION_DEFAULT
|
?: TootInstance.DESCRIPTION_DEFAULT
|
||||||
).neatSpaces()
|
).neatSpaces()
|
||||||
|
|
||||||
|
|
|
@ -271,8 +271,8 @@ class LoginForm(
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
textColor = attrColor(R.attr.colorTextContent)
|
textColor = attrColor(R.attr.colorTextContent)
|
||||||
text = (tootInstance.short_description.notBlank()
|
text = (tootInstance.description.notBlank()
|
||||||
?: tootInstance.description.notBlank()
|
?: tootInstance.descriptionOld.notBlank()
|
||||||
?: "(empty server description)"
|
?: "(empty server description)"
|
||||||
).let {
|
).let {
|
||||||
DecodeOptions(
|
DecodeOptions(
|
||||||
|
|
|
@ -160,20 +160,20 @@
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/setting_row_label"
|
style="@style/setting_row_label"
|
||||||
android:text="@string/short_description" />
|
android:text="@string/description" />
|
||||||
|
|
||||||
<jp.juggler.subwaytooter.view.MyTextView
|
<jp.juggler.subwaytooter.view.MyTextView
|
||||||
android:id="@+id/tvShortDescription"
|
android:id="@+id/tvDescription"
|
||||||
style="@style/setting_row_form" />
|
style="@style/setting_row_form" />
|
||||||
|
|
||||||
<View style="@style/setting_divider" />
|
<View style="@style/setting_divider" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
style="@style/setting_row_label"
|
style="@style/setting_row_label"
|
||||||
android:text="@string/description" />
|
android:text="@string/description_long" />
|
||||||
|
|
||||||
<jp.juggler.subwaytooter.view.MyTextView
|
<jp.juggler.subwaytooter.view.MyTextView
|
||||||
android:id="@+id/tvDescription"
|
android:id="@+id/tvDescriptionLong"
|
||||||
style="@style/setting_row_form" />
|
style="@style/setting_row_form" />
|
||||||
|
|
||||||
<View style="@style/setting_divider" />
|
<View style="@style/setting_divider" />
|
||||||
|
|
|
@ -490,7 +490,6 @@
|
||||||
<string name="domain_count">عدد النطاقات المتصلة</string>
|
<string name="domain_count">عدد النطاقات المتصلة</string>
|
||||||
<string name="dont_show_timeout">لا تُظهر إشعار \"انتهاء مهلة الخادم\"</string>
|
<string name="dont_show_timeout">لا تُظهر إشعار \"انتهاء مهلة الخادم\"</string>
|
||||||
<string name="default_">افتراضي</string>
|
<string name="default_">افتراضي</string>
|
||||||
<string name="short_description">وصف قصير</string>
|
|
||||||
<string name="acct_sample">(مثال) username@server</string>
|
<string name="acct_sample">(مثال) username@server</string>
|
||||||
<string name="background_image_alpha">شفافية صورة الخلفية</string>
|
<string name="background_image_alpha">شفافية صورة الخلفية</string>
|
||||||
<string name="dont_show_follow">إخفاء المتابِعين</string>
|
<string name="dont_show_follow">إخفاء المتابِعين</string>
|
||||||
|
|
|
@ -466,7 +466,6 @@
|
||||||
<string name="title">Títol</string>
|
<string name="title">Títol</string>
|
||||||
<string name="email">Correu-e</string>
|
<string name="email">Correu-e</string>
|
||||||
<string name="description">Descripció</string>
|
<string name="description">Descripció</string>
|
||||||
<string name="short_description">Descripció curta</string>
|
|
||||||
<string name="version">Versió</string>
|
<string name="version">Versió</string>
|
||||||
<string name="instance_information_of">Informació al servidor de \"%1$s\"</string>
|
<string name="instance_information_of">Informació al servidor de \"%1$s\"</string>
|
||||||
<string name="instance_information">Informació del servidor</string>
|
<string name="instance_information">Informació del servidor</string>
|
||||||
|
|
|
@ -950,7 +950,6 @@
|
||||||
<string name="instance_information">Serverinformation</string>
|
<string name="instance_information">Serverinformation</string>
|
||||||
<string name="instance_information_of">Serverinformation von \"%1$s\"</string>
|
<string name="instance_information_of">Serverinformation von \"%1$s\"</string>
|
||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="short_description">Kurzbeschreibung</string>
|
|
||||||
<string name="description">Beschreibung</string>
|
<string name="description">Beschreibung</string>
|
||||||
<string name="email">E-Mail</string>
|
<string name="email">E-Mail</string>
|
||||||
<string name="title">Titel</string>
|
<string name="title">Titel</string>
|
||||||
|
|
|
@ -939,7 +939,6 @@
|
||||||
<string name="around_this_toot">Autour de ce message</string>
|
<string name="around_this_toot">Autour de ce message</string>
|
||||||
<string name="your_toot">Votre message</string>
|
<string name="your_toot">Votre message</string>
|
||||||
<string name="block_domain">Bloquer tout le domaine</string>
|
<string name="block_domain">Bloquer tout le domaine</string>
|
||||||
<string name="short_description">Courte description</string>
|
|
||||||
<string name="media_attachment_max_byte_size_pixelfed">Taille limite de la pièce jointe (PixelFed) (Unité : Mo. Par défaut 15)</string>
|
<string name="media_attachment_max_byte_size_pixelfed">Taille limite de la pièce jointe (PixelFed) (Unité : Mo. Par défaut 15)</string>
|
||||||
<string name="resize_square_pixels">Redimensionner en %1$d pixels carrés (équivalent %2$dx%2$d)</string>
|
<string name="resize_square_pixels">Redimensionner en %1$d pixels carrés (équivalent %2$dx%2$d)</string>
|
||||||
<string name="status_bar_color">Couleur de la barre d’état (redémarrage de l\'app requis. pre-Android 6 ne peut pas ajuster l’icône et la couleur du texte)</string>
|
<string name="status_bar_color">Couleur de la barre d’état (redémarrage de l\'app requis. pre-Android 6 ne peut pas ajuster l’icône et la couleur du texte)</string>
|
||||||
|
|
|
@ -194,7 +194,7 @@
|
||||||
<string name="delete_this_notification">この通知を削除</string>
|
<string name="delete_this_notification">この通知を削除</string>
|
||||||
<string name="deleted_at">%1$sに削除されました</string>
|
<string name="deleted_at">%1$sに削除されました</string>
|
||||||
<string name="description">説明</string>
|
<string name="description">説明</string>
|
||||||
<string name="short_description">短い説明</string>
|
<string name="description_long">長い説明 (old Mastodon)</string>
|
||||||
<string name="description_empty">説明文が指定されてません</string>
|
<string name="description_empty">説明文が指定されてません</string>
|
||||||
<string name="developer">開発者</string>
|
<string name="developer">開発者</string>
|
||||||
<string name="direct_messages">ダイレクトメッセージ</string>
|
<string name="direct_messages">ダイレクトメッセージ</string>
|
||||||
|
|
|
@ -1015,7 +1015,6 @@
|
||||||
<string name="instance_information">实例信息</string>
|
<string name="instance_information">实例信息</string>
|
||||||
<string name="instance_information_of">“%1$s”的实例信息</string>
|
<string name="instance_information_of">“%1$s”的实例信息</string>
|
||||||
<string name="version">版本</string>
|
<string name="version">版本</string>
|
||||||
<string name="short_description">简要描述</string>
|
|
||||||
<string name="description">描述</string>
|
<string name="description">描述</string>
|
||||||
<string name="email">电子邮件</string>
|
<string name="email">电子邮件</string>
|
||||||
<string name="read_more_hashtag">读取更多标签</string>
|
<string name="read_more_hashtag">读取更多标签</string>
|
||||||
|
|
|
@ -465,7 +465,7 @@
|
||||||
<string name="title">Title</string>
|
<string name="title">Title</string>
|
||||||
<string name="email">E-mail</string>
|
<string name="email">E-mail</string>
|
||||||
<string name="description">Description</string>
|
<string name="description">Description</string>
|
||||||
<string name="short_description">Short description</string>
|
<string name="description_long">Description (old Mastodon)</string>
|
||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="instance_information_of">Server information of \"%1$s\"</string>
|
<string name="instance_information_of">Server information of \"%1$s\"</string>
|
||||||
<string name="instance_information">Server information</string>
|
<string name="instance_information">Server information</string>
|
||||||
|
|
Loading…
Reference in New Issue