diff --git a/app/src/main/java/chat/revolt/api/RevoltAPI.kt b/app/src/main/java/chat/revolt/api/RevoltAPI.kt index 5c9c4946..82f57c45 100644 --- a/app/src/main/java/chat/revolt/api/RevoltAPI.kt +++ b/app/src/main/java/chat/revolt/api/RevoltAPI.kt @@ -73,6 +73,7 @@ data class PlatformUrls( val app: String, val invites: String, val websocket: String, + val autumn: String, val kjbook: String ) @@ -86,16 +87,18 @@ private val PLATFORM_URLS = mapOf( app = "https://app.revolt.chat", invites = "https://rvlt.gg", websocket = "wss://ws.revolt.chat", + autumn = "https://autumn.revolt.chat", kjbook = "https://revoltchat.github.io/android" ), ApplicationPlatform.PEP to PlatformUrls( - base = "https://api.pep.chat/0.8", - marketing = "https://pep.chat", + base = "https://a-pep.peptide.chat/api", + marketing = "https://peptide.chat", files = "https://cdn.pepusercontent.com", - january = "https://jan.pep.chat", - app = "https://app.pep.chat", + january = "https://a-pep.peptide.chat/january", + app = "https://peptide.chat", invites = "https://pep.gg", - websocket = "wss://ws.pep.chat", + websocket = "https://a-pep.peptide.chat/ws", + autumn = "https://autumn.revolt.chat", kjbook = "https://pepchat.github.io/android" ) ) @@ -258,6 +261,7 @@ object RevoltAPI { fun getCurrentAppUrl(): String = getUrlForPlatform(selectedApplicationPlatform) { it.app } fun getCurrentInvitesUrl(): String = getUrlForPlatform(selectedApplicationPlatform) { it.invites } fun getCurrentWebSocketUrl(): String = getUrlForPlatform(selectedApplicationPlatform) { it.websocket } + fun getCurrentAutumnUrl(): String = getUrlForPlatform(selectedApplicationPlatform) { it.autumn } fun getCurrentKjBookUrl(): String = getUrlForPlatform(selectedApplicationPlatform) { it.kjbook } @OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class) diff --git a/app/src/main/java/chat/revolt/screens/settings/ProfileSettngsScreen.kt b/app/src/main/java/chat/revolt/screens/settings/ProfileSettngsScreen.kt index d5cf2815..55e2d90e 100644 --- a/app/src/main/java/chat/revolt/screens/settings/ProfileSettngsScreen.kt +++ b/app/src/main/java/chat/revolt/screens/settings/ProfileSettngsScreen.kt @@ -18,8 +18,6 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Check import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon @@ -79,12 +77,12 @@ class ProfileSettingsScreenViewModel @Inject constructor(@ApplicationContext val init { RevoltAPI.selfId?.let { self -> RevoltAPI.userCache[self]?.avatar?.id?.let { - pfpModel = "https://autumn.revolt.chat/avatars/${it}" + pfpModel = "${RevoltAPI.getCurrentAutumnUrl()}/avatars/${it}" } viewModelScope.launch { currentProfile = fetchUserProfile(self) currentProfile!!.background?.id?.let { - backgroundModel = "https://autumn.revolt.chat/backgrounds/${it}" + backgroundModel = "${RevoltAPI.getCurrentAutumnUrl()}/backgrounds/${it}" } pendingProfile = currentProfile!!.copy() @@ -139,7 +137,7 @@ class ProfileSettingsScreenViewModel @Inject constructor(@ApplicationContext val } pfpModel = RevoltAPI.userCache[RevoltAPI.selfId]?.avatar?.id?.let { - "https://autumn.revolt.chat/avatars/${it}" + "${RevoltAPI.getCurrentAutumnUrl()}/avatars/${it}" } uploadProgress = 0f @@ -194,8 +192,8 @@ class ProfileSettingsScreenViewModel @Inject constructor(@ApplicationContext val currentProfile = profile pendingProfile = profile - profile.background?.id?.let { - "https://autumn.revolt.chat/backgrounds/${it}" + profile.background?.id?.let { id -> + "${RevoltAPI.getCurrentAutumnUrl()}/backgrounds/${id}" } }