From 8b693c737b60afac37e381cf22b9182eb805fc9f Mon Sep 17 00:00:00 2001 From: AbronStudio Date: Sun, 3 Aug 2025 13:41:44 +0330 Subject: [PATCH 1/5] refactor: Update API references and platform handling This commit refines the API references throughout the application to utilize the new `RevoltAPI` structure, enhancing maintainability and clarity. Key changes include: - Replaced all instances of `REVOLT_FILES`, `REVOLT_BASE`, and other constants with calls to `RevoltAPI` methods for dynamic URL generation. - Introduced an `ApplicationPlatform` enum to manage platform-specific URLs, allowing for easier switching between Revolt and PepChat. - Updated various screens and components to reflect the new API structure, ensuring consistent URL handling across the application. - Enhanced the `ChoosePlatformScreen` to set the selected platform and navigate accordingly. These changes improve the overall architecture and prepare the codebase for future enhancements. --- .idea/.name | 2 +- .idea/dictionaries/project.xml | 8 + .idea/misc.xml | 1 - .../java/chat/revolt/RevoltApplication.kt | 11 + .../chat/revolt/activities/InviteActivity.kt | 6 +- .../activities/media/ImageViewActivity.kt | 4 +- .../activities/media/VideoViewActivity.kt | 4 +- .../main/java/chat/revolt/api/RevoltAPI.kt | 218 ++++-- .../revolt/api/internals/ResourceLocations.kt | 4 +- .../revolt/api/realtime/RealtimeSocket.kt | 3 +- .../api/routes/microservices/autumn/Autumn.kt | 3 +- .../routes/microservices/january/January.kt | 4 +- .../java/chat/revolt/api/schemas/Invites.kt | 7 +- .../java/chat/revolt/c2dm/HandlerService.kt | 4 +- .../revolt/composables/chat/MemberListItem.kt | 4 +- .../chat/revolt/composables/chat/Message.kt | 5 +- .../composables/chat/MessageAttachment.kt | 8 +- .../revolt/composables/chat/MessageField.kt | 6 +- .../chat/revolt/composables/chat/Reaction.kt | 3 +- .../revolt/composables/emoji/EmojiPicker.kt | 6 +- .../revolt/composables/generic/UserAvatar.kt | 11 +- .../composables/markdown/MarkdownText.kt | 3 +- .../screens/chat/ChannelSheetHeader.kt | 4 +- .../screens/chat/TypingIndicator.kt | 3 +- .../screens/chat/drawer/ChannelSideDrawer.kt | 5 +- .../screens/services/DiscoverView.kt | 4 +- .../screens/settings/ServerOverview.kt | 6 +- .../screens/settings/UserOverview.kt | 3 +- .../fragments/ChangelogBottomSheetFragment.kt | 6 +- .../java/chat/revolt/internals/Changelogs.kt | 6 +- .../revolt/markdown/jbm/FallbackRenderer.kt | 8 +- .../chat/revolt/markdown/jbm/JBMRenderer.kt | 3 +- .../chat/revolt/markdown/jbm/KatexRenderer.kt | 6 +- .../chat/revolt/screens/about/AboutScreen.kt | 4 +- .../screens/chat/dialogs/InviteDialog.kt | 8 +- .../chooseplatform/ChoosePlatformScreen.kt | 23 +- .../chat/revolt/screens/login/LoginScreen.kt | 3 +- .../chat/revolt/screens/login2/InitScreen.kt | 10 +- .../channel/ChannelSettingsOverview.kt | 5 +- .../java/chat/revolt/sheets/AddServerSheet.kt | 696 +++++++++--------- .../java/chat/revolt/sheets/EmoteInfoSheet.kt | 3 +- .../chat/revolt/sheets/MessageContextSheet.kt | 3 +- .../chat/revolt/sheets/ReactionInfoSheet.kt | 5 +- .../chat/revolt/sheets/ServerContextSheet.kt | 3 +- 44 files changed, 629 insertions(+), 513 deletions(-) create mode 100644 .idea/dictionaries/project.xml diff --git a/.idea/.name b/.idea/.name index 9ef16e6b..8a14fc66 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -PEP \ No newline at end of file +Revolt \ No newline at end of file diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml new file mode 100644 index 00000000..558059d9 --- /dev/null +++ b/.idea/dictionaries/project.xml @@ -0,0 +1,8 @@ + + + + kjbook + unreads + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 348bfb73..505e4872 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ -