From 6f9a69b9d47de27df6b96553188000a693f18f1f Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 27 Jan 2023 22:03:54 -0300 Subject: [PATCH] Migrating pictures and banners to https --- .../main/java/com/vitorpamplona/amethyst/model/User.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt b/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt index e62e50df0..9a5e75e2f 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/model/User.kt @@ -128,6 +128,14 @@ class User(val pubkey: ByteArray) { info = newUserInfo updatedMetadataAt = updateAt + if (info.picture?.startsWith( "http://") == true) { + info.picture = info.picture?.replaceFirst("http://", "https://") + } + + if (info.banner?.startsWith( "http://") == true) { + info.banner = info.banner?.replaceFirst("http://", "https://") + } + invalidateData() }