From 1f1b6dab807622f245a473e2a5899ba737f19064 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 24 Sep 2026 15:23:59 +0000 Subject: [PATCH] refactor: share the UI settings and toasts, add LocalDisplaySettings, call LocalCache directly First steps of shrinking AccountViewModel (see the plan in the PR): - UiSettings (the settings enums), UiSettingsFlow and UiSettingsState move to commonsUI (they carry Compose StringResource labels, so not the headless commons). The app's global uiState is unchanged. - New LocalDisplaySettings (showProfilePictures, performance mode, autoPlayVideos, showUrlPreview, showImages, startVideoPlayback), collected from UiSettingsState by collectDisplaySettings() and provided by AmethystTheme, which also derives LocalAnimationsEnabled from it. UserAvatar's loadProfilePicture / loadRobohash / autoPlayGif default to it, so InnerUserPicture no longer reads them from the AccountViewModel and drops that parameter. - ToastManager and the toast message types move to commonsUI. The dialogs that render them stay in the app. - 128 accountViewModel.getNoteIfExists / checkGetOrCreate* / channel lookups in 59 files call LocalCache directly; the 13 AccountViewModel wrappers left without callers are deleted. - Baseline profile entries follow the moved classes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0168wY9t7i9NC5u3svyMxEz6 --- .../components/SelectNotificationProvider.kt | 2 +- .../baselineProfiles/baseline-prof.txt | 422 +++++++++--------- .../com/vitorpamplona/amethyst/AppModules.kt | 4 +- .../amethyst/LocalPreferences.kt | 2 +- .../amethyst/favorites/FavoriteAppLauncher.kt | 2 +- .../model/preferences/UISharedPreferences.kt | 20 +- .../amethyst/napplet/NappletLauncher.kt | 2 +- .../compose/RelayAuthComposeHelpers.kt | 5 +- .../compose/RelayAuthPromptHost.kt | 12 +- .../reqCommand/channel/ChannelObservers.kt | 3 +- .../amethyst/ui/actions/InformationDialog.kt | 4 +- .../ui/broadcast/DisplayBroadcastProgress.kt | 2 +- .../amethyst/ui/components/ClickableRoute.kt | 11 +- .../ui/components/ReusableZapButton.kt | 2 +- .../amethyst/ui/components/RichTextViewer.kt | 4 +- .../components/toasts/DisplayErrorMessages.kt | 13 +- .../components/toasts/multiline/ErrorList.kt | 2 + .../multiline/MultiUserErrorMessageDialog.kt | 1 + .../vitorpamplona/amethyst/ui/note/Loaders.kt | 17 +- .../amethyst/ui/note/ReactionsRow.kt | 2 +- .../amethyst/ui/note/UserProfilePicture.kt | 15 - .../amethyst/ui/note/ZapCustomDialog.kt | 2 +- .../amethyst/ui/note/ZapPollNote.kt | 2 +- .../note/elements/NoteHeaderMarkersPreview.kt | 2 +- .../nip22Comments/CommentPostViewModel.kt | 2 +- .../nip22Comments/GenericCommentPostScreen.kt | 7 +- .../amethyst/ui/note/types/Badge.kt | 4 +- .../amethyst/ui/note/types/Highlight.kt | 13 +- .../ui/note/types/RememberCaptionTracks.kt | 3 +- .../amethyst/ui/note/types/SoftwareApp.kt | 4 +- .../ui/note/types/TextModification.kt | 3 +- .../ui/screen/loggedIn/AccountViewModel.kt | 36 +- .../backups/BackupConflictEventViews.kt | 4 +- .../backups/BackupConflictListViews.kt | 3 +- .../badges/profile/ProfileBadgesScreen.kt | 4 +- .../loggedIn/chats/feed/DrawAuthorInfo.kt | 1 - .../feed/types/RenderBuzzSystemMessage.kt | 5 +- .../chats/geohashChat/LoadGeohashChannel.kt | 5 +- .../chats/marmotGroup/MarmotGroupChatView.kt | 3 +- .../marmotGroup/MarmotGroupListScreen.kt | 3 +- .../marmotGroup/MarmotSystemRowRenderer.kt | 3 +- .../loggedIn/chats/privateDM/ChatroomView.kt | 5 +- .../privateDM/send/ChatNewMessageViewModel.kt | 4 +- .../concord/ConcordChannelListScreen.kt | 2 +- .../concord/ConcordChannelScreen.kt | 2 +- .../concord/ConcordMembersScreen.kt | 3 +- .../ephemChat/EphemeralChatScreen.kt | 5 +- .../ephemChat/LoadEphemeralChatChannel.kt | 5 +- .../PublicChatChannelScreen.kt | 5 +- .../LiveActivityChannelScreen.kt | 5 +- .../header/LiveStreamTopZappers.kt | 5 +- .../relayGroup/BuzzTypingIndicator.kt | 3 +- .../relayGroup/LoadRelayGroupChannel.kt | 5 +- .../relayGroup/RelayGroupChannelListScreen.kt | 4 +- .../relayGroup/RelayGroupChatScreen.kt | 5 +- .../relayGroup/RelayGroupMembersScreen.kt | 3 +- .../relayGroup/RelayGroupParentPicker.kt | 8 +- .../relayGroup/RelayGroupPinnedBar.kt | 3 +- .../send/ChannelNewMessageViewModel.kt | 2 +- .../chats/rooms/ChatroomHeaderCompose.kt | 4 +- .../screen/loggedIn/chess/ChessGameScreen.kt | 5 +- .../screen/loggedIn/chess/ChessLobbyScreen.kt | 13 +- .../contactList/ContactListUsersScreen.kt | 3 +- .../nip23LongForm/LongFormPostScreen.kt | 5 +- .../nip99Classifieds/NewProductScreen.kt | 5 +- .../loggedIn/dvms/DvmHeartbeatObservation.kt | 5 +- .../loggedIn/embed/EmbeddedTabFactory.kt | 2 +- .../loggedIn/embed/EmbeddedTabThemeWatcher.kt | 2 +- .../loggedIn/geohash/GeoHashPostScreen.kt | 7 +- .../loggedIn/hashtag/HashtagPostScreen.kt | 7 +- .../highlights/NewHighlightPostViewModel.kt | 5 +- .../loggedIn/home/ShortNotePostScreen.kt | 13 +- .../loggedIn/home/ShortNotePostViewModel.kt | 4 +- .../loggedIn/home/VoiceReplyViewModel.kt | 3 +- .../room/chat/NestNewMessageViewModel.kt | 2 +- .../ParticipantHostActionsSheet.kt | 2 +- .../nests/room/screen/NestActionBar.kt | 2 +- .../ImportFollowListPickFollowsScreen.kt | 5 +- .../notifications/NotificationScreen.kt | 2 +- .../publicMessages/NewPublicMessageScreen.kt | 5 +- .../loggedIn/podcasts/PodcastAuthors.kt | 4 +- .../screen/loggedIn/polls/PollPostScreen.kt | 3 +- .../profile/header/badges/DisplayBadges.kt | 4 +- .../loggedIn/settings/AppSettingsScreen.kt | 16 +- .../settings/ComposeSettingsScreen.kt | 4 +- .../settings/HomeTabsSettingsScreen.kt | 2 +- .../settings/ProfileUiSettingsScreen.kt | 4 +- .../settings/SecurityFiltersScreen.kt | 4 +- .../ui/screen/loggedIn/url/UrlPostScreen.kt | 7 +- .../suggestion/DetectedWorkoutCarousel.kt | 2 +- .../vitorpamplona/amethyst/ui/theme/Theme.kt | 21 +- .../components/SelectNotificationProvider.kt | 2 +- .../amethyst/commons}/model/UiSettings.kt | 2 +- .../amethyst/commons}/model/UiSettingsFlow.kt | 2 +- .../commons/ui/components/UserAvatar.kt | 10 +- .../ui/components/toasts/ResourceToastMsg.kt | 2 +- .../ui/components/toasts/StringToastMsg.kt | 2 +- .../ui/components/toasts/ThrowableToastMsg.kt | 2 +- .../ui/components/toasts/ToastManager.kt | 6 +- .../commons}/ui/components/toasts/ToastMsg.kt | 2 +- .../toasts/multiline/MultiErrorToastMsg.kt | 4 +- .../commons/ui/screen/DisplaySettings.kt | 77 ++++ .../commons}/ui/screen/UiSettingsState.kt | 12 +- 103 files changed, 556 insertions(+), 469 deletions(-) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/model/UiSettings.kt (99%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/model/UiSettingsFlow.kt (99%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/ResourceToastMsg.kt (95%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/StringToastMsg.kt (95%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/ThrowableToastMsg.kt (95%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/ToastManager.kt (92%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/ToastMsg.kt (94%) rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/components/toasts/multiline/MultiErrorToastMsg.kt (92%) create mode 100644 commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/DisplaySettings.kt rename {amethyst/src/main/java/com/vitorpamplona/amethyst => commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons}/ui/screen/UiSettingsState.kt (94%) diff --git a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt index 78a6fcd112..114e9c5ee7 100644 --- a/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt +++ b/amethyst/src/fdroid/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt @@ -56,6 +56,7 @@ import com.halilibo.richtext.ui.material3.RichText import com.halilibo.richtext.ui.resolveDefaults import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.error_dialog_button_ok import com.vitorpamplona.amethyst.commons.resources.push_server_explainer @@ -71,7 +72,6 @@ import com.vitorpamplona.amethyst.commons.ui.components.SpinnerSelectionDialog import com.vitorpamplona.amethyst.commons.ui.components.TextSpinner import com.vitorpamplona.amethyst.commons.ui.components.TitleExplainer import com.vitorpamplona.amethyst.commons.ui.stringRes -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.service.notifications.PushDistributorHandler import com.vitorpamplona.amethyst.ui.screen.loggedIn.settings.SettingsBlockTile import com.vitorpamplona.quartz.utils.Log diff --git a/amethyst/src/main/generated/baselineProfiles/baseline-prof.txt b/amethyst/src/main/generated/baselineProfiles/baseline-prof.txt index 751cfbc406..a795224598 100644 --- a/amethyst/src/main/generated/baselineProfiles/baseline-prof.txt +++ b/amethyst/src/main/generated/baselineProfiles/baseline-prof.txt @@ -22282,7 +22282,7 @@ SPLcom/vitorpamplona/amethyst/AppModules;->getThumbnailDiskCache()Lcom/vitorpamp SPLcom/vitorpamplona/amethyst/AppModules;->getTorManager()Lcom/vitorpamplona/amethyst/ui/tor/TorManager; SPLcom/vitorpamplona/amethyst/AppModules;->getTorPrefs()Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences; SPLcom/vitorpamplona/amethyst/AppModules;->getUiPrefs()Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences; -SPLcom/vitorpamplona/amethyst/AppModules;->getUiState()Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState; +SPLcom/vitorpamplona/amethyst/AppModules;->getUiState()Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState; SPLcom/vitorpamplona/amethyst/AppModules;->getVideoCache()Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache; SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Z SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$1(Lcom/vitorpamplona/amethyst/AppModules;)Z @@ -22301,7 +22301,7 @@ SPLcom/vitorpamplona/amethyst/AppModules;->signerPermissionStore_delegate$lambda SPLcom/vitorpamplona/amethyst/AppModules;->thumbnailDiskCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/images/ThumbnailDiskCache; SPLcom/vitorpamplona/amethyst/AppModules;->torPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences; SPLcom/vitorpamplona/amethyst/AppModules;->uiPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences; -SPLcom/vitorpamplona/amethyst/AppModules;->uiState_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState; +SPLcom/vitorpamplona/amethyst/AppModules;->uiState_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState; SPLcom/vitorpamplona/amethyst/AppModules;->videoCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache; Lcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0; SPLcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0;->(Landroid/content/Context;)V @@ -23107,12 +23107,12 @@ Lcom/vitorpamplona/amethyst/favorites/FavoriteAppsRegistryKt; SPLcom/vitorpamplona/amethyst/favorites/FavoriteAppsRegistryKt;->()V SPLcom/vitorpamplona/amethyst/favorites/FavoriteAppsRegistryKt;->access$getFavoriteAppsDataStore(Landroid/content/Context;)Landroidx/datastore/core/DataStore; SPLcom/vitorpamplona/amethyst/favorites/FavoriteAppsRegistryKt;->getFavoriteAppsDataStore(Landroid/content/Context;)Landroidx/datastore/core/DataStore; -Lcom/vitorpamplona/amethyst/model/AccentColorType; -SPLcom/vitorpamplona/amethyst/model/AccentColorType;->$values()[Lcom/vitorpamplona/amethyst/model/AccentColorType; -SPLcom/vitorpamplona/amethyst/model/AccentColorType;->()V -SPLcom/vitorpamplona/amethyst/model/AccentColorType;->(Ljava/lang/String;III)V -SPLcom/vitorpamplona/amethyst/model/AccentColorType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/AccentColorType; -SPLcom/vitorpamplona/amethyst/model/AccentColorType;->values()[Lcom/vitorpamplona/amethyst/model/AccentColorType; +Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; +SPLcom/vitorpamplona/amethyst/commons/model/AccentColorType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; +SPLcom/vitorpamplona/amethyst/commons/model/AccentColorType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/AccentColorType;->(Ljava/lang/String;III)V +SPLcom/vitorpamplona/amethyst/commons/model/AccentColorType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; +SPLcom/vitorpamplona/amethyst/commons/model/AccentColorType;->values()[Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; Lcom/vitorpamplona/amethyst/model/Account; Lcom/vitorpamplona/amethyst/model/AccountSettings; Lcom/vitorpamplona/amethyst/model/AntiSpamFilter; @@ -23121,44 +23121,44 @@ SPLcom/vitorpamplona/amethyst/model/AntiSpamFilter;->()V Lcom/vitorpamplona/amethyst/model/AntiSpamState; SPLcom/vitorpamplona/amethyst/model/AntiSpamState;->()V SPLcom/vitorpamplona/amethyst/model/AntiSpamState;->(Lcom/vitorpamplona/amethyst/model/AntiSpamFilter;)V -Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/BooleanType;->$values()[Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/BooleanType;->()V -SPLcom/vitorpamplona/amethyst/model/BooleanType;->(Ljava/lang/String;ILjava/lang/Boolean;II)V -SPLcom/vitorpamplona/amethyst/model/BooleanType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/BooleanType;->values()[Lcom/vitorpamplona/amethyst/model/BooleanType; +Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/BooleanType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/BooleanType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/BooleanType;->(Ljava/lang/String;ILjava/lang/Boolean;II)V +SPLcom/vitorpamplona/amethyst/commons/model/BooleanType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/BooleanType;->values()[Lcom/vitorpamplona/amethyst/commons/model/BooleanType; Lcom/vitorpamplona/amethyst/model/CachePruner; SPLcom/vitorpamplona/amethyst/model/CachePruner;->()V SPLcom/vitorpamplona/amethyst/model/CachePruner;->(Lcom/vitorpamplona/amethyst/model/LocalCache;)V Lcom/vitorpamplona/amethyst/model/CacheSearch; SPLcom/vitorpamplona/amethyst/model/CacheSearch;->()V SPLcom/vitorpamplona/amethyst/model/CacheSearch;->(Lcom/vitorpamplona/amethyst/model/LocalCache;)V -Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/ConnectivityType;->$values()[Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/ConnectivityType;->()V -SPLcom/vitorpamplona/amethyst/model/ConnectivityType;->(Ljava/lang/String;ILjava/lang/Boolean;II)V -SPLcom/vitorpamplona/amethyst/model/ConnectivityType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/ConnectivityType;->values()[Lcom/vitorpamplona/amethyst/model/ConnectivityType; +Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/ConnectivityType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/ConnectivityType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/ConnectivityType;->(Ljava/lang/String;ILjava/lang/Boolean;II)V +SPLcom/vitorpamplona/amethyst/commons/model/ConnectivityType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/ConnectivityType;->values()[Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; Lcom/vitorpamplona/amethyst/model/Dao; -Lcom/vitorpamplona/amethyst/model/FeatureSetType; -SPLcom/vitorpamplona/amethyst/model/FeatureSetType;->$values()[Lcom/vitorpamplona/amethyst/model/FeatureSetType; -SPLcom/vitorpamplona/amethyst/model/FeatureSetType;->()V -SPLcom/vitorpamplona/amethyst/model/FeatureSetType;->(Ljava/lang/String;III)V -SPLcom/vitorpamplona/amethyst/model/FeatureSetType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/FeatureSetType; -SPLcom/vitorpamplona/amethyst/model/FeatureSetType;->values()[Lcom/vitorpamplona/amethyst/model/FeatureSetType; -Lcom/vitorpamplona/amethyst/model/FontFamilyType; -SPLcom/vitorpamplona/amethyst/model/FontFamilyType;->$values()[Lcom/vitorpamplona/amethyst/model/FontFamilyType; -SPLcom/vitorpamplona/amethyst/model/FontFamilyType;->()V -SPLcom/vitorpamplona/amethyst/model/FontFamilyType;->(Ljava/lang/String;III)V -SPLcom/vitorpamplona/amethyst/model/FontFamilyType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/FontFamilyType; -SPLcom/vitorpamplona/amethyst/model/FontFamilyType;->values()[Lcom/vitorpamplona/amethyst/model/FontFamilyType; -Lcom/vitorpamplona/amethyst/model/FontSizeType; -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->$values()[Lcom/vitorpamplona/amethyst/model/FontSizeType; -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->()V -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->(Ljava/lang/String;IFII)V -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->getScale()F -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/FontSizeType; -SPLcom/vitorpamplona/amethyst/model/FontSizeType;->values()[Lcom/vitorpamplona/amethyst/model/FontSizeType; +Lcom/vitorpamplona/amethyst/commons/model/FeatureSetType; +SPLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/FeatureSetType; +SPLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;->(Ljava/lang/String;III)V +SPLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/FeatureSetType; +SPLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;->values()[Lcom/vitorpamplona/amethyst/commons/model/FeatureSetType; +Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +SPLcom/vitorpamplona/amethyst/commons/model/FontFamilyType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +SPLcom/vitorpamplona/amethyst/commons/model/FontFamilyType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/FontFamilyType;->(Ljava/lang/String;III)V +SPLcom/vitorpamplona/amethyst/commons/model/FontFamilyType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +SPLcom/vitorpamplona/amethyst/commons/model/FontFamilyType;->values()[Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->(Ljava/lang/String;IFII)V +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->getScale()F +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; +SPLcom/vitorpamplona/amethyst/commons/model/FontSizeType;->values()[Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; Lcom/vitorpamplona/amethyst/model/ILocalCache; Lcom/vitorpamplona/amethyst/model/LocalCache; SPLcom/vitorpamplona/amethyst/model/LocalCache;->()V @@ -23187,119 +23187,119 @@ Lcom/vitorpamplona/amethyst/model/LocalCacheFlow; SPLcom/vitorpamplona/amethyst/model/LocalCacheFlow;->()V SPLcom/vitorpamplona/amethyst/model/LocalCacheFlow;->()V SPLcom/vitorpamplona/amethyst/model/LocalCacheFlow;->getNewEventBundles()Lkotlinx/coroutines/flow/SharedFlow; -Lcom/vitorpamplona/amethyst/model/ProfileGalleryType; -SPLcom/vitorpamplona/amethyst/model/ProfileGalleryType;->$values()[Lcom/vitorpamplona/amethyst/model/ProfileGalleryType; -SPLcom/vitorpamplona/amethyst/model/ProfileGalleryType;->()V -SPLcom/vitorpamplona/amethyst/model/ProfileGalleryType;->(Ljava/lang/String;III)V -SPLcom/vitorpamplona/amethyst/model/ProfileGalleryType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/ProfileGalleryType; -SPLcom/vitorpamplona/amethyst/model/ProfileGalleryType;->values()[Lcom/vitorpamplona/amethyst/model/ProfileGalleryType; -Lcom/vitorpamplona/amethyst/model/ThemeType; -SPLcom/vitorpamplona/amethyst/model/ThemeType;->$values()[Lcom/vitorpamplona/amethyst/model/ThemeType; -SPLcom/vitorpamplona/amethyst/model/ThemeType;->()V -SPLcom/vitorpamplona/amethyst/model/ThemeType;->(Ljava/lang/String;III)V -SPLcom/vitorpamplona/amethyst/model/ThemeType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/model/ThemeType; -SPLcom/vitorpamplona/amethyst/model/ThemeType;->values()[Lcom/vitorpamplona/amethyst/model/ThemeType; -Lcom/vitorpamplona/amethyst/model/UiSettings; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->()V -SPLcom/vitorpamplona/amethyst/model/UiSettings;->(Lcom/vitorpamplona/amethyst/model/ThemeType;Ljava/lang/String;Lcom/vitorpamplona/amethyst/model/ConnectivityType;Lcom/vitorpamplona/amethyst/model/ConnectivityType;Lcom/vitorpamplona/amethyst/model/BooleanType;Lcom/vitorpamplona/amethyst/model/ConnectivityType;Lcom/vitorpamplona/amethyst/model/BooleanType;Lcom/vitorpamplona/amethyst/model/ConnectivityType;ZZLcom/vitorpamplona/amethyst/model/FeatureSetType;Lcom/vitorpamplona/amethyst/model/ProfileGalleryType;Lcom/vitorpamplona/amethyst/model/BooleanType;Lcom/vitorpamplona/amethyst/model/BooleanType;Lcom/vitorpamplona/amethyst/model/BooleanType;ZZZZZZZZLcom/vitorpamplona/amethyst/model/BooleanType;Lcom/vitorpamplona/amethyst/model/AccentColorType;Lcom/vitorpamplona/amethyst/model/FontFamilyType;Lcom/vitorpamplona/amethyst/model/FontSizeType;Ljava/lang/String;Z)V -SPLcom/vitorpamplona/amethyst/model/UiSettings;->equals(Ljava/lang/Object;)Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAccentColor()Lcom/vitorpamplona/amethyst/model/AccentColorType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyCreateDrafts()Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyHideNavigationBars()Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyPlayVideos()Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyProposeAiImprovements()Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyShowImages()Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyShowProfilePictures()Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyShowUrlPreview()Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getAutomaticallyStartPlayback()Lcom/vitorpamplona/amethyst/model/ConnectivityType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getComposeSignature()Ljava/lang/String; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getDontAskForNotificationPermissions()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getDontShowOnchainPublicWarning()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getDontShowPushNotificationSelector()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getFeatureSet()Lcom/vitorpamplona/amethyst/model/FeatureSetType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getFontFamily()Lcom/vitorpamplona/amethyst/model/FontFamilyType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getFontSize()Lcom/vitorpamplona/amethyst/model/FontSizeType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getGallerySet()Lcom/vitorpamplona/amethyst/model/ProfileGalleryType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getPreferredLanguage()Ljava/lang/String; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowHomeConversationsTab()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowHomeEverythingTab()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowHomeNewThreadsTab()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowOnchainWallet()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowProfileAppRecommendations()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowProfileBadges()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowProfileFollowersFeed()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getShowProfileZapReceivedFeed()Z -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getSuggestWorkoutsFromHealthConnect()Lcom/vitorpamplona/amethyst/model/BooleanType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getTheme()Lcom/vitorpamplona/amethyst/model/ThemeType; -SPLcom/vitorpamplona/amethyst/model/UiSettings;->getUseTrackedBroadcasts()Lcom/vitorpamplona/amethyst/model/BooleanType; -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda0; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda0;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda1; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda1;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda10; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda10;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda11; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda11;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda12; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda12;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda13; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda13;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda14; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda14;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda15; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda15;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda2; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda2;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda3; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda3;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda4; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda4;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda5; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda5;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda6; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda6;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda7; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda7;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda8; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda8;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda9; -SPLcom/vitorpamplona/amethyst/model/UiSettings$$ExternalSyntheticLambda9;->()V -Lcom/vitorpamplona/amethyst/model/UiSettings$Companion; -SPLcom/vitorpamplona/amethyst/model/UiSettings$Companion;->()V -SPLcom/vitorpamplona/amethyst/model/UiSettings$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->()V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->(Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;)V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAccentColor()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAutomaticallyPlayVideos()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAutomaticallyShowImages()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAutomaticallyShowProfilePictures()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAutomaticallyShowUrlPreview()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getAutomaticallyStartPlayback()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getFontFamily()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getFontSize()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getPreferredLanguage()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getPropertyWatchFlow()Lkotlinx/coroutines/flow/Flow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->getTheme()Lkotlinx/coroutines/flow/MutableStateFlow; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow;->toSettings()Lcom/vitorpamplona/amethyst/model/UiSettings; -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$Companion; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$Companion;->()V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$Companion;->build(Lcom/vitorpamplona/amethyst/model/UiSettings;)Lcom/vitorpamplona/amethyst/model/UiSettingsFlow; -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1;->([Lkotlinx/coroutines/flow/Flow;)V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$1; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$1;->(Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1;Lkotlin/coroutines/Continuation;)V -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$2; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$2;->([Lkotlinx/coroutines/flow/Flow;)V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$2;->invoke()Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$2;->invoke()[Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$3; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$3;->(Lkotlin/coroutines/Continuation;)V -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$3;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$3;->invoke(Lkotlinx/coroutines/flow/FlowCollector;[Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/model/UiSettingsFlow$special$$inlined$combine$1$3;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType; +SPLcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType; +SPLcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;->(Ljava/lang/String;III)V +SPLcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType; +SPLcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;->values()[Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType; +Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +SPLcom/vitorpamplona/amethyst/commons/model/ThemeType;->$values()[Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +SPLcom/vitorpamplona/amethyst/commons/model/ThemeType;->()V +SPLcom/vitorpamplona/amethyst/commons/model/ThemeType;->(Ljava/lang/String;III)V +SPLcom/vitorpamplona/amethyst/commons/model/ThemeType;->valueOf(Ljava/lang/String;)Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +SPLcom/vitorpamplona/amethyst/commons/model/ThemeType;->values()[Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +Lcom/vitorpamplona/amethyst/commons/model/UiSettings; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->()V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->(Lcom/vitorpamplona/amethyst/commons/model/ThemeType;Ljava/lang/String;Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;Lcom/vitorpamplona/amethyst/commons/model/BooleanType;Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;Lcom/vitorpamplona/amethyst/commons/model/BooleanType;Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZZLcom/vitorpamplona/amethyst/commons/model/FeatureSetType;Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType;Lcom/vitorpamplona/amethyst/commons/model/BooleanType;Lcom/vitorpamplona/amethyst/commons/model/BooleanType;Lcom/vitorpamplona/amethyst/commons/model/BooleanType;ZZZZZZZZLcom/vitorpamplona/amethyst/commons/model/BooleanType;Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType;Lcom/vitorpamplona/amethyst/commons/model/FontSizeType;Ljava/lang/String;Z)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->equals(Ljava/lang/Object;)Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAccentColor()Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyCreateDrafts()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyHideNavigationBars()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyPlayVideos()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyProposeAiImprovements()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyShowImages()Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyShowProfilePictures()Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyShowUrlPreview()Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getAutomaticallyStartPlayback()Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getComposeSignature()Ljava/lang/String; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getDontAskForNotificationPermissions()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getDontShowOnchainPublicWarning()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getDontShowPushNotificationSelector()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getFeatureSet()Lcom/vitorpamplona/amethyst/commons/model/FeatureSetType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getFontFamily()Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getFontSize()Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getGallerySet()Lcom/vitorpamplona/amethyst/commons/model/ProfileGalleryType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getPreferredLanguage()Ljava/lang/String; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowHomeConversationsTab()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowHomeEverythingTab()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowHomeNewThreadsTab()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowOnchainWallet()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowProfileAppRecommendations()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowProfileBadges()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowProfileFollowersFeed()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getShowProfileZapReceivedFeed()Z +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getSuggestWorkoutsFromHealthConnect()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getTheme()Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings;->getUseTrackedBroadcasts()Lcom/vitorpamplona/amethyst/commons/model/BooleanType; +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda0; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda0;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda1; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda1;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda10; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda10;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda11; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda11;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda12; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda12;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda13; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda13;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda14; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda14;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda15; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda15;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda2; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda2;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda3; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda3;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda4; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda4;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda5; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda5;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda6; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda6;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda7; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda7;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda8; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda8;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda9; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$$ExternalSyntheticLambda9;->()V +Lcom/vitorpamplona/amethyst/commons/model/UiSettings$Companion; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$Companion;->()V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettings$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->()V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->(Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;Lkotlinx/coroutines/flow/MutableStateFlow;)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAccentColor()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAutomaticallyPlayVideos()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAutomaticallyShowImages()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAutomaticallyShowProfilePictures()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAutomaticallyShowUrlPreview()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getAutomaticallyStartPlayback()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getFontFamily()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getFontSize()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getPreferredLanguage()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getPropertyWatchFlow()Lkotlinx/coroutines/flow/Flow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->getTheme()Lkotlinx/coroutines/flow/MutableStateFlow; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;->toSettings()Lcom/vitorpamplona/amethyst/commons/model/UiSettings; +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$Companion; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$Companion;->()V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$Companion;->build(Lcom/vitorpamplona/amethyst/commons/model/UiSettings;)Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow; +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1;->([Lkotlinx/coroutines/flow/Flow;)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$1; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$1;->(Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1;Lkotlin/coroutines/Continuation;)V +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$2; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$2;->([Lkotlinx/coroutines/flow/Flow;)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$2;->invoke()Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$2;->invoke()[Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$3; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$3;->(Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$3;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$3;->invoke(Lkotlinx/coroutines/flow/FlowCollector;[Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow$special$$inlined$combine$1$3;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; Lcom/vitorpamplona/amethyst/model/accountsCache/AccountCacheState; SPLcom/vitorpamplona/amethyst/model/accountsCache/AccountCacheState;->()V SPLcom/vitorpamplona/amethyst/model/accountsCache/AccountCacheState;->(Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lcom/vitorpamplona/amethyst/model/LocalCache;Lcom/vitorpamplona/quartz/nip01Core/relay/client/INostrClient;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lcom/vitorpamplona/amethyst/commons/connectedApps/signers/NostrSignerPermissionStore;Lcom/vitorpamplona/amethyst/commons/connectedApps/nip46/Nip46ClientStore;)V @@ -23460,7 +23460,7 @@ SPLcom/vitorpamplona/amethyst/model/preferences/UISharedPreferencesKt;-> SPLcom/vitorpamplona/amethyst/model/preferences/UISharedPreferencesKt;->getSharedPreferencesDataStore(Landroid/content/Context;)Landroidx/datastore/core/DataStore; Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->()V -SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->(Lcom/vitorpamplona/amethyst/model/UiSettings;Landroid/content/Context;Lkotlinx/coroutines/CoroutineScope;)V +SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->(Lcom/vitorpamplona/amethyst/commons/model/UiSettings;Landroid/content/Context;Lkotlinx/coroutines/CoroutineScope;)V SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->access$applyLanguage(Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->access$getUI_ACCENT_COLOR$cp()Landroidx/datastore/preferences/core/Preferences$Key; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->access$getUI_AUTOMATICALLY_CREATE_DRAFTS$cp()Landroidx/datastore/preferences/core/Preferences$Key; @@ -23493,7 +23493,7 @@ SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->access$get SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->access$getUI_USE_TRACKED_BROADCASTS$cp()Landroidx/datastore/preferences/core/Preferences$Key; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->applyLanguage(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->getContext()Landroid/content/Context; -SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->getValue()Lcom/vitorpamplona/amethyst/model/UiSettingsFlow; +SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;->getValue()Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow; Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->()V SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->(Lkotlin/jvm/internal/DefaultConstructorMarker;)V @@ -23526,13 +23526,13 @@ SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;-> SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->getUI_SUGGEST_WORKOUTS_FROM_HEALTH_CONNECT()Landroidx/datastore/preferences/core/Preferences$Key; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->getUI_THEME()Landroidx/datastore/preferences/core/Preferences$Key; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->getUI_USE_TRACKED_BROADCASTS()Landroidx/datastore/preferences/core/Preferences$Key; -SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->save(Lcom/vitorpamplona/amethyst/model/UiSettings;Landroid/content/Context;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->save(Lcom/vitorpamplona/amethyst/commons/model/UiSettings;Landroid/content/Context;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;->uiPreferences(Landroid/content/Context;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$1; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$1;->(Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion;Lkotlin/coroutines/Continuation;)V SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2; -SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2;->(Lcom/vitorpamplona/amethyst/model/UiSettings;Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2;->(Lcom/vitorpamplona/amethyst/commons/model/UiSettings;Lkotlin/coroutines/Continuation;)V SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2;->create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2;->invoke(Landroidx/datastore/preferences/core/MutablePreferences;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$Companion$save$2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; @@ -23549,7 +23549,7 @@ SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$languageUpda Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->(Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;Lkotlin/coroutines/Continuation;)V SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->create(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; -SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->invoke(Lcom/vitorpamplona/amethyst/model/UiSettings;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/UiSettings;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; SPLcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences$saving$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; Lcom/vitorpamplona/amethyst/model/privacyOptions/IRoleBasedHttpClientBuilder; @@ -24832,49 +24832,49 @@ SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt;->l Lcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0; SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;->()V SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState;->()V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState;->(Lcom/vitorpamplona/amethyst/model/UiSettingsFlow;Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$WhenMappings; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$WhenMappings;->()V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1;->(Lkotlin/coroutines/Continuation;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1;->invoke(Lcom/vitorpamplona/amethyst/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1$WhenMappings; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showImages$1$WhenMappings;->()V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1;->(Lkotlin/coroutines/Continuation;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Lcom/vitorpamplona/amethyst/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings;->()V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1;->(Lkotlin/coroutines/Continuation;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Lcom/vitorpamplona/amethyst/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings;->()V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1;->(Lkotlinx/coroutines/flow/Flow;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$1;->(Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1;Lkotlin/coroutines/Continuation;)V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2;->(Lkotlinx/coroutines/flow/FlowCollector;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2$1;->(Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1;->(Lkotlin/coroutines/Continuation;)V -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Lcom/vitorpamplona/amethyst/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; -Lcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings; -SPLcom/vitorpamplona/amethyst/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings;->()V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;->()V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;->(Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$WhenMappings; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$WhenMappings;->()V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->(Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1$WhenMappings; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1$WhenMappings;->()V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->(Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings;->()V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->(Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings;->()V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;->(Lkotlinx/coroutines/flow/Flow;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$1;->(Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;Lkotlin/coroutines/Continuation;)V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;->(Lkotlinx/coroutines/flow/FlowCollector;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2$1;->(Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->(Lkotlin/coroutines/Continuation;)V +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object; +Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings; +SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings;->()V Lcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler; SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;->()V SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;->(Lcom/vitorpamplona/quartz/nip01Core/relay/client/INostrClient;)V @@ -25638,23 +25638,23 @@ Lcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->$r8$lambda$7JAdMf4levt4F3mr6nvsppu__xY(Landroidx/compose/ui/unit/Density;Landroidx/compose/ui/text/font/FontFamily;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)Lkotlin/Unit; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->$r8$lambda$GsT95FSXMVwriWjqAt3KW-oAPpo(Landroid/view/View;ZLandroidx/compose/material3/ColorScheme;)Lkotlin/Unit; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->()V -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$0(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/model/ThemeType; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$1(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/model/AccentColorType; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$0(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/commons/model/ThemeType; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$1(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/commons/model/AccentColorType; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$10$0(Landroid/view/View;ZLandroidx/compose/material3/ColorScheme;)Lkotlin/Unit; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$2(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/model/FontFamilyType; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$3(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/model/FontSizeType; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$2(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$3(Landroidx/compose/runtime/State;)Lcom/vitorpamplona/amethyst/commons/model/FontSizeType; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$9$0(Landroidx/compose/ui/unit/Density;Landroidx/compose/ui/text/font/FontFamily;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)Lkotlin/Unit; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme$lambda$9(Landroidx/compose/ui/unit/Density;Landroidx/compose/ui/text/font/FontFamily;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)Lkotlin/Unit; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme(Lcom/vitorpamplona/amethyst/model/ThemeType;Lcom/vitorpamplona/amethyst/model/AccentColorType;Lcom/vitorpamplona/amethyst/model/FontFamilyType;Lcom/vitorpamplona/amethyst/model/FontSizeType;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme(Lcom/vitorpamplona/amethyst/commons/model/ThemeType;Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType;Lcom/vitorpamplona/amethyst/commons/model/FontSizeType;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;II)V SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->AmethystTheme(Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->accentContainer-DxMtmZc(JZ)J -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->accentPrimary(Lcom/vitorpamplona/amethyst/model/AccentColorType;Z)J -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->accentSecondary(Lcom/vitorpamplona/amethyst/model/AccentColorType;Z)J -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->darkColors(Lcom/vitorpamplona/amethyst/model/AccentColorType;)Landroidx/compose/material3/ColorScheme; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->accentPrimary(Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;Z)J +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->accentSecondary(Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;Z)J +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->darkColors(Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;)Landroidx/compose/material3/ColorScheme; SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->getPlaceholderText(Landroidx/compose/material3/ColorScheme;)J SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->getTransparentBackground(Landroidx/compose/material3/ColorScheme;)J SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->isLight(Landroidx/compose/material3/ColorScheme;)Z -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->lightColors(Lcom/vitorpamplona/amethyst/model/AccentColorType;)Landroidx/compose/material3/ColorScheme; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->lightColors(Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;)Landroidx/compose/material3/ColorScheme; SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->onAccent-8_81llA(J)J SPLcom/vitorpamplona/amethyst/commons/ui/theme/AmethystColorSchemeKt;->onAccentContainer-DxMtmZc(JZ)J Lcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda0; @@ -25669,7 +25669,7 @@ Lcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda3; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda3;->(Landroid/view/View;ZLandroidx/compose/material3/ColorScheme;)V SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda3;->invoke()Ljava/lang/Object; Lcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda4; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda4;->(Lcom/vitorpamplona/amethyst/model/ThemeType;Lcom/vitorpamplona/amethyst/model/AccentColorType;Lcom/vitorpamplona/amethyst/model/FontFamilyType;Lcom/vitorpamplona/amethyst/model/FontSizeType;Lkotlin/jvm/functions/Function2;II)V +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$$ExternalSyntheticLambda4;->(Lcom/vitorpamplona/amethyst/commons/model/ThemeType;Lcom/vitorpamplona/amethyst/commons/model/AccentColorType;Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType;Lcom/vitorpamplona/amethyst/commons/model/FontSizeType;Lkotlin/jvm/functions/Function2;II)V Lcom/vitorpamplona/amethyst/ui/theme/ThemeKt$MarkDownStyleOnDark$1; SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$MarkDownStyleOnDark$1;->()V SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt$MarkDownStyleOnDark$1;->()V @@ -25685,7 +25685,7 @@ SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt;->getDefaultParagraphSpaci SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt;->getFont14SP()J SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt;->getFont17SP()J SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt;->getTypography()Landroidx/compose/material3/Typography; -SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->toFontFamily(Lcom/vitorpamplona/amethyst/model/FontFamilyType;)Landroidx/compose/ui/text/font/FontFamily; +SPLcom/vitorpamplona/amethyst/ui/theme/ThemeKt;->toFontFamily(Lcom/vitorpamplona/amethyst/commons/model/FontFamilyType;)Landroidx/compose/ui/text/font/FontFamily; SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt;->withFontFamily(Landroidx/compose/material3/Typography;Landroidx/compose/ui/text/font/FontFamily;)Landroidx/compose/material3/Typography; Lcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt$$ExternalSyntheticLambda0; SPLcom/vitorpamplona/amethyst/commons/ui/theme/TypeKt$$ExternalSyntheticLambda0;->()V diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt index 00a7fba7f3..23a19447e3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt @@ -28,6 +28,7 @@ import androidx.security.crypto.EncryptedSharedPreferences import coil3.disk.DiskCache import coil3.memory.MemoryCache import com.vitorpamplona.amethyst.commons.model.NoteState +import com.vitorpamplona.amethyst.commons.model.UiSettings import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip03Timestamp.BitcoinExplorerEndpoint import com.vitorpamplona.amethyst.commons.model.nip03Timestamp.IncomingOtsEventVerifier @@ -56,10 +57,10 @@ import com.vitorpamplona.amethyst.commons.service.lnurl.OkHttpLnurlEndpointResol import com.vitorpamplona.amethyst.commons.service.pow.PoWPolicy import com.vitorpamplona.amethyst.commons.service.pow.PoWPublishQueue import com.vitorpamplona.amethyst.commons.tor.TorSettings +import com.vitorpamplona.amethyst.commons.ui.screen.UiSettingsState import com.vitorpamplona.amethyst.connectedApps.DataStoreNostrSignerPermissionStore import com.vitorpamplona.amethyst.connectedApps.nip46.DataStoreNip46ClientStore import com.vitorpamplona.amethyst.model.Account -import com.vitorpamplona.amethyst.model.UiSettings import com.vitorpamplona.amethyst.model.accountsCache.AccountCacheState import com.vitorpamplona.amethyst.model.nip11RelayInfo.Nip11CachedRetriever import com.vitorpamplona.amethyst.model.preferences.BuzzAttestationPreferences @@ -132,7 +133,6 @@ import com.vitorpamplona.amethyst.service.uploads.nip95.Nip95CacheFactory import com.vitorpamplona.amethyst.ui.resourceCacheInit import com.vitorpamplona.amethyst.ui.screen.AccountSessionManager import com.vitorpamplona.amethyst.ui.screen.AccountState -import com.vitorpamplona.amethyst.ui.screen.UiSettingsState import com.vitorpamplona.amethyst.ui.tor.TorManager import com.vitorpamplona.amethyst.ui.tor.TorService import com.vitorpamplona.quartz.nip01Core.core.Address diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt index a76ebb2365..a0acb8bad9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/LocalPreferences.kt @@ -26,6 +26,7 @@ import android.content.SharedPreferences import androidx.compose.runtime.Immutable import androidx.core.content.edit import com.vitorpamplona.amethyst.commons.model.HomeFeedType +import com.vitorpamplona.amethyst.commons.model.UiSettings import com.vitorpamplona.amethyst.commons.model.chats.ChatFeedType import com.vitorpamplona.amethyst.commons.model.clink.ClinkDebitWalletEntry import com.vitorpamplona.amethyst.commons.model.concord.ConcordViewMode @@ -37,7 +38,6 @@ import com.vitorpamplona.amethyst.commons.model.nip47WalletConnect.NwcWalletEntr import com.vitorpamplona.amethyst.commons.model.topNavFeeds.TopFilter import com.vitorpamplona.amethyst.commons.relayauth.RelayAuthPolicy import com.vitorpamplona.amethyst.model.AccountSettings -import com.vitorpamplona.amethyst.model.UiSettings import com.vitorpamplona.amethyst.model.backups.BackupConflictStorage import com.vitorpamplona.amethyst.model.nip60Cashu.CashuPreferences import com.vitorpamplona.amethyst.service.checkNotInMainThread diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/favorites/FavoriteAppLauncher.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/favorites/FavoriteAppLauncher.kt index e4029c8627..cd6fb36b17 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/favorites/FavoriteAppLauncher.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/favorites/FavoriteAppLauncher.kt @@ -27,8 +27,8 @@ import android.os.Bundle import android.widget.Toast import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.favorites.FavoriteApp +import com.vitorpamplona.amethyst.commons.model.ThemeType import com.vitorpamplona.amethyst.commons.model.cache.LocalCache -import com.vitorpamplona.amethyst.model.ThemeType import com.vitorpamplona.amethyst.napplet.NappletLauncher import com.vitorpamplona.amethyst.napplet.NappletWebViewProfiles import com.vitorpamplona.amethyst.napplet.WebAppNetworkRegistry diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt index 5909a5a3a7..78239e6911 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/preferences/UISharedPreferences.kt @@ -34,16 +34,16 @@ import androidx.datastore.preferences.core.edit import androidx.datastore.preferences.core.stringPreferencesKey import androidx.datastore.preferences.preferencesDataStore import com.vitorpamplona.amethyst.LocalPreferences -import com.vitorpamplona.amethyst.model.AccentColorType -import com.vitorpamplona.amethyst.model.BooleanType -import com.vitorpamplona.amethyst.model.ConnectivityType -import com.vitorpamplona.amethyst.model.FeatureSetType -import com.vitorpamplona.amethyst.model.FontFamilyType -import com.vitorpamplona.amethyst.model.FontSizeType -import com.vitorpamplona.amethyst.model.ProfileGalleryType -import com.vitorpamplona.amethyst.model.ThemeType -import com.vitorpamplona.amethyst.model.UiSettings -import com.vitorpamplona.amethyst.model.UiSettingsFlow +import com.vitorpamplona.amethyst.commons.model.AccentColorType +import com.vitorpamplona.amethyst.commons.model.BooleanType +import com.vitorpamplona.amethyst.commons.model.ConnectivityType +import com.vitorpamplona.amethyst.commons.model.FeatureSetType +import com.vitorpamplona.amethyst.commons.model.FontFamilyType +import com.vitorpamplona.amethyst.commons.model.FontSizeType +import com.vitorpamplona.amethyst.commons.model.ProfileGalleryType +import com.vitorpamplona.amethyst.commons.model.ThemeType +import com.vitorpamplona.amethyst.commons.model.UiSettings +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.quartz.utils.Log import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/napplet/NappletLauncher.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/napplet/NappletLauncher.kt index 382242d133..e4619c6624 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/napplet/NappletLauncher.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/napplet/NappletLauncher.kt @@ -25,10 +25,10 @@ import android.content.Intent import android.content.res.Configuration import android.os.Bundle import com.vitorpamplona.amethyst.Amethyst +import com.vitorpamplona.amethyst.commons.model.ThemeType import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.napplet.NappletArtifactPolicy import com.vitorpamplona.amethyst.commons.napplet.NappletIdentity -import com.vitorpamplona.amethyst.model.ThemeType import com.vitorpamplona.amethyst.napplethost.HostProfile import com.vitorpamplona.amethyst.napplethost.NappletHostActivity import com.vitorpamplona.amethyst.napplethost.NappletHostContract diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthComposeHelpers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthComposeHelpers.kt index eed6bfebf5..6866ab49f0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthComposeHelpers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthComposeHelpers.kt @@ -27,6 +27,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.relayauth.AuthPurposeKind import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_my_inbox @@ -53,9 +54,9 @@ internal fun LoadRelayAuthUser( accountViewModel: AccountViewModel, content: @Composable (User?) -> Unit, ) { - var user by remember(pubkey) { mutableStateOf(accountViewModel.getUserIfExists(pubkey)) } + var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) } if (user == null) { - LaunchedEffect(pubkey) { user = accountViewModel.checkGetOrCreateUser(pubkey) } + LaunchedEffect(pubkey) { user = LocalCache.checkGetOrCreateUser(pubkey) } } content(user) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt index 4a09f6706a..abd3b5015f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt @@ -602,9 +602,9 @@ private fun rememberCounterpartyName( pubkey: HexKey, accountViewModel: AccountViewModel, ): String { - var user by remember(pubkey) { mutableStateOf(accountViewModel.getUserIfExists(pubkey)) } + var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) } if (user == null) { - LaunchedEffect(pubkey) { user = accountViewModel.checkGetOrCreateUser(pubkey) } + LaunchedEffect(pubkey) { user = LocalCache.checkGetOrCreateUser(pubkey) } } val loaded = user ?: return stringRes(Res.string.relay_auth_someone_unloaded) val metadata by observeUserInfo(loaded, accountViewModel) @@ -649,11 +649,11 @@ private fun rememberVenueLabel( ?: when { venueId.length == 64 -> if (kind == AuthPurposeKind.POST_VENUE) { - accountViewModel.checkGetOrCreatePublicChatChannel(venueId) + LocalCache.getOrCreatePublicChatChannel(venueId) } else { LocalCache.getPublicChatChannelIfExists(venueId) } - venueId.startsWith("30311:") -> Address.parse(venueId)?.let { accountViewModel.checkGetOrCreateLiveActivityChannel(it) } + venueId.startsWith("30311:") -> Address.parse(venueId)?.let { LocalCache.getOrCreateLiveChannel(it) } else -> null } } @@ -702,9 +702,9 @@ private fun rememberDisplayName( pubkey: HexKey, accountViewModel: AccountViewModel, ): String { - var user by remember(pubkey) { mutableStateOf(accountViewModel.getUserIfExists(pubkey)) } + var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) } if (user == null) { - LaunchedEffect(pubkey) { user = accountViewModel.checkGetOrCreateUser(pubkey) } + LaunchedEffect(pubkey) { user = LocalCache.checkGetOrCreateUser(pubkey) } } val loaded = user ?: return stringRes(Res.string.relay_auth_someone_unloaded) // Reading the observed metadata registers a snapshot read, so the name updates when it arrives. diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/channel/ChannelObservers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/channel/ChannelObservers.kt index 17bbf1e846..d83de98e94 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/channel/ChannelObservers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/reqCommand/channel/ChannelObservers.kt @@ -27,6 +27,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.model.Channel import com.vitorpamplona.amethyst.commons.model.ChannelState import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip28PublicChats.PublicChatChannel import com.vitorpamplona.amethyst.commons.model.nip53LiveActivities.LiveActivitiesChannel import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -102,7 +103,7 @@ private fun channelToParticipatingUsers( val pKeys = channel.info?.participantKeys() ?: emptyList() pKeys.forEach { - val u = accountViewModel.checkGetOrCreateUser(it) + val u = LocalCache.checkGetOrCreateUser(it) if (u != null) { users.add(u) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/InformationDialog.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/InformationDialog.kt index ed22a29806..32e9e00590 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/InformationDialog.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/actions/InformationDialog.kt @@ -45,12 +45,12 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.copy_stack_to_clipboard import com.vitorpamplona.amethyst.commons.resources.error_dialog_button_ok +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ThrowableToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ThrowableToastMsg2 import com.vitorpamplona.amethyst.commons.ui.components.util.setText import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.Size16dp import com.vitorpamplona.amethyst.commons.ui.theme.StdHorzSpacer -import com.vitorpamplona.amethyst.ui.components.toasts.ThrowableToastMsg -import com.vitorpamplona.amethyst.ui.components.toasts.ThrowableToastMsg2 import kotlinx.coroutines.launch import java.io.PrintWriter import java.io.StringWriter diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/broadcast/DisplayBroadcastProgress.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/broadcast/DisplayBroadcastProgress.kt index 44773b05a0..1c9c1f1772 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/broadcast/DisplayBroadcastProgress.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/broadcast/DisplayBroadcastProgress.kt @@ -38,9 +38,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.Amethyst +import com.vitorpamplona.amethyst.commons.model.BooleanType import com.vitorpamplona.amethyst.commons.service.broadcast.BroadcastEvent import com.vitorpamplona.amethyst.commons.service.pow.PoWJobState -import com.vitorpamplona.amethyst.model.BooleanType import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.quartz.nip01Core.relay.normalizer.NormalizedRelayUrl import kotlinx.collections.immutable.ImmutableList diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt index 588e74c2ed..99a3042771 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ClickableRoute.kt @@ -43,6 +43,7 @@ import com.vitorpamplona.amethyst.commons.model.EmptyTagList import com.vitorpamplona.amethyst.commons.model.ImmutableListOfLists import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.navigation.routeFor import com.vitorpamplona.amethyst.commons.resources.Res @@ -101,7 +102,7 @@ fun LoadOrCreateNote( content: @Composable (Note?) -> Unit, ) { var note by - remember(event.id) { mutableStateOf(accountViewModel.getNoteIfExists(event.id)) } + remember(event.id) { mutableStateOf(LocalCache.getNoteIfExists(event.id)) } if (note == null) { LaunchedEffect(key1 = event.id) { @@ -224,11 +225,11 @@ private fun DisplayAddress( return } - var noteBase by remember(nip19) { mutableStateOf(accountViewModel.getNoteIfExists(nip19.aTag())) } + var noteBase by remember(nip19) { mutableStateOf(LocalCache.getNoteIfExists(nip19.aTag())) } if (noteBase == null) { LaunchedEffect(key1 = nip19) { - noteBase = accountViewModel.getOrCreateAddressableNote(nip19.address()) + noteBase = LocalCache.getOrCreateAddressableNote(nip19.address()) } } @@ -271,13 +272,13 @@ fun DisplayUser( var userBase by remember(userHex) { mutableStateOf( - accountViewModel.getUserIfExists(userHex), + LocalCache.getUserIfExists(userHex), ) } if (userBase == null) { LaunchedEffect(key1 = userHex) { - userBase = accountViewModel.checkGetOrCreateUser(userHex) + userBase = LocalCache.checkGetOrCreateUser(userHex) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt index 5e801b6926..ca7a265089 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ReusableZapButton.kt @@ -57,6 +57,7 @@ import com.vitorpamplona.amethyst.commons.resources.no_wallet_found import com.vitorpamplona.amethyst.commons.resources.no_zap_amount_setup_long_press_to_change import com.vitorpamplona.amethyst.commons.resources.thank_you import com.vitorpamplona.amethyst.commons.ui.components.CrossfadeIfEnabled +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.note.ZapIcon import com.vitorpamplona.amethyst.commons.ui.note.ZappedIcon @@ -67,7 +68,6 @@ import com.vitorpamplona.amethyst.commons.ui.theme.Size20Modifier import com.vitorpamplona.amethyst.commons.ui.theme.Size35dp import com.vitorpamplona.amethyst.service.ZapPaymentHandler import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.UserFinderFilterAssemblerSubscription -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.ui.note.ObserveZapIcon import com.vitorpamplona.amethyst.ui.note.ZapAmountChoicePopup import com.vitorpamplona.amethyst.ui.note.payViaIntent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt index cec01b06fc..8e08b17b2c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/RichTextViewer.kt @@ -883,11 +883,11 @@ fun LoadNote( content: @Composable (Note?) -> Unit, ) { var note by - remember(baseNoteHex) { mutableStateOf(accountViewModel.getNoteIfExists(baseNoteHex)) } + remember(baseNoteHex) { mutableStateOf(LocalCache.getNoteIfExists(baseNoteHex)) } if (note == null) { LaunchedEffect(key1 = baseNoteHex) { - note = accountViewModel.checkGetOrCreateNote(baseNoteHex) + note = LocalCache.checkGetOrCreateNote(baseNoteHex) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/DisplayErrorMessages.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/DisplayErrorMessages.kt index 42a28631a6..399c6687e1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/DisplayErrorMessages.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/DisplayErrorMessages.kt @@ -22,10 +22,16 @@ package com.vitorpamplona.amethyst.ui.components.toasts import androidx.compose.runtime.Composable import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ActionableStringToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ResourceToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.StringToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ThrowableToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ThrowableToastMsg2 +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ToastManager +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.MultiErrorToastMsg import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.ui.actions.InformationDialog -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.MultiErrorToastMsg import com.vitorpamplona.amethyst.ui.components.toasts.multiline.MultiUserErrorMessageDialog import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -40,10 +46,11 @@ fun DisplayErrorMessages( openDialogMsg.value?.let { obj -> when (obj) { is ResourceToastMsg -> { - if (obj.params != null) { + val params = obj.params + if (params != null) { InformationDialog( stringRes(obj.titleResId), - stringRes(obj.resourceId, *obj.params), + stringRes(obj.resourceId, *params), ) { toastManager.clearToasts() } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/ErrorList.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/ErrorList.kt index b0e8d24ccd..8eebdce932 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/ErrorList.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/ErrorList.kt @@ -48,6 +48,8 @@ import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.error_dialog_talk_to_user import com.vitorpamplona.amethyst.commons.resources.error_dialog_talk_to_user_name import com.vitorpamplona.amethyst.commons.resources.error_dialog_zap_error +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.MultiErrorToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiUserErrorMessageDialog.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiUserErrorMessageDialog.kt index a681d82254..0777b48775 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiUserErrorMessageDialog.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiUserErrorMessageDialog.kt @@ -34,6 +34,7 @@ import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.error_dialog_button_ok import com.vitorpamplona.amethyst.commons.resources.error_dialog_zap_error +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.MultiErrorToastMsg import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/Loaders.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/Loaders.kt index 7a6fbdc5dd..a5cda72e5e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/Loaders.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/Loaders.kt @@ -34,6 +34,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel import com.vitorpamplona.amethyst.commons.model.nip03Timestamp.earliestOtsVerifiedTime import com.vitorpamplona.amethyst.commons.model.nip28PublicChats.PublicChatChannel @@ -95,10 +96,10 @@ fun LoadAddressableNote( content: @Composable (AddressableNote?) -> Unit, ) { val note by produceState( - accountViewModel.getAddressableNoteIfExists(address), + LocalCache.getAddressableNoteIfExists(address), address, ) { - val newNote = accountViewModel.getOrCreateAddressableNote(address) + val newNote = LocalCache.getOrCreateAddressableNote(address) if (newNote != value) { value = newNote } @@ -152,8 +153,8 @@ fun LoadPublicChatChannel( accountViewModel: AccountViewModel, content: @Composable (PublicChatChannel) -> Unit, ) { - val channel by produceStateIfNotNull(accountViewModel.getPublicChatChannelIfExists(id), id) { - value = accountViewModel.checkGetOrCreatePublicChatChannel(id) + val channel by produceStateIfNotNull(LocalCache.getPublicChatChannelIfExists(id), id) { + value = LocalCache.getOrCreatePublicChatChannel(id) } channel?.let { content(it) } @@ -166,8 +167,8 @@ fun LoadEphemeralChatChannel( content: @Composable (EphemeralChatChannel) -> Unit, ) { val channel = - produceStateIfNotNull(accountViewModel.getEphemeralChatChannelIfExists(id), id) { - value = accountViewModel.checkGetOrCreateEphemeralChatChannel(id) + produceStateIfNotNull(LocalCache.getEphemeralChatChannelIfExists(id), id) { + value = LocalCache.getOrCreateEphemeralChannel(id) } channel.value?.let { content(it) } @@ -180,8 +181,8 @@ fun LoadLiveActivityChannel( content: @Composable (LiveActivitiesChannel) -> Unit, ) { val channel = - produceStateIfNotNull(accountViewModel.getLiveActivityChannelIfExists(id), id) { - value = accountViewModel.checkGetOrCreateLiveActivityChannel(id) + produceStateIfNotNull(LocalCache.getLiveActivityChannelIfExists(id), id) { + value = LocalCache.getOrCreateLiveChannel(id) } channel.value?.let { content(it) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt index 21e93147f4..14cf7f0cf5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ReactionsRow.kt @@ -154,6 +154,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.AnimatedBorderTextCorner import com.vitorpamplona.amethyst.commons.ui.components.ClickableBox import com.vitorpamplona.amethyst.commons.ui.components.CrossfadeIfEnabled import com.vitorpamplona.amethyst.commons.ui.components.GenericLoadable +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.components.util.setText import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.note.ChangeReactionIcon @@ -228,7 +229,6 @@ import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUse import com.vitorpamplona.amethyst.ui.actions.uploads.FloatingRecordingIndicator import com.vitorpamplona.amethyst.ui.actions.uploads.MAX_VOICE_RECORD_SECONDS import com.vitorpamplona.amethyst.ui.actions.uploads.RecordAudioBox -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.ui.navigation.routes.routeReplyTo import com.vitorpamplona.amethyst.ui.note.elements.ShareOptionsBottomSheet import com.vitorpamplona.amethyst.ui.note.types.EditState diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt index f2aeb65dba..c081bb1e93 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/UserProfilePicture.kt @@ -370,7 +370,6 @@ fun BaseUserPicture( userName = userName, size = size, modifier = innerModifier, - accountViewModel = accountViewModel, ) } @@ -405,7 +404,6 @@ fun BaseUserPicture( userName = null, size = size, modifier = innerModifier, - accountViewModel = accountViewModel, ) } } @@ -433,7 +431,6 @@ fun ObserveAndDrawInnerUserPicture( userName = userProfile?.info?.bestName(), size = size, modifier = innerModifier, - accountViewModel = accountViewModel, ) } @@ -455,7 +452,6 @@ fun ScoreTag55Preview() { userName = PREVIEW_USER_NAME, size = size, modifier = Modifier, - accountViewModel = accountViewModel, ) FollowingIcon(Modifier.size(size.div(3.5f))) ScoreTag(100, size, Modifier.align(Alignment.BottomCenter)) @@ -468,7 +464,6 @@ fun ScoreTag55Preview() { userName = PREVIEW_USER_NAME, size = size, modifier = Modifier, - accountViewModel = accountViewModel, ) FollowingIcon(Modifier.size(size.div(3.5f))) ScoreTag(100, size, Modifier.align(Alignment.BottomCenter)) @@ -481,7 +476,6 @@ fun ScoreTag55Preview() { userName = PREVIEW_USER_NAME, size = size, modifier = Modifier, - accountViewModel = accountViewModel, ) FollowingIcon(Modifier.size(size.div(3.5f))) ScoreTag(100, size, Modifier.align(Alignment.BottomCenter)) @@ -494,7 +488,6 @@ fun ScoreTag55Preview() { userName = PREVIEW_USER_NAME, size = size, modifier = Modifier, - accountViewModel = accountViewModel, ) FollowingIcon(Modifier.size(size.div(3.5f))) ScoreTag(100, size, Modifier.align(Alignment.BottomCenter)) @@ -507,7 +500,6 @@ fun ScoreTag55Preview() { userName = PREVIEW_USER_NAME, size = size, modifier = Modifier, - accountViewModel = accountViewModel, ) FollowingIcon(Modifier.size(size.div(3.5f))) ScoreTag(100, size, Modifier.align(Alignment.BottomCenter)) @@ -534,7 +526,6 @@ fun InnerUserPicture( userName: String?, size: Dp, modifier: Modifier, - accountViewModel: AccountViewModel, ) { UserAvatar( userHex = userHex, @@ -547,12 +538,6 @@ fun InnerUserPicture( } else { stringRes(id = Res.string.profile_image) }, - loadProfilePicture = accountViewModel.settings.showProfilePictures(), - loadRobohash = accountViewModel.settings.isNotPerformanceMode(), - autoPlayGif = - accountViewModel.settings.autoPlayVideosFlow - .collectAsStateWithLifecycle() - .value, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt index ed1177b147..75a78c8df2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapCustomDialog.kt @@ -99,6 +99,7 @@ import com.vitorpamplona.amethyst.commons.resources.zap_type_private import com.vitorpamplona.amethyst.commons.resources.zap_type_private_explainer import com.vitorpamplona.amethyst.commons.resources.zap_type_public import com.vitorpamplona.amethyst.commons.resources.zap_type_public_explainer +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.insets.imePaddingSafe import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarWithBackButton @@ -113,7 +114,6 @@ import com.vitorpamplona.amethyst.commons.ui.theme.ZeroPadding import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.service.ZapPaymentHandler -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.wallet.OnchainZapSendDialog import com.vitorpamplona.quartz.nip01Core.core.Event diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapPollNote.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapPollNote.kt index 4ca2a10e2b..445efa5a78 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapPollNote.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/ZapPollNote.kt @@ -89,6 +89,7 @@ import com.vitorpamplona.amethyst.commons.resources.poll_is_closed_explainer import com.vitorpamplona.amethyst.commons.resources.poll_unable_to_vote import com.vitorpamplona.amethyst.commons.resources.read_only_user import com.vitorpamplona.amethyst.commons.resources.zaps +import com.vitorpamplona.amethyst.commons.ui.components.toasts.StringToastMsg import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes @@ -107,7 +108,6 @@ import com.vitorpamplona.amethyst.commons.ui.theme.subtleBorder import com.vitorpamplona.amethyst.service.ZapPaymentHandler import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteZaps import com.vitorpamplona.amethyst.ui.components.TranslatableRichTextViewer -import com.vitorpamplona.amethyst.ui.components.toasts.StringToastMsg import com.vitorpamplona.amethyst.ui.navigation.routes.routeToMessage import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/NoteHeaderMarkersPreview.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/NoteHeaderMarkersPreview.kt index fb12ae4b2d..00689c692d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/NoteHeaderMarkersPreview.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/elements/NoteHeaderMarkersPreview.kt @@ -29,12 +29,12 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.vitorpamplona.amethyst.commons.model.FeatureSetType import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.ui.components.GenericLoadable import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn -import com.vitorpamplona.amethyst.model.FeatureSetType import com.vitorpamplona.amethyst.service.location.CachedReversedGeoLocations import com.vitorpamplona.amethyst.ui.note.FirstUserInfoRow import com.vitorpamplona.amethyst.ui.note.types.EditState diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/CommentPostViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/CommentPostViewModel.kt index 92e3eeecc1..8afb6da337 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/CommentPostViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/CommentPostViewModel.kt @@ -721,7 +721,7 @@ open class CommentPostViewModel : if (replyingToEvent is CommunityDefinitionEvent) { replyingToEvent.moderatorKeys().mapNotNull { if (it != replyingToEvent.pubKey) { - accountViewModel.checkGetOrCreateUser(it)?.toPTag() + LocalCache.checkGetOrCreateUser(it)?.toPTag() } else { null } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/GenericCommentPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/GenericCommentPostScreen.kt index 3fad5f0759..208535d4b4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/GenericCommentPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/nip22Comments/GenericCommentPostScreen.kt @@ -65,6 +65,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.AddressableNote +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.composer.AudienceSelection import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList import com.vitorpamplona.amethyst.commons.relayClient.communities.CommunityFilterAssemblerSubscription @@ -149,13 +150,13 @@ fun ReplyCommentPostScreen( val context = LocalContext.current LaunchedEffect(postViewModel, accountViewModel) { - replyId?.let { accountViewModel.getNoteIfExists(it) }?.let { + replyId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.reply(it) } - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } - quoteId?.let { accountViewModel.getNoteIfExists(it) }?.let { + quoteId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.quote(it) } message?.ifBlank { null }?.let { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt index 5537e616a4..d90b4644cc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Badge.kt @@ -315,8 +315,8 @@ fun AcceptBadgeControls( val amAwardee = remember(award, myPubkey) { award.awardeeIds().contains(myPubkey) } if (!amAwardee) return - val newNote = accountViewModel.getOrCreateAddressableNote(ProfileBadgesEvent.createAddress(myPubkey)) - val oldNote = accountViewModel.getOrCreateAddressableNote(AcceptedBadgeSetEvent.createAddress(myPubkey)) + val newNote = LocalCache.getOrCreateAddressableNote(ProfileBadgesEvent.createAddress(myPubkey)) + val oldNote = LocalCache.getOrCreateAddressableNote(AcceptedBadgeSetEvent.createAddress(myPubkey)) val newState by newNote .flow() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Highlight.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Highlight.kt index 39071710d7..2fd5c0428f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Highlight.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Highlight.kt @@ -46,6 +46,7 @@ import com.vitorpamplona.amethyst.commons.model.EmptyTagList import com.vitorpamplona.amethyst.commons.model.ImmutableListOfLists import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.highlights.HighlightQuote import com.vitorpamplona.amethyst.commons.model.navigation.routeFor import com.vitorpamplona.amethyst.commons.model.toImmutableListOfLists @@ -308,23 +309,23 @@ private fun DisplayQuoteAuthor( accountViewModel: AccountViewModel, nav: INav, ) { - var userBase by remember { mutableStateOf(authorHex?.let { accountViewModel.getUserIfExists(it) }) } + var userBase by remember { mutableStateOf(authorHex?.let { LocalCache.getUserIfExists(it) }) } if (userBase == null && authorHex != null) { LaunchedEffect(authorHex) { - userBase = accountViewModel.checkGetOrCreateUser(authorHex) + userBase = LocalCache.checkGetOrCreateUser(authorHex) } } var addressable by remember { - mutableStateOf(postAddress?.let { accountViewModel.getAddressableNoteIfExists(it) }) + mutableStateOf(postAddress?.let { LocalCache.getAddressableNoteIfExists(it) }) } if (addressable == null && postAddress != null) { LaunchedEffect(key1 = postAddress) { val newNote = withContext(Dispatchers.IO) { - accountViewModel.getOrCreateAddressableNote(postAddress) + LocalCache.getOrCreateAddressableNote(postAddress) } if (addressable != newNote) { addressable = newNote @@ -333,14 +334,14 @@ private fun DisplayQuoteAuthor( } var version by remember { - mutableStateOf(postVersion?.let { accountViewModel.getNoteIfExists(it.eventId) }) + mutableStateOf(postVersion?.let { LocalCache.getNoteIfExists(it.eventId) }) } if (version == null && postVersion != null) { LaunchedEffect(key1 = postVersion) { val newNote = withContext(Dispatchers.IO) { - accountViewModel.getOrCreateNote(postVersion.eventId) + LocalCache.getOrCreateNote(postVersion.eventId) } if (version != newNote) { version = newNote diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RememberCaptionTracks.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RememberCaptionTracks.kt index 15402138f7..b122f7fa43 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RememberCaptionTracks.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/RememberCaptionTracks.kt @@ -24,6 +24,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.key import androidx.compose.runtime.remember +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip71Video.CaptionTrack import com.vitorpamplona.amethyst.commons.model.nip71Video.captionTracks import com.vitorpamplona.amethyst.commons.model.nip71Video.mergeCaptionTracks @@ -60,7 +61,7 @@ fun rememberCaptionTracks( val resolved = refs.pending.map { pending -> key(pending.address.toValue()) { - val note = remember(pending.address) { accountViewModel.getOrCreateAddressableNote(pending.address) } + val note = remember(pending.address) { LocalCache.getOrCreateAddressableNote(pending.address) } val trackEvent by observeNoteEvent(note, accountViewModel) trackEvent?.toCaptionTrack(pending.tag) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/SoftwareApp.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/SoftwareApp.kt index 83714f95a5..2cd4be21e4 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/SoftwareApp.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/SoftwareApp.kt @@ -603,9 +603,9 @@ private fun LoadAssetNote( accountViewModel: AccountViewModel, content: @Composable (Note?) -> Unit, ) { - val note by produceState(initialValue = accountViewModel.getNoteIfExists(eventId), eventId) { + val note by produceState(initialValue = LocalCache.getNoteIfExists(eventId), eventId) { if (value == null) { - value = accountViewModel.checkGetOrCreateNote(eventId) + value = LocalCache.checkGetOrCreateNote(eventId) } } content(note) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/TextModification.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/TextModification.kt index 593c22c8b4..e3e7683aff 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/TextModification.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/TextModification.kt @@ -45,6 +45,7 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import com.vitorpamplona.amethyst.commons.model.EmptyTagList import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.routeFor import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.accept_the_suggestion @@ -88,7 +89,7 @@ fun RenderTextModificationEvent( val isAuthorTheLoggedUser = remember { val authorOfTheOriginalNote = - noteEvent.editedNote()?.let { accountViewModel.getNoteIfExists(it.eventId)?.author?.pubkeyHex ?: it.author } + noteEvent.editedNote()?.let { LocalCache.getNoteIfExists(it.eventId)?.author?.pubkeyHex ?: it.author } mutableStateOf(accountViewModel.isLoggedUser(authorOfTheOriginalNote)) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt index 57381f76b9..6af3dab4b8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/AccountViewModel.kt @@ -46,18 +46,17 @@ import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.Dao import com.vitorpamplona.amethyst.commons.model.LiveHiddenUsers import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.backups.ReplaceableBackupConflict import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.concord.ConcordChannel import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel -import com.vitorpamplona.amethyst.commons.model.geohashChat.GeohashChatChannel import com.vitorpamplona.amethyst.commons.model.navigation.BottomBarEntry import com.vitorpamplona.amethyst.commons.model.navigation.NavBarItem import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.nip28PublicChats.PublicChatChannel import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel -import com.vitorpamplona.amethyst.commons.model.nip53LiveActivities.LiveActivitiesChannel import com.vitorpamplona.amethyst.commons.model.nip56Reports.UserReportWarningState import com.vitorpamplona.amethyst.commons.model.nip56Reports.dmReportWarningFor import com.vitorpamplona.amethyst.commons.model.observables.CreatedAtComparator @@ -103,15 +102,16 @@ import com.vitorpamplona.amethyst.commons.service.http.IRoleBasedHttpClientBuild import com.vitorpamplona.amethyst.commons.service.pow.PoWCategory import com.vitorpamplona.amethyst.commons.tor.TorType import com.vitorpamplona.amethyst.commons.ui.components.UrlPreviewState +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ToastManager import com.vitorpamplona.amethyst.commons.ui.loadStringRes import com.vitorpamplona.amethyst.commons.ui.notifications.CardFeedState +import com.vitorpamplona.amethyst.commons.ui.screen.UiSettingsState import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCache import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCacheAsync import com.vitorpamplona.amethyst.logTime import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.AccountSettings import com.vitorpamplona.amethyst.model.LatestKeyPackageOwner -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.model.UrlCachedPreviewer import com.vitorpamplona.amethyst.model.privacyOptions.RoleBasedHttpClientBuilder import com.vitorpamplona.amethyst.service.ClinkDebitPayer @@ -127,13 +127,11 @@ import com.vitorpamplona.amethyst.service.pow.powKindLabelRes import com.vitorpamplona.amethyst.service.relayClient.reqCommand.RelaySubscriptionsCoordinator import com.vitorpamplona.amethyst.ui.actions.MediaSaverToDisk import com.vitorpamplona.amethyst.ui.actions.NewMessageTagger -import com.vitorpamplona.amethyst.ui.components.toasts.ToastManager import com.vitorpamplona.amethyst.ui.note.ZapAmountCommentNotification import com.vitorpamplona.amethyst.ui.note.ZapraiserStatus import com.vitorpamplona.amethyst.ui.note.payViaIntent import com.vitorpamplona.amethyst.ui.note.showAmount import com.vitorpamplona.amethyst.ui.note.showAmountInteger -import com.vitorpamplona.amethyst.ui.screen.UiSettingsState import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.marmotGroup.send.MarmotGroupIconChange import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.marmotGroup.send.MarmotGroupIconUpload import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.marmotGroup.send.MarmotGroupIconUploader @@ -146,7 +144,6 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.wallet.ReloadMintRequest import com.vitorpamplona.amethyst.ui.tor.TorSettingsFlow import com.vitorpamplona.quartz.experimental.clink.debits.DebitResponse import com.vitorpamplona.quartz.experimental.clink.pointers.NDebit -import com.vitorpamplona.quartz.experimental.ephemChat.chat.RoomId import com.vitorpamplona.quartz.experimental.interactiveStories.InteractiveStoryBaseEvent import com.vitorpamplona.quartz.experimental.interactiveStories.InteractiveStoryReadingStateEvent import com.vitorpamplona.quartz.marmot.appComponents.EncryptedMediaReferenceV2 @@ -195,7 +192,6 @@ import com.vitorpamplona.quartz.nip19Bech32.entities.NPub import com.vitorpamplona.quartz.nip19Bech32.entities.NRelay import com.vitorpamplona.quartz.nip19Bech32.entities.NSec import com.vitorpamplona.quartz.nip25Reactions.ReactionEvent -import com.vitorpamplona.quartz.nip29RelayGroups.GroupId import com.vitorpamplona.quartz.nip37Drafts.DraftWrapEvent import com.vitorpamplona.quartz.nip47WalletConnect.Nip47WalletConnect import com.vitorpamplona.quartz.nip47WalletConnect.rpc.IErrorResponseLike @@ -2266,32 +2262,6 @@ class AccountViewModel( override fun getOrCreateAddressableNote(address: Address): AddressableNote = LocalCache.getOrCreateAddressableNote(address) - fun getAddressableNoteIfExists(key: String): AddressableNote? = LocalCache.getAddressableNoteIfExists(key) - - fun getAddressableNoteIfExists(key: Address): AddressableNote? = LocalCache.getAddressableNoteIfExists(key) - - fun checkGetOrCreatePublicChatChannel(key: HexKey): PublicChatChannel = LocalCache.getOrCreatePublicChatChannel(key) - - fun checkGetOrCreateLiveActivityChannel(key: Address): LiveActivitiesChannel = LocalCache.getOrCreateLiveChannel(key) - - fun checkGetOrCreateEphemeralChatChannel(key: RoomId): EphemeralChatChannel = LocalCache.getOrCreateEphemeralChannel(key) - - fun getPublicChatChannelIfExists(hex: HexKey) = LocalCache.getPublicChatChannelIfExists(hex) - - fun getEphemeralChatChannelIfExists(key: RoomId) = LocalCache.getEphemeralChatChannelIfExists(key) - - fun checkGetOrCreateGeohashChannel(geohash: String): GeohashChatChannel = LocalCache.getOrCreateGeohashChannel(geohash) - - fun getGeohashChannelIfExists(geohash: String) = LocalCache.getGeohashChannelIfExists(geohash) - - fun checkGetOrCreateRelayGroupChannel(key: GroupId): RelayGroupChannel = LocalCache.getOrCreateRelayGroupChannel(key) - - fun getRelayGroupChannelIfExists(key: GroupId) = LocalCache.getRelayGroupChannelIfExists(key) - - fun getRelayGroupChannelsOnRelay(relay: NormalizedRelayUrl) = LocalCache.getRelayGroupChannelsOnRelay(relay) - - fun getLiveActivityChannelIfExists(key: Address) = LocalCache.getLiveActivityChannelIfExists(key) - fun loadParticipants( participants: List, onReady: (ImmutableList>) -> Unit, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictEventViews.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictEventViews.kt index 9c552c4f0f..b845503645 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictEventViews.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictEventViews.kt @@ -515,9 +515,9 @@ internal fun observedUserInfo( pubKey: HexKey, accountViewModel: AccountViewModel, ): UserMetadata? { - var user by remember(pubKey) { mutableStateOf(accountViewModel.getUserIfExists(pubKey)) } + var user by remember(pubKey) { mutableStateOf(LocalCache.getUserIfExists(pubKey)) } if (user == null) { - LaunchedEffect(pubKey) { user = accountViewModel.checkGetOrCreateUser(pubKey) } + LaunchedEffect(pubKey) { user = LocalCache.checkGetOrCreateUser(pubKey) } } val loaded = user ?: return null val info by observeUserInfo(loaded, accountViewModel) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt index b8f7dca79e..4641c7cf82 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/backups/BackupConflictListViews.kt @@ -60,6 +60,7 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbol import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.backups.BackupEventType import com.vitorpamplona.amethyst.commons.model.backups.ReplaceableBackupConflict +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.navigation.routeFor import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage @@ -492,7 +493,7 @@ private fun LazyListScope.favoriteFeedItems( val saved = (conflict.saved as? FavoriteAlgoFeedsListEvent)?.publicFavoriteAlgoFeeds().orEmpty() spaceGrid("feed-", fates(saved, diff.feeds) { it.address }, { it.address.toValue() }) { bookmark, fate, modifier -> AddressableSpaceTile(bookmark.address, fate, accountViewModel, modifier) { - nav.nav { accountViewModel.getAddressableNoteIfExists(bookmark.address)?.let { routeFor(it, accountViewModel.account) } } + nav.nav { LocalCache.getAddressableNoteIfExists(bookmark.address)?.let { routeFor(it, accountViewModel.account) } } } } privateItemsCard(diff.privateItems) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/badges/profile/ProfileBadgesScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/badges/profile/ProfileBadgesScreen.kt index df7ba7bea0..d0d166c2b5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/badges/profile/ProfileBadgesScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/badges/profile/ProfileBadgesScreen.kt @@ -86,8 +86,8 @@ fun ProfileBadgesScreen( // historic awards land in cache while this screen is open. ProfileBadgesFilterAssemblerSubscription(accountViewModel) - val newNote = accountViewModel.getOrCreateAddressableNote(ProfileBadgesEvent.createAddress(myPubkey)) - val oldNote = accountViewModel.getOrCreateAddressableNote(AcceptedBadgeSetEvent.createAddress(myPubkey)) + val newNote = LocalCache.getOrCreateAddressableNote(ProfileBadgesEvent.createAddress(myPubkey)) + val oldNote = LocalCache.getOrCreateAddressableNote(AcceptedBadgeSetEvent.createAddress(myPubkey)) val newState by newNote .flow() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/DrawAuthorInfo.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/DrawAuthorInfo.kt index 84ebcb66d7..38541c96f9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/DrawAuthorInfo.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/DrawAuthorInfo.kt @@ -103,7 +103,6 @@ private fun WatchAndDisplayUser( userName = displayName, size = Size20dp, modifier = Modifier, - accountViewModel = accountViewModel, ) WatchUserFollows(author.pubkeyHex, accountViewModel) { newFollowingState -> diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/types/RenderBuzzSystemMessage.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/types/RenderBuzzSystemMessage.kt index 67e4a081ac..47f30f5858 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/types/RenderBuzzSystemMessage.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/feed/types/RenderBuzzSystemMessage.kt @@ -28,6 +28,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import com.vitorpamplona.amethyst.commons.chats.ui.ChatSystemMessage import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.buzz_system_channel_archived @@ -219,10 +220,10 @@ fun observeUserNameByHex( ): String { if (pubkey == null) return "" - var user by remember(pubkey) { mutableStateOf(accountViewModel.getUserIfExists(pubkey)) } + var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) } if (user == null) { - LaunchedEffect(pubkey) { user = accountViewModel.checkGetOrCreateUser(pubkey) } + LaunchedEffect(pubkey) { user = LocalCache.checkGetOrCreateUser(pubkey) } } val loaded = user ?: return remember(pubkey) { pubkey.take(8) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/LoadGeohashChannel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/LoadGeohashChannel.kt index ffc2f6a685..bca56fbc88 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/LoadGeohashChannel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/geohashChat/LoadGeohashChannel.kt @@ -21,6 +21,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.geohashChat import androidx.compose.runtime.Composable +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.geohashChat.GeohashChatChannel import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -38,8 +39,8 @@ fun LoadGeohashChannel( content: @Composable (GeohashChatChannel) -> Unit, ) { val channel = - produceStateIfNotNull(accountViewModel.getGeohashChannelIfExists(geohash), geohash) { - value = accountViewModel.checkGetOrCreateGeohashChannel(geohash) + produceStateIfNotNull(LocalCache.getGeohashChannelIfExists(geohash), geohash) { + value = LocalCache.getOrCreateGeohashChannel(geohash) } channel.value?.let { content(it) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupChatView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupChatView.kt index 96d1f7c04f..1a480a9adc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupChatView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupChatView.kt @@ -49,6 +49,7 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.chats.ui.ThinSendButton +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.marmot_group_composer_disbanding import com.vitorpamplona.amethyst.commons.resources.marmot_group_composer_leaving @@ -121,7 +122,7 @@ fun MarmotGroupChatView( // landed in LocalCache. checkGetOrCreateNote is a no-op for unknown ids. if (replyToInnerNote != null) { LaunchedEffect(replyToInnerNote) { - val parent = accountViewModel.checkGetOrCreateNote(replyToInnerNote) + val parent = LocalCache.checkGetOrCreateNote(replyToInnerNote) if (parent != null) { newMessageModel.reply(parent) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt index df8c893e5d..4c8d52184f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotGroupListScreen.kt @@ -59,6 +59,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.chats.ui.ChatUnreadBadge import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.marmotGroups.MarmotGroupChatroom import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.resources.Res @@ -329,7 +330,7 @@ fun MarmotGroupListItem( previewEvent ?.pubKey ?.takeIf { it != myPubKey } - ?.let { accountViewModel.getUserIfExists(it) } + ?.let { LocalCache.getUserIfExists(it) } val senderName = if (senderUser != null) { observeUserInfo(senderUser, accountViewModel).value?.info?.bestName() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotSystemRowRenderer.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotSystemRowRenderer.kt index 1442015c2a..6f7a2c9adf 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotSystemRowRenderer.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/marmotGroup/MarmotSystemRowRenderer.kt @@ -33,6 +33,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.marmot_system_admin_added import com.vitorpamplona.amethyst.commons.resources.marmot_system_admin_added_passive @@ -167,7 +168,7 @@ class MarmotSystemRowRenderer( /** A known display name, or a short key when the account is a stranger. */ @Composable private fun displayName(pubkeyHex: String): String { - val user = accountViewModel.getUserIfExists(pubkeyHex) + val user = LocalCache.getUserIfExists(pubkeyHex) return user?.toBestDisplayName() ?: pubkeyHex.take(8) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomView.kt index 78c91bea19..c46d38c24b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomView.kt @@ -40,6 +40,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.feeds.FeedContentState import com.vitorpamplona.amethyst.commons.feeds.FeedState +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.privateChatLastReadRoute import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.chats_history_proto_nip04 @@ -106,7 +107,7 @@ fun ChatroomView( if (replyToNote != null) { LaunchedEffect(key1 = replyToNote, newPostModel, accountViewModel) { - val replyNote = accountViewModel.checkGetOrCreateNote(replyToNote) + val replyNote = LocalCache.checkGetOrCreateNote(replyToNote) if (replyNote != null) { newPostModel.reply(replyNote) } @@ -114,7 +115,7 @@ fun ChatroomView( } if (editFromDraft != null) { LaunchedEffect(editFromDraft, newPostModel, accountViewModel) { - val draftNote = accountViewModel.checkGetOrCreateNote(editFromDraft) + val draftNote = LocalCache.checkGetOrCreateNote(editFromDraft) if (draftNote != null) { newPostModel.editFromDraft(draftNote) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/send/ChatNewMessageViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/send/ChatNewMessageViewModel.kt index ad9e3471ea..3bb0e5dce0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/send/ChatNewMessageViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/send/ChatNewMessageViewModel.kt @@ -407,7 +407,7 @@ class ChatNewMessageViewModel : } if (replyId != null) { - replyTo.value = accountViewModel.checkGetOrCreateNote(replyId) + replyTo.value = LocalCache.checkGetOrCreateNote(replyId) } } else if (draftEvent is PrivateDmEvent) { val recipientNPub = draftEvent.verifiedRecipientPubKey()?.let { Hex.decode(it).toNpub() } @@ -415,7 +415,7 @@ class ChatNewMessageViewModel : val replyId = draftEvent.replyTo() if (replyId != null) { - replyTo.value = accountViewModel.checkGetOrCreateNote(replyId) + replyTo.value = LocalCache.checkGetOrCreateNote(replyId) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelListScreen.kt index 8a3250abb0..3075b9a87a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelListScreen.kt @@ -589,7 +589,7 @@ private fun rememberConcordDisplayName( hex: HexKey, accountViewModel: AccountViewModel, ): String { - val user = remember(hex) { accountViewModel.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } + val user = remember(hex) { LocalCache.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } val name by observeUserName(user, accountViewModel) return name } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelScreen.kt index e921ea0531..fc1c1f025b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordChannelScreen.kt @@ -392,7 +392,7 @@ private fun rememberTypistName( hex: String, accountViewModel: AccountViewModel, ): String { - val user = remember(hex) { accountViewModel.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } + val user = remember(hex) { LocalCache.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } val info by observeUserInfo(user, accountViewModel) return info?.info?.bestName() ?: remember(user) { user.pubkeyDisplayHex() } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordMembersScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordMembersScreen.kt index a2bf94ddc7..d09ff1be8d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordMembersScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/concord/ConcordMembersScreen.kt @@ -57,6 +57,7 @@ import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.concord.ConcordMembership import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.back @@ -250,7 +251,7 @@ private fun ConcordMemberRow( accountViewModel: AccountViewModel, nav: INav, ) { - val user = remember(entry.pubkey) { accountViewModel.checkGetOrCreateUser(entry.pubkey) } + val user = remember(entry.pubkey) { LocalCache.checkGetOrCreateUser(entry.pubkey) } val isOwnerTarget = entry.membership == ConcordMembership.OWNER val isBanned = entry.membership == ConcordMembership.BANNED val isAdmin = entry.membership == ConcordMembership.ADMIN diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/EphemeralChatScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/EphemeralChatScreen.kt index 2e88e40e26..9e00d294ce 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/EphemeralChatScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/EphemeralChatScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -44,8 +45,8 @@ fun EphemeralChatScreen( ) { val relay = remember(relayUrl) { RelayUrlNormalizer.normalizeOrNull(relayUrl) } ?: return val channelId = remember(id, relay) { RoomId(id, relay) } - val draft = remember(draftId) { draftId?.let { accountViewModel.getNoteIfExists(it) } } - val replyTo = remember(replyToId) { replyToId?.let { accountViewModel.checkGetOrCreateNote(it) } } + val draft = remember(draftId) { draftId?.let { LocalCache.getNoteIfExists(it) } } + val replyTo = remember(replyToId) { replyToId?.let { LocalCache.checkGetOrCreateNote(it) } } DisappearingScaffold( isInvertedLayout = true, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/LoadEphemeralChatChannel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/LoadEphemeralChatChannel.kt index 51af13e271..1f2858285b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/LoadEphemeralChatChannel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/ephemChat/LoadEphemeralChatChannel.kt @@ -21,6 +21,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.ephemChat import androidx.compose.runtime.Composable +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -33,8 +34,8 @@ fun LoadEphemeralChatChannel( content: @Composable (EphemeralChatChannel) -> Unit, ) { val channel = - produceStateIfNotNull(accountViewModel.getEphemeralChatChannelIfExists(id), id) { - value = accountViewModel.checkGetOrCreateEphemeralChatChannel(id) + produceStateIfNotNull(LocalCache.getEphemeralChatChannelIfExists(id), id) { + value = LocalCache.getOrCreateEphemeralChannel(id) } channel.value?.let { content(it) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip28PublicChat/PublicChatChannelScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip28PublicChat/PublicChatChannelScreen.kt index 1461c1fe7c..f4dab4e683 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip28PublicChat/PublicChatChannelScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip28PublicChat/PublicChatChannelScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold @@ -44,8 +45,8 @@ fun PublicChatChannelScreen( ) { if (channelId == null) return - val draft = remember(draftId) { draftId?.let { accountViewModel.getNoteIfExists(it) } } - val replyTo = remember(replyToId) { replyToId?.let { accountViewModel.checkGetOrCreateNote(it) } } + val draft = remember(draftId) { draftId?.let { LocalCache.getNoteIfExists(it) } } + val replyTo = remember(replyToId) { replyToId?.let { LocalCache.checkGetOrCreateNote(it) } } val selfRoute = remember(channelId) { Route.PublicChatChannel(channelId) } DisappearingScaffold( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/LiveActivityChannelScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/LiveActivityChannelScreen.kt index 2ce86fc6ca..edfc15df6a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/LiveActivityChannelScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/LiveActivityChannelScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.service.OnlineChecker import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold @@ -45,8 +46,8 @@ fun LiveActivityChannelScreen( ) { if (channelId == null) return - val draft = remember(draftId) { draftId?.let { accountViewModel.getNoteIfExists(it) } } - val replyTo = remember(replyToId) { replyToId?.let { accountViewModel.checkGetOrCreateNote(it) } } + val draft = remember(draftId) { draftId?.let { LocalCache.getNoteIfExists(it) } } + val replyTo = remember(replyToId) { replyToId?.let { LocalCache.checkGetOrCreateNote(it) } } DisappearingScaffold( isInvertedLayout = true, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/header/LiveStreamTopZappers.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/header/LiveStreamTopZappers.kt index e933a5ea41..9744b58ed0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/header/LiveStreamTopZappers.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/nip53LiveActivities/header/LiveStreamTopZappers.kt @@ -48,6 +48,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.nip53LiveActivities.LiveActivitiesChannel import com.vitorpamplona.amethyst.commons.nip53LiveActivities.TopZapperEntry @@ -92,11 +93,11 @@ fun LiveStreamTopZappers( val goalId = channel.info?.goalEventId() if (goalId != null) { var goalNoteHolder by remember(goalId) { - mutableStateOf(accountViewModel.getNoteIfExists(goalId)) + mutableStateOf(LocalCache.getNoteIfExists(goalId)) } LaunchedEffect(goalId) { if (goalNoteHolder == null) { - goalNoteHolder = accountViewModel.checkGetOrCreateNote(goalId) + goalNoteHolder = LocalCache.checkGetOrCreateNote(goalId) } topZappersVm.setGoalNote(goalNoteHolder) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/BuzzTypingIndicator.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/BuzzTypingIndicator.kt index 5779fd3a09..9e5dc3bd1e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/BuzzTypingIndicator.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/BuzzTypingIndicator.kt @@ -56,6 +56,7 @@ import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.model.buzz.BuzzTypingState +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.buzz_typing_many import com.vitorpamplona.amethyst.commons.resources.buzz_typing_one @@ -184,7 +185,7 @@ private fun rememberTypistName( hex: HexKey, accountViewModel: AccountViewModel, ): String { - val user = remember(hex) { accountViewModel.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } + val user = remember(hex) { LocalCache.checkGetOrCreateUser(hex) } ?: return remember(hex) { hex.take(8) } val info by observeUserInfo(user, accountViewModel) return info?.info?.bestName() ?: remember(user) { user.pubkeyDisplayHex() } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/LoadRelayGroupChannel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/LoadRelayGroupChannel.kt index 0704bd9195..2b0582c4e1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/LoadRelayGroupChannel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/LoadRelayGroupChannel.kt @@ -21,6 +21,7 @@ package com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.relayGroup import androidx.compose.runtime.Composable +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -33,8 +34,8 @@ fun LoadRelayGroupChannel( content: @Composable (RelayGroupChannel) -> Unit, ) { val channel = - produceStateIfNotNull(accountViewModel.getRelayGroupChannelIfExists(id), id) { - value = accountViewModel.checkGetOrCreateRelayGroupChannel(id) + produceStateIfNotNull(LocalCache.getRelayGroupChannelIfExists(id), id) { + value = LocalCache.getOrCreateRelayGroupChannel(id) } channel.value?.let { content(it) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt index 72c810d975..8003a74854 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChannelListScreen.kt @@ -210,12 +210,12 @@ fun RelayGroupChannelListScreen( // so the first frame doesn't reshuffle when the first emission arrives. // remember the seed so the per-relay cache scan + sort runs once (on first composition / relay // change), not on every recomposition — produceState evaluates its initialValue argument eagerly. - val initialChannels = remember(relay) { accountViewModel.getRelayGroupChannelsOnRelay(relay).sortedBySnapshot { it.toBestDisplayName().lowercase() } } + val initialChannels = remember(relay) { LocalCache.getRelayGroupChannelsOnRelay(relay).sortedBySnapshot { it.toBestDisplayName().lowercase() } } val allChannels by produceState(initialValue = initialChannels, relay) { LocalCache .observeEvents(Filter(kinds = listOf(GroupMetadataEvent.KIND))) .collect { - value = accountViewModel.getRelayGroupChannelsOnRelay(relay).sortedBySnapshot { it.toBestDisplayName().lowercase() } + value = LocalCache.getRelayGroupChannelsOnRelay(relay).sortedBySnapshot { it.toBestDisplayName().lowercase() } } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChatScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChatScreen.kt index a10b1932ea..e65bdc3dde 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChatScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupChatScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold @@ -46,8 +47,8 @@ fun RelayGroupChatScreen( ) { val relay = remember(relayUrl) { RelayUrlNormalizer.normalizeOrNull(relayUrl) } ?: return val channelId = remember(id, relay) { GroupId(id, relay) } - val draft = remember(draftId) { draftId?.let { accountViewModel.getNoteIfExists(it) } } - val replyTo = remember(replyToId) { replyToId?.let { accountViewModel.checkGetOrCreateNote(it) } } + val draft = remember(draftId) { draftId?.let { LocalCache.getNoteIfExists(it) } } + val replyTo = remember(replyToId) { replyToId?.let { LocalCache.checkGetOrCreateNote(it) } } val selfRoute = remember(id, relayUrl) { Route.RelayGroup(id, relayUrl) } DisappearingScaffold( diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt index c8bd0df5ca..0b79115fc3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupMembersScreen.kt @@ -68,6 +68,7 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.buzz.BuzzAgentActivityState import com.vitorpamplona.amethyst.commons.model.buzz.BuzzRelayDialect +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupMembership @@ -352,7 +353,7 @@ private fun RelayGroupMemberRow( // Create-or-get (never a one-shot null): UsernameDisplay observes the user's // metadata flow, so the name fills in when the kind:0 arrives instead of being // stuck on truncated hex forever. - val user = remember(entry.pubkey) { accountViewModel.checkGetOrCreateUser(entry.pubkey) } + val user = remember(entry.pubkey) { LocalCache.checkGetOrCreateUser(entry.pubkey) } var menuOpen by remember { mutableStateOf(false) } var confirmRemove by remember { mutableStateOf(false) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupParentPicker.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupParentPicker.kt index 627c5face7..c8288dcbe0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupParentPicker.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupParentPicker.kt @@ -152,7 +152,7 @@ private fun ParentSelectorCard( // yet), warm its single 39000, and observe it so the name/picture fill in as they arrive. val liveParent: RelayGroupChannel? = parentId?.let { id -> - val channel = remember(id, relay) { accountViewModel.checkGetOrCreateRelayGroupChannel(GroupId(id, relay)) } + val channel = remember(id, relay) { LocalCache.getOrCreateRelayGroupChannel(GroupId(id, relay)) } RelayGroupCardWarmupSubscription(channel, accountViewModel.dataSources().relayGroupCardWarmup, accountViewModel) val state by channel .flow() @@ -473,7 +473,7 @@ private fun pickCandidates( relayInfo: Nip11RelayInformation, forbidden: Set, ): List = - accountViewModel + LocalCache .getRelayGroupChannelsOnRelay(relay) .asSequence() .filter { it.groupId.id !in forbidden } @@ -492,11 +492,11 @@ private fun descendantIdsOf( ): Set { val result = mutableSetOf() val queue = ArrayDeque() - accountViewModel.getRelayGroupChannelIfExists(GroupId(rootId, relay))?.childGroupIds()?.let { queue.addAll(it) } + LocalCache.getRelayGroupChannelIfExists(GroupId(rootId, relay))?.childGroupIds()?.let { queue.addAll(it) } while (queue.isNotEmpty()) { val id = queue.removeFirst() if (!result.add(id)) continue - accountViewModel.getRelayGroupChannelIfExists(GroupId(id, relay))?.childGroupIds()?.let { queue.addAll(it) } + LocalCache.getRelayGroupChannelIfExists(GroupId(id, relay))?.childGroupIds()?.let { queue.addAll(it) } } return result } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupPinnedBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupPinnedBar.kt index 12bee2e615..b4fb5f5abb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupPinnedBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/relayGroup/RelayGroupPinnedBar.kt @@ -45,6 +45,7 @@ import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.relay_group_pinned_content_description @@ -76,7 +77,7 @@ fun RelayGroupPinnedBar( val safeIndex = index.coerceIn(0, pinnedIds.lastIndex) val currentId = pinnedIds[safeIndex] - val note = remember(currentId) { accountViewModel.checkGetOrCreateNote(currentId) } ?: return + val note = remember(currentId) { LocalCache.checkGetOrCreateNote(currentId) } ?: return // Fetch + observe the pinned message so its author and content fill in once it loads. val noteState by observeNote(note, accountViewModel) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt index 043b16cef0..993ee2c827 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/ChannelNewMessageViewModel.kt @@ -375,7 +375,7 @@ open class ChannelNewMessageViewModel : (draftEvent as? ChannelMessageEvent) ?: (draftEvent as? LiveActivitiesChatMessageEvent) threadedDraft?.reply()?.eventId?.let { replyId -> - replyTo.value = accountViewModel.checkGetOrCreateNote(replyId) + replyTo.value = LocalCache.checkGetOrCreateNote(replyId) } message.setTextAndPlaceCursorAtEnd(draftEvent.content) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/ChatroomHeaderCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/ChatroomHeaderCompose.kt index 299a69bf9d..b3e26ae4a5 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/ChatroomHeaderCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/rooms/ChatroomHeaderCompose.kt @@ -1125,11 +1125,11 @@ fun LoadUser( content: @Composable (User?) -> Unit, ) { var user by - remember(baseUserHex) { mutableStateOf(accountViewModel.getUserIfExists(baseUserHex)) } + remember(baseUserHex) { mutableStateOf(LocalCache.getUserIfExists(baseUserHex)) } if (user == null) { LaunchedEffect(key1 = baseUserHex) { - user = accountViewModel.checkGetOrCreateUser(baseUserHex) + user = LocalCache.checkGetOrCreateUser(baseUserHex) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessGameScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessGameScreen.kt index 10eadd3e19..d013cb4f1c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessGameScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessGameScreen.kt @@ -60,6 +60,7 @@ import androidx.fragment.app.FragmentActivity import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.nip64Chess.ChessBroadcastStatus import com.vitorpamplona.amethyst.commons.nip64Chess.ui.ChessBroadcastBanner @@ -306,7 +307,7 @@ fun ChessGameScreen( // Resolve opponent display name and avatar val opponentUser = remember(gameState.opponentPubkey) { - accountViewModel.checkGetOrCreateUser(gameState.opponentPubkey) + LocalCache.checkGetOrCreateUser(gameState.opponentPubkey) } val opponentDisplayName = remember(gameState.opponentPubkey) { @@ -320,7 +321,7 @@ fun ChessGameScreen( // Resolve player display name and avatar val playerUser = remember(gameState.playerPubkey) { - accountViewModel.checkGetOrCreateUser(gameState.playerPubkey) + LocalCache.checkGetOrCreateUser(gameState.playerPubkey) } val playerDisplayName = remember(gameState.playerPubkey) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessLobbyScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessLobbyScreen.kt index 639ad50264..811cbb1c66 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessLobbyScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chess/ChessLobbyScreen.kt @@ -60,6 +60,7 @@ import androidx.fragment.app.FragmentActivity import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.nip64Chess.ChessChallenge import com.vitorpamplona.amethyst.commons.nip64Chess.ui.ActiveGameCard @@ -306,7 +307,7 @@ fun ChessLobbyContent( val userPubkey = accountViewModel.account.userProfile().pubkeyHex val currentUser = remember(userPubkey) { - accountViewModel.checkGetOrCreateUser(userPubkey) + LocalCache.checkGetOrCreateUser(userPubkey) } val hasContent = @@ -375,7 +376,7 @@ fun ChessLobbyContent( items(activeGames.entries.toList(), key = { "active-${it.key}" }) { (gameId, state) -> val opponent = remember(state.opponentPubkey) { - accountViewModel.checkGetOrCreateUser(state.opponentPubkey) + LocalCache.checkGetOrCreateUser(state.opponentPubkey) } val displayName = opponent?.toBestDisplayName() ?: state.opponentPubkey.take(8) ActiveGameCard( @@ -411,7 +412,7 @@ fun ChessLobbyContent( items(outgoingChallenges, key = { "outgoing-${it.eventId}" }) { challenge -> val opponentUser = remember(challenge.opponentPubkey) { - challenge.opponentPubkey?.let { accountViewModel.checkGetOrCreateUser(it) } + challenge.opponentPubkey?.let { LocalCache.checkGetOrCreateUser(it) } } val opponentName = opponentUser?.toBestDisplayName() @@ -476,7 +477,7 @@ fun ChessLobbyContent( val displayName = remember(challenge.challengerPubkey, challenge.challengerDisplayName) { challenge.challengerDisplayName - ?: accountViewModel.checkGetOrCreateUser(challenge.challengerPubkey)?.toBestDisplayName() + ?: LocalCache.checkGetOrCreateUser(challenge.challengerPubkey)?.toBestDisplayName() ?: challenge.challengerPubkey.take(8) } ChallengeCard( @@ -513,7 +514,7 @@ fun ChessLobbyContent( val displayName = remember(challenge.challengerPubkey, challenge.challengerDisplayName) { challenge.challengerDisplayName - ?: accountViewModel.checkGetOrCreateUser(challenge.challengerPubkey)?.toBestDisplayName() + ?: LocalCache.checkGetOrCreateUser(challenge.challengerPubkey)?.toBestDisplayName() ?: challenge.challengerPubkey.take(8) } ChallengeCard( @@ -587,7 +588,7 @@ fun ChessLobbyContent( if (game.whitePubkey == userPubkey) game.blackPubkey else game.whitePubkey val opponentUser = remember(opponentPubkey) { - accountViewModel.checkGetOrCreateUser(opponentPubkey) + LocalCache.checkGetOrCreateUser(opponentPubkey) } val opponentName = opponentUser?.toBestDisplayName() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/contactList/ContactListUsersScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/contactList/ContactListUsersScreen.kt index ea7869932e..6a66cbf769 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/contactList/ContactListUsersScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/contactList/ContactListUsersScreen.kt @@ -33,6 +33,7 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.contact_list_screen_title import com.vitorpamplona.amethyst.commons.resources.contact_list_screen_title_with_count @@ -78,7 +79,7 @@ fun ContactListUsersScreen( event ?.verifiedFollowKeySet() ?.filter { !accountViewModel.account.isHidden(it) } - ?.mapNotNull { accountViewModel.checkGetOrCreateUser(it) } + ?.mapNotNull { LocalCache.checkGetOrCreateUser(it) } ?.sortedByDescending { accountViewModel.account.isKnown(it.pubkeyHex) } ?.toPersistentList() ?: persistentListOf() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip23LongForm/LongFormPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip23LongForm/LongFormPostScreen.kt index 2545f6e935..2ece98c9c1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip23LongForm/LongFormPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip23LongForm/LongFormPostScreen.kt @@ -81,6 +81,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.EmptyTagList +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.add_a_tag @@ -156,8 +157,8 @@ fun LongFormPostScreen( postViewModel.init(accountViewModel) LaunchedEffect(postViewModel, accountViewModel) { - val draft = draftId?.let { accountViewModel.getNoteIfExists(it) } - val version = versionId?.let { accountViewModel.getNoteIfExists(it) } + val draft = draftId?.let { LocalCache.getNoteIfExists(it) } + val version = versionId?.let { LocalCache.getNoteIfExists(it) } postViewModel.load(draft, version) if (draftId == null && versionId == null) { postViewModel.applySignature() diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip99Classifieds/NewProductScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip99Classifieds/NewProductScreen.kt index a3ffe17186..d92f87629f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip99Classifieds/NewProductScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/discover/nip99Classifieds/NewProductScreen.kt @@ -44,6 +44,7 @@ import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.unit.dp import androidx.core.net.toUri import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.description @@ -111,10 +112,10 @@ fun NewProductScreen( LaunchedEffect(postViewModel, accountViewModel) { postViewModel.reloadRelaySet() - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } - quoteId?.let { accountViewModel.getNoteIfExists(it) }?.let { + quoteId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.quote(it) } message?.ifBlank { null }?.let { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmHeartbeatObservation.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmHeartbeatObservation.kt index 2d95606f37..5f9ae8e46e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmHeartbeatObservation.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/dvms/DvmHeartbeatObservation.kt @@ -40,6 +40,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip90DVMs.DvmHeartbeatRegistry import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.dvm_offline_banner @@ -72,11 +73,11 @@ fun rememberDvmHeartbeatFresh( var heartbeatNote by remember(heartbeatAddressTag) { - mutableStateOf(accountViewModel.getNoteIfExists(heartbeatAddressTag)) + mutableStateOf(LocalCache.getNoteIfExists(heartbeatAddressTag)) } LaunchedEffect(heartbeatAddressTag) { if (heartbeatNote == null) { - heartbeatNote = accountViewModel.checkGetOrCreateNote(heartbeatAddressTag) + heartbeatNote = LocalCache.checkGetOrCreateNote(heartbeatAddressTag) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabFactory.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabFactory.kt index fab2842f38..8422c85477 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabFactory.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabFactory.kt @@ -27,9 +27,9 @@ import android.os.Bundle import androidx.annotation.RequiresApi import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.favorites.FavoriteApp +import com.vitorpamplona.amethyst.commons.model.ThemeType import com.vitorpamplona.amethyst.commons.tor.TorType import com.vitorpamplona.amethyst.favorites.FavoriteAppLauncher -import com.vitorpamplona.amethyst.model.ThemeType import com.vitorpamplona.amethyst.napplet.WebAppNetworkRegistry import com.vitorpamplona.amethyst.napplethost.NappletHostContract import com.vitorpamplona.amethyst.ui.screen.loggedIn.browser.EmbeddedWebAppController diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabThemeWatcher.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabThemeWatcher.kt index 9c0ddcf11a..d3e8c770f6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabThemeWatcher.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/embed/EmbeddedTabThemeWatcher.kt @@ -30,7 +30,7 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.Amethyst -import com.vitorpamplona.amethyst.model.ThemeType +import com.vitorpamplona.amethyst.commons.model.ThemeType /** * Keeps the warm embedded tabs in sync with the app's DARK/LIGHT theme. An embed WebView resolves its diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geohash/GeoHashPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geohash/GeoHashPostScreen.kt index 8860ebac00..2b0eaf0089 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geohash/GeoHashPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/geohash/GeoHashPostScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.platform.LocalContext import androidx.core.net.toUri import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.ui.actions.uploads.SelectedMedia import com.vitorpamplona.amethyst.ui.navigation.navs.Nav import com.vitorpamplona.amethyst.ui.note.nip22Comments.CommentPostViewModel @@ -57,13 +58,13 @@ fun GeoHashPostScreen( geohash?.let { postViewModel.newPostFor(GeohashId(it)) } - replyId?.let { accountViewModel.getNoteIfExists(it) }?.let { + replyId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.reply(it) } - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } - quoteId?.let { accountViewModel.getNoteIfExists(it) }?.let { + quoteId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.quote(it) } message?.ifBlank { null }?.let { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/hashtag/HashtagPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/hashtag/HashtagPostScreen.kt index c752fb9b01..b1eb0e449b 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/hashtag/HashtagPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/hashtag/HashtagPostScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.platform.LocalContext import androidx.core.net.toUri import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.ui.actions.uploads.SelectedMedia import com.vitorpamplona.amethyst.ui.navigation.navs.Nav import com.vitorpamplona.amethyst.ui.note.nip22Comments.CommentPostViewModel @@ -57,13 +58,13 @@ fun HashtagPostScreen( hashtag?.let { postViewModel.newPostFor(HashtagId(it)) } - replyId?.let { accountViewModel.getNoteIfExists(it) }?.let { + replyId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.reply(it) } - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } - quoteId?.let { accountViewModel.getNoteIfExists(it) }?.let { + quoteId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.quote(it) } message?.ifBlank { null }?.let { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/highlights/NewHighlightPostViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/highlights/NewHighlightPostViewModel.kt index 19882e082c..573cbbe5da 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/highlights/NewHighlightPostViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/highlights/NewHighlightPostViewModel.kt @@ -29,6 +29,7 @@ import androidx.compose.runtime.setValue import androidx.lifecycle.ViewModel import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.nip30CustomEmojis.EmojiPackState.EmojiMedia import com.vitorpamplona.amethyst.commons.model.nip30CustomEmojis.EmojiSuggestionState import com.vitorpamplona.amethyst.commons.ui.note.creators.messagefield.IMessageField @@ -134,8 +135,8 @@ class NewHighlightPostViewModel : if (accountViewModel != null) { originalNote = when { - !sourceAddress.isNullOrBlank() -> Address.parse(sourceAddress)?.let { accountViewModel.getOrCreateAddressableNote(it) } - !sourceEventId.isNullOrBlank() -> accountViewModel.getOrCreateNote(sourceEventId) + !sourceAddress.isNullOrBlank() -> Address.parse(sourceAddress)?.let { LocalCache.getOrCreateAddressableNote(it) } + !sourceEventId.isNullOrBlank() -> LocalCache.getOrCreateNote(sourceEventId) else -> null } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostScreen.kt index e97012e2ce..142a83683e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostScreen.kt @@ -81,6 +81,8 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.viewmodel.compose.viewModel import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.BooleanType +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.composer.AudienceSelection import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList @@ -135,7 +137,6 @@ import com.vitorpamplona.amethyst.commons.ui.theme.SuggestionListDefaultHeightPa import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText import com.vitorpamplona.amethyst.commons.ui.theme.replyModifier -import com.vitorpamplona.amethyst.model.BooleanType import com.vitorpamplona.amethyst.ui.actions.StrippingFailureDialog import com.vitorpamplona.amethyst.ui.actions.mediaServers.FileServerSelectionRow import com.vitorpamplona.amethyst.ui.actions.uploads.MAX_VOICE_RECORD_SECONDS @@ -217,11 +218,11 @@ fun ShortNotePostScreen( } LaunchedEffect(postViewModel, accountViewModel) { - val baseReplyTo = baseReplyToId?.let { accountViewModel.getNoteIfExists(it) } - val quote = quoteId?.let { accountViewModel.getNoteIfExists(it) } - val fork = forkId?.let { accountViewModel.getNoteIfExists(it) } - val version = versionId?.let { accountViewModel.getNoteIfExists(it) } - val draft = draftId?.let { accountViewModel.getNoteIfExists(it) } + val baseReplyTo = baseReplyToId?.let { LocalCache.getNoteIfExists(it) } + val quote = quoteId?.let { LocalCache.getNoteIfExists(it) } + val fork = forkId?.let { LocalCache.getNoteIfExists(it) } + val version = versionId?.let { LocalCache.getNoteIfExists(it) } + val draft = draftId?.let { LocalCache.getNoteIfExists(it) } postViewModel.load(baseReplyTo, quote, fork, version, draft) message?.ifBlank { null }?.let { postViewModel.message.setTextAndPlaceCursorAtEnd(it) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostViewModel.kt index 72bc69b916..625d16fd37 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/ShortNotePostViewModel.kt @@ -35,6 +35,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.AddressableNote +import com.vitorpamplona.amethyst.commons.model.BooleanType import com.vitorpamplona.amethyst.commons.model.Note import com.vitorpamplona.amethyst.commons.model.User import com.vitorpamplona.amethyst.commons.model.cache.LocalCache @@ -69,7 +70,6 @@ import com.vitorpamplona.amethyst.commons.ui.text.onUiThread import com.vitorpamplona.amethyst.commons.ui.text.replaceCurrentWord import com.vitorpamplona.amethyst.commons.ui.text.setTextAndPlaceCursorAtBeginning import com.vitorpamplona.amethyst.model.Account -import com.vitorpamplona.amethyst.model.BooleanType import com.vitorpamplona.amethyst.model.accountsCache.AccountCacheState import com.vitorpamplona.amethyst.service.ai.WritingAssistantFactory import com.vitorpamplona.amethyst.service.location.LocationState @@ -1506,7 +1506,7 @@ open class ShortNotePostViewModel : val tags = prepareETagsAsReplyTo(replyingTo, forkingFrom) // fixes wrong tags from previous clients tags.forEach { - val note = accountViewModel.getNoteIfExists(it.eventId) + val note = LocalCache.getNoteIfExists(it.eventId) val ourAuthor = note?.author?.pubkeyHex val ourHint = note?.relayHintUrl() if (it.author == null || it.author?.isBlank() == true) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/VoiceReplyViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/VoiceReplyViewModel.kt index 2e912fd133..c1b223f5fb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/VoiceReplyViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/home/VoiceReplyViewModel.kt @@ -28,6 +28,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.model.Note +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.mediaServers.ServerName import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.error @@ -115,7 +116,7 @@ class VoiceReplyViewModel : ViewModel() { duration: Int, amplitudesJson: String, ) { - replyToNote = accountViewModel.getNoteIfExists(replyToNoteId) + replyToNote = LocalCache.getNoteIfExists(replyToNoteId) val amplitudes = try { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/chat/NestNewMessageViewModel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/chat/NestNewMessageViewModel.kt index e55351ddbc..b72f99f4b1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/chat/NestNewMessageViewModel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/chat/NestNewMessageViewModel.kt @@ -293,7 +293,7 @@ open class NestNewMessageViewModel : if (draftEvent as? LiveActivitiesChatMessageEvent != null) { val replyId = draftEvent.reply()?.eventId if (replyId != null) { - replyTo.value = accountViewModel.checkGetOrCreateNote(replyId) + replyTo.value = LocalCache.checkGetOrCreateNote(replyId) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/participants/ParticipantHostActionsSheet.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/participants/ParticipantHostActionsSheet.kt index 0ddbf3547c..8714898475 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/participants/ParticipantHostActionsSheet.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/participants/ParticipantHostActionsSheet.kt @@ -82,12 +82,12 @@ import com.vitorpamplona.amethyst.commons.resources.nest_promote_speaker import com.vitorpamplona.amethyst.commons.resources.nest_toast_host_action_failed_template_null import com.vitorpamplona.amethyst.commons.resources.nest_toast_host_action_failed_title import com.vitorpamplona.amethyst.commons.resources.no_wallet_found +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.viewmodels.NestViewModel import com.vitorpamplona.amethyst.commons.viewmodels.RoomSpeakerCatalog import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserInfo import com.vitorpamplona.amethyst.ui.MainActivity -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.ui.note.UsernameDisplay import com.vitorpamplona.amethyst.ui.note.ZapCustomDialog import com.vitorpamplona.amethyst.ui.note.payViaIntent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt index 066ad00d60..f01f0b7500 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/screen/NestActionBar.kt @@ -90,13 +90,13 @@ import com.vitorpamplona.amethyst.commons.resources.nest_reconnecting import com.vitorpamplona.amethyst.commons.resources.nest_talk import com.vitorpamplona.amethyst.commons.resources.no_wallet_found import com.vitorpamplona.amethyst.commons.resources.zap_description +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.viewmodels.BroadcastUiState import com.vitorpamplona.amethyst.commons.viewmodels.ConnectionUiState import com.vitorpamplona.amethyst.commons.viewmodels.NestUiState import com.vitorpamplona.amethyst.commons.viewmodels.NestViewModel -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage import com.vitorpamplona.amethyst.ui.note.ZapAmountChoicePopup import com.vitorpamplona.amethyst.ui.note.ZapCustomDialog import com.vitorpamplona.amethyst.ui.note.payViaIntent diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/newUser/ImportFollowListPickFollowsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/newUser/ImportFollowListPickFollowsScreen.kt index db63f47a19..4ab3f4ce13 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/newUser/ImportFollowListPickFollowsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/newUser/ImportFollowListPickFollowsScreen.kt @@ -55,6 +55,7 @@ import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.model.User +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.accounts_found @@ -85,7 +86,7 @@ fun ImportFollowListPickFollowsScreen( ) { val contactListNote = remember(userHex) { - accountViewModel.getOrCreateAddressableNote(ContactListEvent.createAddress(userHex)) + LocalCache.getOrCreateAddressableNote(ContactListEvent.createAddress(userHex)) } Scaffold( @@ -137,7 +138,7 @@ fun DisplayFollowList( ?.unverifiedFollowKeySet() ?.toSet() ?.mapNotNull { - accountViewModel.checkGetOrCreateUser(it) + LocalCache.checkGetOrCreateUser(it) }?.toPersistentList() } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationScreen.kt index f7227a9362..cd772a90de 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/NotificationScreen.kt @@ -32,6 +32,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.rememberCoroutineScope import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.notification_tab_everyone @@ -44,7 +45,6 @@ import com.vitorpamplona.amethyst.commons.ui.feeds.rememberForeverPagerState import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.TabRowHeight -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.ui.components.SelectNotificationProvider import com.vitorpamplona.amethyst.ui.feeds.WatchScrollToTop import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/publicMessages/NewPublicMessageScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/publicMessages/NewPublicMessageScreen.kt index 22770a5c52..febe2b7ffe 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/publicMessages/NewPublicMessageScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/notifications/publicMessages/NewPublicMessageScreen.kt @@ -53,6 +53,7 @@ import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.commons.nip30CustomEmojis.ui.ShowEmojiSuggestionList import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.messages_new_message_to @@ -128,10 +129,10 @@ fun NewPublicMessageScreen( to?.let { postViewModel.load(it) } - replyId?.let { accountViewModel.getNoteIfExists(it) }?.let { + replyId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.reply(it) } - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastAuthors.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastAuthors.kt index e5b4c014ea..65b4ceb89f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastAuthors.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/podcasts/PodcastAuthors.kt @@ -91,10 +91,10 @@ private fun PodcastAuthorRow( accountViewModel: AccountViewModel, nav: INav, ) { - var user by remember(author.pubKey) { mutableStateOf(accountViewModel.getUserIfExists(author.pubKey)) } + var user by remember(author.pubKey) { mutableStateOf(LocalCache.getUserIfExists(author.pubKey)) } if (user == null) { LaunchedEffect(author.pubKey) { - user = accountViewModel.checkGetOrCreateUser(author.pubKey) + user = LocalCache.checkGetOrCreateUser(author.pubKey) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/polls/PollPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/polls/PollPostScreen.kt index 102f0dc38d..38eacaafdc 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/polls/PollPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/polls/PollPostScreen.kt @@ -25,6 +25,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.ui.navigation.navs.Nav import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.home.NewPostScreenInner @@ -44,7 +45,7 @@ fun PollPostScreen( postViewModel.init(accountViewModel) LaunchedEffect(postViewModel, accountViewModel) { - val draft = draftId?.let { accountViewModel.getNoteIfExists(it) } + val draft = draftId?.let { LocalCache.getNoteIfExists(it) } postViewModel.load(null, null, null, null, draft) message?.ifBlank { null }?.let { postViewModel.message.setTextAndPlaceCursorAtEnd(it) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/badges/DisplayBadges.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/badges/DisplayBadges.kt index 37e2865fe1..238d1815a0 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/badges/DisplayBadges.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/profile/header/badges/DisplayBadges.kt @@ -107,8 +107,8 @@ fun DisplayBadges( val oldDesign = AcceptedBadgeSetEvent.createAddress(baseUser.pubkeyHex) val newDesign = ProfileBadgesEvent.createAddress(baseUser.pubkeyHex) - val oldNote = accountViewModel.getOrCreateAddressableNote(oldDesign) - val newNote = accountViewModel.getOrCreateAddressableNote(newDesign) + val oldNote = LocalCache.getOrCreateAddressableNote(oldDesign) + val newNote = LocalCache.getOrCreateAddressableNote(newDesign) WatchAndRenderBadgeList(baseUser, oldNote, newNote, accountViewModel, nav) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/AppSettingsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/AppSettingsScreen.kt index 4f580033c9..64512a87ce 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/AppSettingsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/AppSettingsScreen.kt @@ -73,6 +73,14 @@ import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbol import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.AccentColorType +import com.vitorpamplona.amethyst.commons.model.BooleanType +import com.vitorpamplona.amethyst.commons.model.ConnectivityType +import com.vitorpamplona.amethyst.commons.model.FeatureSetType +import com.vitorpamplona.amethyst.commons.model.FontFamilyType +import com.vitorpamplona.amethyst.commons.model.FontSizeType +import com.vitorpamplona.amethyst.commons.model.ThemeType +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.accent_color import com.vitorpamplona.amethyst.commons.resources.accent_color_description @@ -122,14 +130,6 @@ import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonRow import com.vitorpamplona.amethyst.commons.ui.theme.contentColorOnAccent import com.vitorpamplona.amethyst.commons.ui.theme.isLight -import com.vitorpamplona.amethyst.model.AccentColorType -import com.vitorpamplona.amethyst.model.BooleanType -import com.vitorpamplona.amethyst.model.ConnectivityType -import com.vitorpamplona.amethyst.model.FeatureSetType -import com.vitorpamplona.amethyst.model.FontFamilyType -import com.vitorpamplona.amethyst.model.FontSizeType -import com.vitorpamplona.amethyst.model.ThemeType -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.theme.previewColor import com.vitorpamplona.amethyst.ui.theme.toFontFamily diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ComposeSettingsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ComposeSettingsScreen.kt index 933b81c1ee..3f0691f2b7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ComposeSettingsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ComposeSettingsScreen.kt @@ -45,6 +45,8 @@ import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbol import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.BooleanType +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.add_client_tag_explainer import com.vitorpamplona.amethyst.commons.resources.add_client_tag_title @@ -96,8 +98,6 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarWithBackBu import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn import com.vitorpamplona.amethyst.model.AccountPoWPreferences -import com.vitorpamplona.amethyst.model.BooleanType -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.service.ai.WritingAssistantFactory import com.vitorpamplona.amethyst.service.pow.deviceHashesPerSecond import com.vitorpamplona.amethyst.service.pow.loadApproxDuration diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/HomeTabsSettingsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/HomeTabsSettingsScreen.kt index 838ca8b799..ba83376d7a 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/HomeTabsSettingsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/HomeTabsSettingsScreen.kt @@ -36,6 +36,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbol import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols import com.vitorpamplona.amethyst.commons.model.HomeFeedType +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.conversations import com.vitorpamplona.amethyst.commons.resources.home_content_type_articles @@ -72,7 +73,6 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarWithBackButton import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonRow -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel import org.jetbrains.compose.resources.StringResource diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ProfileUiSettingsScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ProfileUiSettingsScreen.kt index e533d60817..eaabce04cb 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ProfileUiSettingsScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/ProfileUiSettingsScreen.kt @@ -34,6 +34,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.ProfileGalleryType +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.gallery_style import com.vitorpamplona.amethyst.commons.resources.gallery_style_description @@ -50,8 +52,6 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarWithBackButton import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonRow -import com.vitorpamplona.amethyst.model.ProfileGalleryType -import com.vitorpamplona.amethyst.model.UiSettingsFlow import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/SecurityFiltersScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/SecurityFiltersScreen.kt index 0e38c36ff5..3c0ba84919 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/SecurityFiltersScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/settings/SecurityFiltersScreen.kt @@ -38,7 +38,9 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.WarningType import com.vitorpamplona.amethyst.commons.model.navigation.Route +import com.vitorpamplona.amethyst.commons.model.parseWarningType import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.blocked_users import com.vitorpamplona.amethyst.commons.resources.filter_spam_from_strangers_explainer @@ -65,8 +67,6 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarWithBackButton import com.vitorpamplona.amethyst.commons.ui.stringRes import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn -import com.vitorpamplona.amethyst.model.WarningType -import com.vitorpamplona.amethyst.model.parseWarningType import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.mockAccountViewModel diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/url/UrlPostScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/url/UrlPostScreen.kt index 5a2cdbba51..cb8b3032c1 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/url/UrlPostScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/url/UrlPostScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.platform.LocalContext import androidx.core.net.toUri import androidx.lifecycle.viewmodel.compose.viewModel +import com.vitorpamplona.amethyst.commons.model.cache.LocalCache import com.vitorpamplona.amethyst.ui.actions.uploads.SelectedMedia import com.vitorpamplona.amethyst.ui.navigation.navs.Nav import com.vitorpamplona.amethyst.ui.note.nip22Comments.CommentPostViewModel @@ -59,13 +60,13 @@ fun UrlPostScreen( postViewModel.newPostFor(UrlId(normalizedUrl)) } } - replyId?.let { accountViewModel.getNoteIfExists(it) }?.let { + replyId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.reply(it) } - draftId?.let { accountViewModel.getNoteIfExists(it) }?.let { + draftId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.editFromDraft(it) } - quoteId?.let { accountViewModel.getNoteIfExists(it) }?.let { + quoteId?.let { LocalCache.getNoteIfExists(it) }?.let { postViewModel.quote(it) } message?.ifBlank { null }?.let { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/workouts/suggestion/DetectedWorkoutCarousel.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/workouts/suggestion/DetectedWorkoutCarousel.kt index fb28dfd9fd..ffc23b3d25 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/workouts/suggestion/DetectedWorkoutCarousel.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/workouts/suggestion/DetectedWorkoutCarousel.kt @@ -60,6 +60,7 @@ import com.vitorpamplona.amethyst.commons.fitness.TrainingLog import com.vitorpamplona.amethyst.commons.fitness.WorkoutOrigin import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.BooleanType import com.vitorpamplona.amethyst.commons.model.navigation.Route import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.workout_from_health_connect @@ -71,7 +72,6 @@ import com.vitorpamplona.amethyst.commons.resources.workout_suggestion_connect_t import com.vitorpamplona.amethyst.commons.resources.workout_suggestion_distance_km import com.vitorpamplona.amethyst.commons.ui.pluralStringRes import com.vitorpamplona.amethyst.commons.ui.stringRes -import com.vitorpamplona.amethyst.model.BooleanType import com.vitorpamplona.amethyst.service.workouts.health.HealthConnectManager import com.vitorpamplona.amethyst.service.workouts.health.publishedWorkoutsOf import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 78ea2ecf9d..5521b8f719 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -44,8 +44,15 @@ import com.patrykandpatrick.vico.compose.common.VicoTheme import com.patrykandpatrick.vico.compose.common.VicoTheme.CandlestickCartesianLayerColors import com.vitorpamplona.amethyst.Amethyst import com.vitorpamplona.amethyst.commons.icons.symbols.ProvideAppIcons +import com.vitorpamplona.amethyst.commons.model.AccentColorType +import com.vitorpamplona.amethyst.commons.model.FontFamilyType +import com.vitorpamplona.amethyst.commons.model.FontSizeType +import com.vitorpamplona.amethyst.commons.model.ThemeType import com.vitorpamplona.amethyst.commons.ui.components.LocalAnimationsEnabled import com.vitorpamplona.amethyst.commons.ui.components.LocalProfilePictureCache +import com.vitorpamplona.amethyst.commons.ui.screen.DisplaySettings +import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings +import com.vitorpamplona.amethyst.commons.ui.screen.collectDisplaySettings import com.vitorpamplona.amethyst.commons.ui.theme.AccentBlueDark import com.vitorpamplona.amethyst.commons.ui.theme.AccentBlueLight import com.vitorpamplona.amethyst.commons.ui.theme.AccentGreenDark @@ -66,11 +73,6 @@ import com.vitorpamplona.amethyst.commons.ui.theme.amethystLightColorScheme import com.vitorpamplona.amethyst.commons.ui.theme.isLight import com.vitorpamplona.amethyst.commons.ui.theme.transparentBackground import com.vitorpamplona.amethyst.commons.ui.theme.withFontFamily -import com.vitorpamplona.amethyst.model.AccentColorType -import com.vitorpamplona.amethyst.model.FeatureSetType -import com.vitorpamplona.amethyst.model.FontFamilyType -import com.vitorpamplona.amethyst.model.FontSizeType -import com.vitorpamplona.amethyst.model.ThemeType // The accent color (primary/secondary/tertiary) is user-selectable in Settings -> Accent Color. // Purple keeps the original Amethyst look (purple primary + teal secondary). Every other accent @@ -148,9 +150,9 @@ fun AmethystTheme(content: @Composable () -> Unit) { val accentColor by uiPrefs.accentColor.collectAsStateWithLifecycle() val fontFamily by uiPrefs.fontFamily.collectAsStateWithLifecycle() val fontSize by uiPrefs.fontSize.collectAsStateWithLifecycle() - val featureSet by uiPrefs.featureSet.collectAsStateWithLifecycle() + val displaySettings = collectDisplaySettings(Amethyst.instance.uiState) - AmethystTheme(theme, accentColor, fontFamily, fontSize, animationsEnabled = featureSet != FeatureSetType.PERFORMANCE, content = content) + AmethystTheme(theme, accentColor, fontFamily, fontSize, displaySettings, content) } @Composable @@ -159,7 +161,7 @@ fun AmethystTheme( accentColor: AccentColorType = AccentColorType.PURPLE, fontFamily: FontFamilyType = FontFamilyType.SYSTEM, fontSize: FontSizeType = FontSizeType.NORMAL, - animationsEnabled: Boolean = true, + displaySettings: DisplaySettings = DisplaySettings(), content: @Composable () -> Unit, ) { // Deliberately no UiModeManager.nightMode write: changing the device night mode needs @@ -196,8 +198,9 @@ fun AmethystTheme( LocalDensity provides scaledDensity, // ImageLoaderSetup registers the avatar thumbnail cache and the local Blossom bridge. LocalProfilePictureCache provides true, + LocalDisplaySettings provides displaySettings, // Performance mode turns decorative animations (crossfades) off app-wide. - LocalAnimationsEnabled provides animationsEnabled, + LocalAnimationsEnabled provides !displaySettings.performanceMode, LocalTextStyle provides LocalTextStyle.current.merge(TextStyle(fontFamily = resolvedFontFamily)), content = content, ) diff --git a/amethyst/src/play/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt b/amethyst/src/play/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt index dc32830cc4..0915fcb2d2 100644 --- a/amethyst/src/play/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt +++ b/amethyst/src/play/java/com/vitorpamplona/amethyst/ui/components/SelectNotificationProvider.kt @@ -29,7 +29,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.google.accompanist.permissions.ExperimentalPermissionsApi import com.google.accompanist.permissions.isGranted import com.google.accompanist.permissions.rememberPermissionState -import com.vitorpamplona.amethyst.model.UiSettingsFlow +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow @OptIn(ExperimentalPermissionsApi::class) @Composable diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettings.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettings.kt similarity index 99% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettings.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettings.kt index 159afa0514..1246f0b855 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettings.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettings.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model +package com.vitorpamplona.amethyst.commons.model import androidx.compose.runtime.Stable import com.vitorpamplona.amethyst.commons.resources.Res diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettingsFlow.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettingsFlow.kt similarity index 99% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettingsFlow.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettingsFlow.kt index d2528689c2..6a0870cfa8 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/UiSettingsFlow.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/model/UiSettingsFlow.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.model +package com.vitorpamplona.amethyst.commons.model import androidx.compose.runtime.Stable import kotlinx.coroutines.flow.Flow diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/UserAvatar.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/UserAvatar.kt index 1e294c544f..a8d470f9f7 100644 --- a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/UserAvatar.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/UserAvatar.kt @@ -30,6 +30,7 @@ import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.unit.Dp +import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings /** * Wrapper class for profile picture URLs that signals Coil to use the thumbnail @@ -58,7 +59,8 @@ val LocalProfilePictureCache = staticCompositionLocalOf { false } * @param size Size of the avatar (both width and height) * @param modifier Additional modifiers to apply * @param contentDescription Accessibility description - * @param loadProfilePicture Whether to load the profile picture (false = show robohash only) + * @param loadProfilePicture Whether to load the profile picture (false = show robohash only). + * Defaults to the user's display settings ([LocalDisplaySettings]), as do the next two. * @param loadRobohash Whether to generate robohash (false = show generic icon) * @param autoPlayGif Whether animated (GIF/AVIF) pictures play. Only Android can animate them; * desktop shows their first frame either way. @@ -74,9 +76,9 @@ fun UserAvatar( size: Dp, modifier: Modifier = Modifier, contentDescription: String? = null, - loadProfilePicture: Boolean = true, - loadRobohash: Boolean = true, - autoPlayGif: Boolean = true, + loadProfilePicture: Boolean = LocalDisplaySettings.current.showProfilePictures, + loadRobohash: Boolean = LocalDisplaySettings.current.loadRobohash, + autoPlayGif: Boolean = LocalDisplaySettings.current.autoPlayVideos, badge: @Composable (BoxScope.() -> Unit)? = null, ) { if (badge != null) { diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ResourceToastMsg.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ResourceToastMsg.kt similarity index 95% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ResourceToastMsg.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ResourceToastMsg.kt index e8a3c263c8..11b62ccb8d 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ResourceToastMsg.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ResourceToastMsg.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts +package com.vitorpamplona.amethyst.commons.ui.components.toasts import androidx.compose.runtime.Immutable import org.jetbrains.compose.resources.StringResource diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/StringToastMsg.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/StringToastMsg.kt similarity index 95% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/StringToastMsg.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/StringToastMsg.kt index 9a50a24425..ecfdd7a0c2 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/StringToastMsg.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/StringToastMsg.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts +package com.vitorpamplona.amethyst.commons.ui.components.toasts import androidx.compose.runtime.Immutable diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ThrowableToastMsg.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ThrowableToastMsg.kt similarity index 95% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ThrowableToastMsg.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ThrowableToastMsg.kt index 2d7f77f9f3..8236773234 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ThrowableToastMsg.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ThrowableToastMsg.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts +package com.vitorpamplona.amethyst.commons.ui.components.toasts import androidx.compose.runtime.Immutable import org.jetbrains.compose.resources.StringResource diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastManager.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastManager.kt similarity index 92% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastManager.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastManager.kt index 2e30e70d17..9d95a7b633 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastManager.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastManager.kt @@ -18,12 +18,12 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts +package com.vitorpamplona.amethyst.commons.ui.components.toasts import androidx.compose.runtime.Stable import com.vitorpamplona.amethyst.commons.model.User -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.MultiErrorToastMsg -import com.vitorpamplona.amethyst.ui.components.toasts.multiline.UserBasedErrorMessage +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.MultiErrorToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline.UserBasedErrorMessage import kotlinx.coroutines.flow.MutableStateFlow import org.jetbrains.compose.resources.StringResource diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastMsg.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastMsg.kt similarity index 94% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastMsg.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastMsg.kt index b57e7a4ac6..91e73080bd 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/ToastMsg.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/ToastMsg.kt @@ -18,7 +18,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts +package com.vitorpamplona.amethyst.commons.ui.components.toasts import androidx.compose.runtime.Immutable diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiErrorToastMsg.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/multiline/MultiErrorToastMsg.kt similarity index 92% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiErrorToastMsg.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/multiline/MultiErrorToastMsg.kt index 2d7c34bf76..644d8a7e3e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/toasts/multiline/MultiErrorToastMsg.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/components/toasts/multiline/MultiErrorToastMsg.kt @@ -18,11 +18,11 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.components.toasts.multiline +package com.vitorpamplona.amethyst.commons.ui.components.toasts.multiline import androidx.compose.runtime.Immutable import com.vitorpamplona.amethyst.commons.model.User -import com.vitorpamplona.amethyst.ui.components.toasts.ToastMsg +import com.vitorpamplona.amethyst.commons.ui.components.toasts.ToastMsg import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.update import org.jetbrains.compose.resources.StringResource diff --git a/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/DisplaySettings.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/DisplaySettings.kt new file mode 100644 index 0000000000..ef3ffd4222 --- /dev/null +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/DisplaySettings.kt @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2025 Vitor Pamplona + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the + * Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package com.vitorpamplona.amethyst.commons.ui.screen + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.Immutable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import com.vitorpamplona.amethyst.commons.model.FeatureSetType + +/** + * The display choices composables read on almost every card, resolved once near the composition + * root and handed down through [LocalDisplaySettings], so shared composables do not need the + * account's ViewModel to follow them. + * + * The defaults are what a front end without these settings (previews, desktop today) gets: + * everything on. + */ +@Immutable +data class DisplaySettings( + /** Load profile pictures (off on metered connections when the user asked for WIFI_ONLY). */ + val showProfilePictures: Boolean = true, + /** Performance mode: skip robohashes, crossfades and other decoration. */ + val performanceMode: Boolean = false, + /** Play videos and animated images (GIF/AVIF avatars) without a tap. */ + val autoPlayVideos: Boolean = true, + val showUrlPreview: Boolean = true, + val showImages: Boolean = true, + val startVideoPlayback: Boolean = true, +) { + /** Robohash fallbacks are skipped in performance mode (a plain face icon instead). */ + val loadRobohash: Boolean get() = !performanceMode +} + +val LocalDisplaySettings = staticCompositionLocalOf { DisplaySettings() } + +/** Collects [settings] into a [DisplaySettings] that follows every change to it. */ +@Composable +fun collectDisplaySettings(settings: UiSettingsState): DisplaySettings { + val showProfilePictures by settings.showProfilePictures.collectAsStateWithLifecycle() + val featureSet by settings.uiSettingsFlow.featureSet.collectAsStateWithLifecycle() + val autoPlayVideos by settings.autoPlayVideosFlow.collectAsStateWithLifecycle() + val showUrlPreview by settings.showUrlPreview.collectAsStateWithLifecycle() + val showImages by settings.showImages.collectAsStateWithLifecycle() + val startVideoPlayback by settings.startVideoPlayback.collectAsStateWithLifecycle() + + return remember(showProfilePictures, featureSet, autoPlayVideos, showUrlPreview, showImages, startVideoPlayback) { + DisplaySettings( + showProfilePictures = showProfilePictures, + performanceMode = featureSet == FeatureSetType.PERFORMANCE, + autoPlayVideos = autoPlayVideos, + showUrlPreview = showUrlPreview, + showImages = showImages, + startVideoPlayback = startVideoPlayback, + ) + } +} diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/UiSettingsState.kt b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState.kt similarity index 94% rename from amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/UiSettingsState.kt rename to commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState.kt index ea6ed3fce7..e5620b83e6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/UiSettingsState.kt +++ b/commonsUI/src/commonMain/kotlin/com/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState.kt @@ -18,14 +18,14 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.vitorpamplona.amethyst.ui.screen +package com.vitorpamplona.amethyst.commons.ui.screen import androidx.compose.runtime.Stable -import com.vitorpamplona.amethyst.model.BooleanType -import com.vitorpamplona.amethyst.model.ConnectivityType -import com.vitorpamplona.amethyst.model.FeatureSetType -import com.vitorpamplona.amethyst.model.ProfileGalleryType -import com.vitorpamplona.amethyst.model.UiSettingsFlow +import com.vitorpamplona.amethyst.commons.model.BooleanType +import com.vitorpamplona.amethyst.commons.model.ConnectivityType +import com.vitorpamplona.amethyst.commons.model.FeatureSetType +import com.vitorpamplona.amethyst.commons.model.ProfileGalleryType +import com.vitorpamplona.amethyst.commons.model.UiSettingsFlow import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.StateFlow