mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-09 20:42:19 +02:00
First pass updating Twitter verification to X
This commit is contained in:
@ -26,11 +26,9 @@ import com.vitorpamplona.amethyst.commons.richtext.RichTextViewerState
|
|||||||
import com.vitorpamplona.quartz.events.ImmutableListOfLists
|
import com.vitorpamplona.quartz.events.ImmutableListOfLists
|
||||||
|
|
||||||
object CachedRichTextParser {
|
object CachedRichTextParser {
|
||||||
val richTextCache = LruCache<Int, RichTextViewerState>(50)
|
private val richTextCache = LruCache<Int, RichTextViewerState>(50)
|
||||||
|
|
||||||
// fun getCached(content: String): RichTextViewerState? = richTextCache[content]
|
private fun hashCodeCache(
|
||||||
|
|
||||||
fun hashCodeCache(
|
|
||||||
content: String,
|
content: String,
|
||||||
tags: ImmutableListOfLists<String>,
|
tags: ImmutableListOfLists<String>,
|
||||||
callbackUri: String?,
|
callbackUri: String?,
|
||||||
|
@ -954,7 +954,7 @@ fun WatchIsHiddenUser(
|
|||||||
|
|
||||||
fun getIdentityClaimIcon(identity: IdentityClaim): Int =
|
fun getIdentityClaimIcon(identity: IdentityClaim): Int =
|
||||||
when (identity) {
|
when (identity) {
|
||||||
is TwitterIdentity -> R.drawable.twitter
|
is TwitterIdentity -> R.drawable.x
|
||||||
is TelegramIdentity -> R.drawable.telegram
|
is TelegramIdentity -> R.drawable.telegram
|
||||||
is MastodonIdentity -> R.drawable.mastodon
|
is MastodonIdentity -> R.drawable.mastodon
|
||||||
is GitHubIdentity -> R.drawable.github
|
is GitHubIdentity -> R.drawable.github
|
||||||
|
9
amethyst/src/main/res/drawable/x.xml
Normal file
9
amethyst/src/main/res/drawable/x.xml
Normal 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>
|
@ -250,11 +250,11 @@
|
|||||||
<string name="github" translatable="false">Github Gist w/ Proof</string>
|
<string name="github" translatable="false">Github Gist w/ Proof</string>
|
||||||
<string name="telegram" translatable="false">Telegram</string>
|
<string name="telegram" translatable="false">Telegram</string>
|
||||||
<string name="mastodon" translatable="false">Mastodon Post ID w/ Proof</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/<user>/<gist></string>
|
<string name="github_proof_url_template" translatable="false">https://gist.github.com/<user>/<gist></string>
|
||||||
<string name="telegram_proof_url_template" translatable="false">https://t.me/<proof post></string>
|
<string name="telegram_proof_url_template" translatable="false">https://t.me/<proof post></string>
|
||||||
<string name="mastodon_proof_url_template" translatable="false">https://<server>/<user>/<proof post></string>
|
<string name="mastodon_proof_url_template" translatable="false">https://<server>/<user>/<proof post></string>
|
||||||
<string name="twitter_proof_url_template" translatable="false">https://twitter.com/<user>/status/<proof post></string>
|
<string name="twitter_proof_url_template" translatable="false">https://x.com/<user>/status/<proof post></string>
|
||||||
<string name="private_conversation_notification">"<Unable to decrypt private message>\n\nYou were cited in a private/encrypted conversation between %1$s and %2$s."</string>
|
<string name="private_conversation_notification">"<Unable to decrypt private message>\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="account_switch_add_account_dialog_title">Add New Account</string>
|
||||||
<string name="drawer_accounts">Accounts</string>
|
<string name="drawer_accounts">Accounts</string>
|
||||||
|
@ -87,7 +87,7 @@ class TwitterIdentity(
|
|||||||
identity: String,
|
identity: String,
|
||||||
proof: String,
|
proof: String,
|
||||||
) : IdentityClaim(identity, proof) {
|
) : 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
|
override fun platform() = platform
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ class TwitterIdentity(
|
|||||||
fun parseProofUrl(proofUrl: String): TwitterIdentity? {
|
fun parseProofUrl(proofUrl: String): TwitterIdentity? {
|
||||||
return try {
|
return try {
|
||||||
if (proofUrl.isBlank()) return null
|
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])
|
TwitterIdentity(path[0], path[2])
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
Reference in New Issue
Block a user