First pass updating Twitter verification to X

This commit is contained in:
David Kaspar 2024-08-12 11:07:48 +02:00
parent 4c6842faf4
commit 97a00ff83c
5 changed files with 16 additions and 9 deletions

View File

@ -26,11 +26,9 @@ import com.vitorpamplona.amethyst.commons.richtext.RichTextViewerState
import com.vitorpamplona.quartz.events.ImmutableListOfLists
object CachedRichTextParser {
val richTextCache = LruCache<Int, RichTextViewerState>(50)
private val richTextCache = LruCache<Int, RichTextViewerState>(50)
// fun getCached(content: String): RichTextViewerState? = richTextCache[content]
fun hashCodeCache(
private fun hashCodeCache(
content: String,
tags: ImmutableListOfLists<String>,
callbackUri: String?,

View File

@ -954,7 +954,7 @@ fun WatchIsHiddenUser(
fun getIdentityClaimIcon(identity: IdentityClaim): Int =
when (identity) {
is TwitterIdentity -> R.drawable.twitter
is TwitterIdentity -> R.drawable.x
is TelegramIdentity -> R.drawable.telegram
is MastodonIdentity -> R.drawable.mastodon
is GitHubIdentity -> R.drawable.github

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="1200"
android:viewportHeight="1227"
android:width="1200dp"
android:height="1227dp">
<path
android:pathData="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"
android:fillColor="#FFFFFF" />
</vector>

View File

@ -250,11 +250,11 @@
<string name="github" translatable="false">Github Gist w/ Proof</string>
<string name="telegram" translatable="false">Telegram</string>
<string name="mastodon" translatable="false">Mastodon Post ID w/ Proof</string>
<string name="twitter" translatable="false">Twitter Status w/ Proof</string>
<string name="twitter" translatable="false">X Status w/ Proof</string>
<string name="github_proof_url_template" translatable="false">https://gist.github.com/&lt;user&gt;/&lt;gist&gt;</string>
<string name="telegram_proof_url_template" translatable="false">https://t.me/&lt;proof post&gt;</string>
<string name="mastodon_proof_url_template" translatable="false">https://&lt;server&gt;/&lt;user&gt;/&lt;proof post&gt;</string>
<string name="twitter_proof_url_template" translatable="false">https://twitter.com/&lt;user&gt;/status/&lt;proof post&gt;</string>
<string name="twitter_proof_url_template" translatable="false">https://x.com/&lt;user&gt;/status/&lt;proof post&gt;</string>
<string name="private_conversation_notification">"&lt;Unable to decrypt private message&gt;\n\nYou were cited in a private/encrypted conversation between %1$s and %2$s."</string>
<string name="account_switch_add_account_dialog_title">Add New Account</string>
<string name="drawer_accounts">Accounts</string>

View File

@ -87,7 +87,7 @@ class TwitterIdentity(
identity: String,
proof: String,
) : IdentityClaim(identity, proof) {
override fun toProofUrl() = "https://twitter.com/$identity/status/$proof"
override fun toProofUrl() = "https://x.com/$identity/status/$proof"
override fun platform() = platform
@ -97,7 +97,7 @@ class TwitterIdentity(
fun parseProofUrl(proofUrl: String): TwitterIdentity? {
return try {
if (proofUrl.isBlank()) return null
val path = proofUrl.removePrefix("https://twitter.com/").split("?")[0].split("/")
val path = proofUrl.removePrefix("https://x.com/").split("?")[0].split("/")
TwitterIdentity(path[0], path[2])
} catch (e: Exception) {