Repository: pantasystem/Milktea
Branch: develop
Commit: c3ebf4aabb94
Files: 2173
Total size: 15.0 MB
Directory structure:
gitextract_c5wa7o3u/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── -------.md
│ │ ├── -----.md
│ │ ├── bug_report.md
│ │ ├── feature_request.md
│ │ └── other.md
│ ├── dependabot.yml
│ └── workflows/
│ ├── android-unit-test.yml
│ ├── release.yml
│ └── release2github.yml
├── .gitignore
├── .idea/
│ ├── .gitignore
│ ├── AndroidProjectSystem.xml
│ ├── GitLink.xml
│ ├── deploymentTargetSelector.xml
│ ├── deviceManager.xml
│ ├── encodings.xml
│ ├── jarRepositories.xml
│ ├── kotlinc.xml
│ └── markdown.xml
├── CLAUDE.md
├── CONTRIBUTING.md
├── LICENSE
├── PushToFCM/
│ ├── .dockerignore
│ ├── .gitignore
│ ├── README.md
│ ├── docker/
│ │ ├── Dockerfile
│ │ └── node/
│ │ └── Dockerfile
│ ├── docker-compose.yml
│ ├── index.js
│ ├── key/
│ │ └── .gitignore
│ ├── keyGenerator.js
│ ├── locales/
│ │ ├── en.json
│ │ └── ja.json
│ ├── notification_builder.js
│ ├── package.json
│ └── webPushDecipher.js
├── README-EN.md
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── google-services.json
│ ├── proguard-rules.pro
│ ├── schemas/
│ │ └── jp.panta.misskeyandroidclient.model.DataBase/
│ │ ├── 10.json
│ │ ├── 11.json
│ │ ├── 12.json
│ │ ├── 3.json
│ │ ├── 4.json
│ │ ├── 5.json
│ │ ├── 6.json
│ │ ├── 7.json
│ │ ├── 8.json
│ │ └── 9.json
│ └── src/
│ ├── androidTest/
│ │ └── java/
│ │ ├── jp/
│ │ │ └── panta/
│ │ │ └── misskeyandroidclient/
│ │ │ ├── ExampleInstrumentedTest.kt
│ │ │ └── model/
│ │ │ ├── account/
│ │ │ │ └── db/
│ │ │ │ └── RoomAccountRepositoryTest.kt
│ │ │ └── instance/
│ │ │ └── db/
│ │ │ └── RoomMetaDataSourceTest.kt
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── model/
│ │ └── filter/
│ │ └── MastodonFilterServiceTest.kt
│ ├── benchmark/
│ │ └── java/
│ │ └── jp/
│ │ └── panta/
│ │ └── misskeyandroidclient/
│ │ ├── di/
│ │ │ └── module/
│ │ │ ├── ReleaseAPIModule.kt
│ │ │ └── ReleaseAppModule.kt
│ │ └── util/
│ │ └── EmptyDebuggerSetupManagerImpl.kt
│ ├── debug/
│ │ └── java/
│ │ └── jp/
│ │ └── panta/
│ │ └── misskeyandroidclient/
│ │ └── util/
│ │ └── di/
│ │ └── module/
│ │ ├── DebugAPIModule.kt
│ │ └── DebugAppModule.kt
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── jp/
│ │ │ └── panta/
│ │ │ └── misskeyandroidclient/
│ │ │ ├── AlarmNotePostReceiver.kt
│ │ │ ├── FCMService.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── MiApplication.kt
│ │ │ ├── ThemeUtil.kt
│ │ │ ├── di/
│ │ │ │ ├── entorypoint/
│ │ │ │ │ └── InitializerEntryPoint.kt
│ │ │ │ └── module/
│ │ │ │ ├── AccountModule.kt
│ │ │ │ ├── AppLoggerModule.kt
│ │ │ │ ├── CoroutineScopeModule.kt
│ │ │ │ ├── CustomAuthStoreModule.kt
│ │ │ │ ├── EmojiModule.kt
│ │ │ │ ├── EncryptionModule.kt
│ │ │ │ ├── NavigationModule.kt
│ │ │ │ ├── NoteModule.kt
│ │ │ │ ├── PageableModule.kt
│ │ │ │ ├── PushSubscriptionModule.kt
│ │ │ │ ├── TaskExecutorsModule.kt
│ │ │ │ └── ThemeModule.kt
│ │ │ ├── impl/
│ │ │ │ ├── AndroidDefaultLogger.kt
│ │ │ │ ├── AndroidNoteReservationPostExecutor.kt
│ │ │ │ ├── CheckEmojiAndroidImpl.kt
│ │ │ │ ├── NavigationModule.kt
│ │ │ │ ├── OkHttpClientProviderImpl.kt
│ │ │ │ └── PageDefaultStringsOnAndroid.kt
│ │ │ ├── media/
│ │ │ │ └── CoilApngDecoder.kt
│ │ │ ├── setup/
│ │ │ │ └── AppStateController.kt
│ │ │ ├── startup/
│ │ │ │ ├── DebuggerSetupInitializer.kt
│ │ │ │ └── EmojiCompatInitializer.kt
│ │ │ ├── ui/
│ │ │ │ ├── BottomNavigationLongClickListener.kt
│ │ │ │ ├── PageableFragmentFactoryImpl.kt
│ │ │ │ ├── main/
│ │ │ │ │ ├── AccountViewModelHandler.kt
│ │ │ │ │ ├── ChangeNavMenuVisibilityFromAPIVersion.kt
│ │ │ │ │ ├── ConfirmCrashlyticsDialog.kt
│ │ │ │ │ ├── ConfirmGoogleAnalyticsDialog.kt
│ │ │ │ │ ├── FabClickHandler.kt
│ │ │ │ │ ├── IntentToAddAccountHandler.kt
│ │ │ │ │ ├── MainActivityEventHandler.kt
│ │ │ │ │ ├── MainActivityInitialIntentHandler.kt
│ │ │ │ │ ├── MainActivityMenuProvider.kt
│ │ │ │ │ ├── MainActivityNavigationDrawerMenuItemClickListener.kt
│ │ │ │ │ ├── NoteCreateResultHandler.kt
│ │ │ │ │ ├── NotePostFailedDialogFragment.kt
│ │ │ │ │ ├── SafeSearchDescriptionDialog.kt
│ │ │ │ │ ├── SetSimpleEditor.kt
│ │ │ │ │ ├── SetUpNavHeader.kt
│ │ │ │ │ ├── SetupOnBackPressedDispatcherHandler.kt
│ │ │ │ │ ├── ShowBottomNavigationBadgeDelegate.kt
│ │ │ │ │ ├── ShowRequestSchedulePostResultSnackBar.kt
│ │ │ │ │ ├── ToggleNavigationDrawerDelegate.kt
│ │ │ │ │ └── viewmodel/
│ │ │ │ │ └── MainViewModel.kt
│ │ │ │ ├── strings_helper/
│ │ │ │ │ └── web_socket_error.kt
│ │ │ │ └── tab/
│ │ │ │ ├── TabFragment.kt
│ │ │ │ ├── TabViewModel.kt
│ │ │ │ └── TimelinePagerAdapter.kt
│ │ │ ├── util/
│ │ │ │ ├── DebuggerSetupManager.kt
│ │ │ │ ├── DoubleBackPressedFinishDelegate.kt
│ │ │ │ └── task/
│ │ │ │ └── task_coroutines_util.kt
│ │ │ └── worker/
│ │ │ └── WorkerJobInitializer.kt
│ │ └── res/
│ │ ├── layout/
│ │ │ ├── activity_main.xml
│ │ │ ├── app_bar_main.xml
│ │ │ ├── content_main.xml
│ │ │ ├── fragment_tab.xml
│ │ │ └── nav_header_main.xml
│ │ ├── mipmap-anydpi-v26/
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── navigation/
│ │ │ └── main_nav.xml
│ │ ├── values/
│ │ │ └── values.xml
│ │ ├── values-v21/
│ │ │ └── styles.xml
│ │ ├── values-v23/
│ │ │ ├── styles.xml
│ │ │ └── themes.xml
│ │ ├── values-v27/
│ │ │ └── themes.xml
│ │ ├── values-w320dp/
│ │ │ └── values.xml
│ │ ├── values-w480dp/
│ │ │ └── values.xml
│ │ ├── values-w600dp/
│ │ │ └── values.xml
│ │ ├── values-w720dp/
│ │ │ └── values.xml
│ │ └── xml/
│ │ └── shortcuts.xml
│ ├── release/
│ │ └── java/
│ │ └── jp/
│ │ └── panta/
│ │ └── misskeyandroidclient/
│ │ └── di/
│ │ └── module/
│ │ ├── EmptyDebuggerSetupManagerImpl.kt
│ │ ├── ReleaseAPIModule.kt
│ │ └── ReleaseAppModule.kt
│ └── test/
│ └── java/
│ ├── jp/
│ │ └── panta/
│ │ └── misskeyandroidclient/
│ │ ├── GsonNullInstantTest.kt
│ │ ├── api/
│ │ │ ├── APIErrorTest.kt
│ │ │ ├── mastodon/
│ │ │ │ ├── emojis/
│ │ │ │ │ └── TootEmojiDTOTest.kt
│ │ │ │ └── instance/
│ │ │ │ └── InstanceTest.kt
│ │ │ ├── misskey/
│ │ │ │ └── v12/
│ │ │ │ └── channel/
│ │ │ │ └── ChannelDTOTest.kt
│ │ │ └── notes/
│ │ │ └── NoteDTOTest.kt
│ │ ├── logger/
│ │ │ └── TestLogger.kt
│ │ ├── model/
│ │ │ ├── account/
│ │ │ │ ├── AccountInstanceTypeConverterTest.kt
│ │ │ │ ├── AccountStateTest.kt
│ │ │ │ ├── AccountTest.kt
│ │ │ │ ├── MakeDefaultPagesUseCaseTest.kt
│ │ │ │ ├── TestAccountRepository.kt
│ │ │ │ └── page/
│ │ │ │ └── PageableChannelTimelineTest.kt
│ │ │ ├── api/
│ │ │ │ ├── GetUsersTest.kt
│ │ │ │ ├── HashTagListTest.kt
│ │ │ │ └── VersionTest.kt
│ │ │ ├── channel/
│ │ │ │ └── ChannelStateTest.kt
│ │ │ ├── file/
│ │ │ │ └── AppFileTest.kt
│ │ │ ├── instance/
│ │ │ │ └── MetaCacheTest.kt
│ │ │ ├── notes/
│ │ │ │ ├── impl/
│ │ │ │ │ ├── InMemoryNoteDataSourceTest.kt
│ │ │ │ │ └── NoteCaptureAPIAdapterTest.kt
│ │ │ │ └── poll/
│ │ │ │ └── PollTest.kt
│ │ │ ├── reaction/
│ │ │ │ └── impl/
│ │ │ │ └── ReactionHistoryPaginatorImplTest.kt
│ │ │ └── users/
│ │ │ ├── UserTest.kt
│ │ │ └── nickname/
│ │ │ ├── DeleteNicknameUseCaseTest.kt
│ │ │ └── UpdateNicknameUseCaseTest.kt
│ │ ├── streaming/
│ │ │ ├── SendBodyTest.kt
│ │ │ ├── StreamingEventTest.kt
│ │ │ ├── TestSocketImpl.kt
│ │ │ ├── TestSocketWithAccountProviderImpl.kt
│ │ │ ├── channel/
│ │ │ │ └── ChannelAPITest.kt
│ │ │ └── network/
│ │ │ └── SocketImplTest.kt
│ │ ├── ui/
│ │ │ └── users/
│ │ │ └── viewmodel/
│ │ │ └── search/
│ │ │ └── SearchUserTest.kt
│ │ └── util/
│ │ ├── EncryptionStub.kt
│ │ └── StringIndexTest.kt
│ └── net/
│ └── pantasystem/
│ └── milktea/
│ ├── data/
│ │ └── infrastructure/
│ │ ├── emoji/
│ │ │ └── CustomEmojiInserterTest.kt
│ │ └── note/
│ │ └── draft/
│ │ └── db/
│ │ └── DraftNoteDTOTest.kt
│ └── note/
│ ├── editor/
│ │ └── viewmodel/
│ │ └── NoteEditorUiStateKtTest.kt
│ └── media/
│ └── viewmodel/
│ └── MediaViewDataTest.kt
├── benchmark/
│ ├── .gitignore
│ ├── build.gradle
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── java/
│ └── systems/
│ └── panta/
│ └── benchmark/
│ └── ExampleStartupBenchmark.kt
├── build.gradle
├── csae_policy_ja.md
├── docs/
│ ├── mfm-decorator-implementation-guide.md
│ ├── migrate-dynamic-feature-flag-plan.md
│ ├── note-editor-compose-migration-plan.md
│ └── note-editor-reply-preview-mfm-plan.md
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── libs.versions.toml
├── modules/
│ ├── api/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── api/
│ │ │ ├── activitypub/
│ │ │ │ ├── NodeInfoAPI.kt
│ │ │ │ ├── NodeInfoDTO.kt
│ │ │ │ ├── WellKnownNodeInfo.kt
│ │ │ │ └── WellKnownNodeInfoAPI.kt
│ │ │ ├── mastodon/
│ │ │ │ ├── MastodonAPI.kt
│ │ │ │ ├── accounts/
│ │ │ │ │ ├── FollowParamsRequest.kt
│ │ │ │ │ ├── MastodonAccountDTO.kt
│ │ │ │ │ └── MuteAccountRequest.kt
│ │ │ │ ├── apps/
│ │ │ │ │ └── App.kt
│ │ │ │ ├── context/
│ │ │ │ │ └── ContextDTO.kt
│ │ │ │ ├── emojis/
│ │ │ │ │ └── TootEmojiDTO.kt
│ │ │ │ ├── filter/
│ │ │ │ │ ├── FilterContext.kt
│ │ │ │ │ ├── FilterResultDTO.kt
│ │ │ │ │ ├── V1FilterDTO.kt
│ │ │ │ │ └── V2FilterDTO.kt
│ │ │ │ ├── instance/
│ │ │ │ │ └── Instance.kt
│ │ │ │ ├── list/
│ │ │ │ │ ├── AddAccountsToList.kt
│ │ │ │ │ ├── CreateListRequest.kt
│ │ │ │ │ └── ListDTO.kt
│ │ │ │ ├── marker/
│ │ │ │ │ └── MarkerDTO.kt
│ │ │ │ ├── media/
│ │ │ │ │ ├── TootMediaAttachment.kt
│ │ │ │ │ └── UpdateMediaAttachment.kt
│ │ │ │ ├── notification/
│ │ │ │ │ └── MstNotificationDTO.kt
│ │ │ │ ├── poll/
│ │ │ │ │ └── TootPollDTO.kt
│ │ │ │ ├── report/
│ │ │ │ │ ├── CreateReportRequest.kt
│ │ │ │ │ └── MstReportDTO.kt
│ │ │ │ ├── rule/
│ │ │ │ │ └── RuleDTO.kt
│ │ │ │ ├── search/
│ │ │ │ │ └── SearchResponse.kt
│ │ │ │ ├── status/
│ │ │ │ │ ├── CreateStatus.kt
│ │ │ │ │ ├── ScheduledStatus.kt
│ │ │ │ │ ├── TootPreviewCardDTO.kt
│ │ │ │ │ └── TootStatusDTO.kt
│ │ │ │ ├── subscription/
│ │ │ │ │ ├── SubscribePushNotification.kt
│ │ │ │ │ ├── WebPushSubscription.kt
│ │ │ │ │ └── WebPushSubscriptionAlerts.kt
│ │ │ │ ├── suggestion/
│ │ │ │ │ └── SuggestionDTO.kt
│ │ │ │ └── tag/
│ │ │ │ └── MastodonTagDTO.kt
│ │ │ ├── milktea/
│ │ │ │ ├── CreateInstanceRequest.kt
│ │ │ │ ├── InstanceInfoResponse.kt
│ │ │ │ ├── MilkteaAPIService.kt
│ │ │ │ ├── MilkteaAPIServiceBuilder.kt
│ │ │ │ └── instance/
│ │ │ │ └── ticker/
│ │ │ │ ├── InstanceTickerAPIService.kt
│ │ │ │ ├── InstanceTickerAPIServiceBuilder.kt
│ │ │ │ └── InstanceTickerNetworkDTO.kt
│ │ │ └── misskey/
│ │ │ ├── EmptyRequest.kt
│ │ │ ├── I.kt
│ │ │ ├── InstanceInfosAPI.kt
│ │ │ ├── MisskeyAPI.kt
│ │ │ ├── MisskeyAPIServiceBuilder.kt
│ │ │ ├── MisskeyAuthAPI.kt
│ │ │ ├── ap/
│ │ │ │ ├── ApResolveRequest.kt
│ │ │ │ └── ApResolveResult.kt
│ │ │ ├── app/
│ │ │ │ ├── CreateApp.kt
│ │ │ │ └── ShowApp.kt
│ │ │ ├── auth/
│ │ │ │ ├── AccessToken.kt
│ │ │ │ ├── App.kt
│ │ │ │ ├── AppSecret.kt
│ │ │ │ ├── Session.kt
│ │ │ │ ├── SignInRequest.kt
│ │ │ │ ├── SignInResponse.kt
│ │ │ │ └── UserKey.kt
│ │ │ ├── clip/
│ │ │ │ ├── AddNoteToClipRequest.kt
│ │ │ │ ├── ClipDTO.kt
│ │ │ │ ├── CreateClipRequest.kt
│ │ │ │ ├── DeleteClipRequest.kt
│ │ │ │ ├── FindNotesClip.kt
│ │ │ │ ├── FindUsersClipRequest.kt
│ │ │ │ └── ShowClipRequest.kt
│ │ │ ├── drive/
│ │ │ │ ├── CreateFolder.kt
│ │ │ │ ├── DeleteFileReq.kt
│ │ │ │ ├── DirectoryNetworkDTO.kt
│ │ │ │ ├── FilePropertyDTO.kt
│ │ │ │ ├── RequestFile.kt
│ │ │ │ ├── RequestFolder.kt
│ │ │ │ ├── ShowFile.kt
│ │ │ │ ├── ShowFolderRequest.kt
│ │ │ │ └── UpdateFileDTO.kt
│ │ │ ├── emoji/
│ │ │ │ ├── CustomEmojiNetworkDTO.kt
│ │ │ │ └── EmojisType.kt
│ │ │ ├── favorite/
│ │ │ │ └── Favorite.kt
│ │ │ ├── groups/
│ │ │ │ ├── Actions.kt
│ │ │ │ ├── GroupDTO.kt
│ │ │ │ └── InvitationDTO.kt
│ │ │ ├── hashtag/
│ │ │ │ ├── RequestHashTagList.kt
│ │ │ │ └── SearchHashtagRequest.kt
│ │ │ ├── infos/
│ │ │ │ ├── InstanceInfosResponse.kt
│ │ │ │ └── SimpleInstanceInfo.kt
│ │ │ ├── instance/
│ │ │ │ ├── MetaNetworkDTO.kt
│ │ │ │ └── RequestMeta.kt
│ │ │ ├── list/
│ │ │ │ ├── CreateList.kt
│ │ │ │ ├── ListId.kt
│ │ │ │ ├── ListUserOperation.kt
│ │ │ │ ├── UpdateList.kt
│ │ │ │ └── UserListDTO.kt
│ │ │ ├── messaging/
│ │ │ │ ├── MessageAction.kt
│ │ │ │ ├── MessageDTO.kt
│ │ │ │ ├── RequestMessage.kt
│ │ │ │ └── RequestMessageHistory.kt
│ │ │ ├── notes/
│ │ │ │ ├── CreateNote.kt
│ │ │ │ ├── CreateReactionDTO.kt
│ │ │ │ ├── DeleteNote.kt
│ │ │ │ ├── FindRenotes.kt
│ │ │ │ ├── GetNoteChildrenRequest.kt
│ │ │ │ ├── NoteDTO.kt
│ │ │ │ ├── NoteRequest.kt
│ │ │ │ ├── NoteStateResponse.kt
│ │ │ │ ├── PollDTO.kt
│ │ │ │ ├── Vote.kt
│ │ │ │ ├── favorite/
│ │ │ │ │ ├── CreateFavorite.kt
│ │ │ │ │ └── DeleteFavorite.kt
│ │ │ │ ├── mute/
│ │ │ │ │ └── ToggleThreadMuteRequest.kt
│ │ │ │ ├── reaction/
│ │ │ │ │ ├── ReactionHistoryDTO.kt
│ │ │ │ │ └── RequestReactionHistoryDTO.kt
│ │ │ │ └── translation/
│ │ │ │ ├── Translate.kt
│ │ │ │ └── TranslationResult.kt
│ │ │ ├── notification/
│ │ │ │ ├── NotificationDTO.kt
│ │ │ │ └── NotificationRequest.kt
│ │ │ ├── online/
│ │ │ │ └── user/
│ │ │ │ └── OnlineUserCount.kt
│ │ │ ├── register/
│ │ │ │ ├── WebConfigReactions.kt
│ │ │ │ └── subscription.kt
│ │ │ ├── trend/
│ │ │ │ └── HashtagTrend.kt
│ │ │ ├── users/
│ │ │ │ ├── AcceptFollowRequest.kt
│ │ │ │ ├── CancelFollow.kt
│ │ │ │ ├── CreateMuteUserRequest.kt
│ │ │ │ ├── FollowFollowerUser.kt
│ │ │ │ ├── FollowRequestDTO.kt
│ │ │ │ ├── GetFollowRequest.kt
│ │ │ │ ├── RejectFollowRequest.kt
│ │ │ │ ├── RequestUser.kt
│ │ │ │ ├── SearchByUserAndHost.kt
│ │ │ │ ├── UserDTO.kt
│ │ │ │ ├── follow/
│ │ │ │ │ ├── FollowUserRequest.kt
│ │ │ │ │ ├── UnFollowUserRequest.kt
│ │ │ │ │ └── UpdateUserFollowRequest.kt
│ │ │ │ ├── renote/
│ │ │ │ │ └── mute/
│ │ │ │ │ ├── CreateRenoteMuteRequest.kt
│ │ │ │ │ ├── DeleteRenoteMuteRequest.kt
│ │ │ │ │ └── RenoteMuteDTO.kt
│ │ │ │ └── report/
│ │ │ │ └── ReportDTO.kt
│ │ │ ├── v10/
│ │ │ │ ├── FollowFollowerUsers.kt
│ │ │ │ └── RequestFollowFollower.kt
│ │ │ ├── v12/
│ │ │ │ ├── MisskeyAPIV12.kt
│ │ │ │ ├── MisskeyAPIV12Diff.kt
│ │ │ │ ├── antenna/
│ │ │ │ │ ├── AntennaDTO.kt
│ │ │ │ │ ├── AntennaQuery.kt
│ │ │ │ │ └── AntennaToAdd.kt
│ │ │ │ ├── channel/
│ │ │ │ │ └── channels.kt
│ │ │ │ └── user/
│ │ │ │ └── reaction/
│ │ │ │ ├── UserReaction.kt
│ │ │ │ └── UserReactionRequest.kt
│ │ │ ├── v12_75_0/
│ │ │ │ └── gallery.kt
│ │ │ └── v13/
│ │ │ └── EmojisResponse.kt
│ │ └── test/
│ │ ├── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── api/
│ │ │ ├── CurrentClassLoader.kt
│ │ │ ├── mastodon/
│ │ │ │ ├── instance/
│ │ │ │ │ └── InstanceTest.kt
│ │ │ │ └── status/
│ │ │ │ └── TootStatusDTOTest.kt
│ │ │ └── misskey/
│ │ │ ├── ap/
│ │ │ │ └── ApResolveResultTest.kt
│ │ │ ├── infos/
│ │ │ │ └── InstanceInfosResponseTest.kt
│ │ │ ├── users/
│ │ │ │ ├── BaseUserDTOTest.kt
│ │ │ │ └── UserDTOTest.kt
│ │ │ └── v10/
│ │ │ ├── FollowFollowerUsersTest.kt
│ │ │ └── RequestFollowFollowerTest.kt
│ │ └── resources/
│ │ ├── fedibird_instance_info.json
│ │ ├── mastodonsocial_instance_info.json
│ │ ├── mstdnjp_instance_info.json
│ │ ├── pawoonet_instance_info.json
│ │ ├── toot_fedibird_com_home_has_quote_timeline.json
│ │ ├── toot_fedibird_com_home_timeline.json
│ │ ├── toot_fedibird_com_home_timeline_2.json
│ │ ├── toot_fedibird_com_home_timeline_3.json
│ │ ├── toot_fedibird_com_home_timeline_4.json
│ │ ├── toot_fedibird_com_home_timeline_5.json
│ │ ├── toot_fedibird_com_home_timeline_6.json
│ │ ├── toot_fedibird_com_home_timeline_7.json
│ │ ├── toot_fedibird_com_home_timeline_8.json
│ │ ├── toot_mstdn_jp_public_timeline.json
│ │ ├── user_dto_give_harunon_case1.json
│ │ ├── user_dto_list_case1.json
│ │ ├── v10_followers_case1.json
│ │ └── v10_user_dto_give_harunon_case1.json
│ ├── api_streaming/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── api_streaming/
│ │ ├── NoteCaptureAPI.kt
│ │ ├── Socket.kt
│ │ ├── SocketEventListener.kt
│ │ ├── channel/
│ │ │ ├── ChannelAPI.kt
│ │ │ └── user_timeline_extenstion.kt
│ │ ├── events.kt
│ │ ├── mastodon/
│ │ │ ├── Event.kt
│ │ │ ├── StreamingAPI.kt
│ │ │ └── StreamingAPIImpl.kt
│ │ ├── network/
│ │ │ └── SocketImpl.kt
│ │ ├── pollings.kt
│ │ └── sends.kt
│ ├── app_store/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── app_store/
│ │ ├── account/
│ │ │ ├── AccountState.kt
│ │ │ └── AccountStore.kt
│ │ ├── drive/
│ │ │ ├── DriveDirectoryPagingStore.kt
│ │ │ └── FilePropertyPagingStore.kt
│ │ ├── gallery/
│ │ │ ├── GalleryPostSendFavoriteStore.kt
│ │ │ └── GalleryPostsStore.kt
│ │ ├── handler/
│ │ │ └── UserActionAppGlobalErrorStore.kt
│ │ ├── messaging/
│ │ │ └── MessagePagingStore.kt
│ │ ├── notes/
│ │ │ ├── NoteTranslationStore.kt
│ │ │ └── TimelineStore.kt
│ │ ├── setting/
│ │ │ └── SettingStore.kt
│ │ └── user/
│ │ ├── FollowFollowerPagingStore.kt
│ │ └── UserReactionPagingStore.kt
│ ├── common/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── common/
│ │ │ │ ├── ByteSizeHelper.kt
│ │ │ │ ├── ColorUtil.kt
│ │ │ │ ├── Encryption.kt
│ │ │ │ ├── Hash.kt
│ │ │ │ ├── Logger.kt
│ │ │ │ ├── MastodonLinkHeaderDecoder.kt
│ │ │ │ ├── ResultHelper.kt
│ │ │ │ ├── SharedPreferenceUtil.kt
│ │ │ │ ├── collection/
│ │ │ │ │ └── LRUCache.kt
│ │ │ │ ├── coroutines/
│ │ │ │ │ ├── CombineExt.kt
│ │ │ │ │ ├── PessimisticCollectiveMutex.kt
│ │ │ │ │ └── Throttle.kt
│ │ │ │ ├── dhash/
│ │ │ │ │ └── ImageDHash.kt
│ │ │ │ ├── errors.kt
│ │ │ │ ├── glide/
│ │ │ │ │ ├── GlideUtils.kt
│ │ │ │ │ ├── MiGlideModule.kt
│ │ │ │ │ ├── apng/
│ │ │ │ │ │ ├── ApngDecoder.kt
│ │ │ │ │ │ ├── FrameSeqDecoderBitmapTranscoder.kt
│ │ │ │ │ │ ├── FrameSeqDecoderDrawableTranscoder.kt
│ │ │ │ │ │ └── StreamApngDecoder.kt
│ │ │ │ │ ├── blurhash/
│ │ │ │ │ │ ├── BlurHash.kt
│ │ │ │ │ │ ├── BlurHashModelLoader.kt
│ │ │ │ │ │ ├── BlurHashResourceDecoder.kt
│ │ │ │ │ │ ├── BlurHashSource.kt
│ │ │ │ │ │ └── BlurhashDecoder.kt
│ │ │ │ │ └── svg/
│ │ │ │ │ ├── SvgDecoder.kt
│ │ │ │ │ └── SvgDrawableTranscoder.kt
│ │ │ │ ├── paginator/
│ │ │ │ │ ├── EntityConverter.kt
│ │ │ │ │ ├── FutureCacheSaver.kt
│ │ │ │ │ ├── FutureLoader.kt
│ │ │ │ │ ├── FuturePaginator.kt
│ │ │ │ │ ├── FuturePagingController.kt
│ │ │ │ │ ├── IdFutureLoader.kt
│ │ │ │ │ ├── IdGetter.kt
│ │ │ │ │ ├── IdPreviousLoader.kt
│ │ │ │ │ ├── MediatorFuturePagingController.kt
│ │ │ │ │ ├── MediatorPreviousPagingController.kt
│ │ │ │ │ ├── PaginationState.kt
│ │ │ │ │ ├── PreviousCacheSaver.kt
│ │ │ │ │ ├── PreviousLoader.kt
│ │ │ │ │ ├── PreviousPaginator.kt
│ │ │ │ │ ├── PreviousPagingController.kt
│ │ │ │ │ └── StateLocker.kt
│ │ │ │ ├── serializations/
│ │ │ │ │ ├── DateSerializer.kt
│ │ │ │ │ ├── EnumIgnoreUnknownSerializer.kt
│ │ │ │ │ └── FallbackDefaultValueSerializer.kt
│ │ │ │ ├── state_helper.kt
│ │ │ │ ├── suspend_state_util.kt
│ │ │ │ ├── text/
│ │ │ │ │ ├── Levenshtein.kt
│ │ │ │ │ └── UrlPatternChecker.kt
│ │ │ │ └── ui/
│ │ │ │ ├── ApplyTheme.kt
│ │ │ │ ├── AvatarIconView.kt
│ │ │ │ ├── CircleImageIconHelper.kt
│ │ │ │ ├── LazyColumnScrollStateHelper.kt
│ │ │ │ ├── PageableView.kt
│ │ │ │ ├── SimpleElapsedTime.kt
│ │ │ │ └── ToolbarSetter.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ ├── ic_cloud_off_black_24dp.xml
│ │ │ │ └── ic_content_copy_black_24dp.xml
│ │ │ ├── values/
│ │ │ │ ├── attrs.xml
│ │ │ │ └── strings.xml
│ │ │ ├── values-ja/
│ │ │ │ └── strings.xml
│ │ │ └── values-zh/
│ │ │ └── strings.xml
│ │ └── test/
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── common/
│ │ ├── ByteSizeHelperKtTest.kt
│ │ ├── coroutines/
│ │ │ └── PessimisticCollectiveMutexTest.kt
│ │ ├── paginator/
│ │ │ ├── FuturePagingControllerTest.kt
│ │ │ └── PreviousPagingControllerTest.kt
│ │ └── ui/
│ │ └── SimpleElapsedTimeTest.kt
│ ├── common_android/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── common_android/
│ │ │ ├── debug/
│ │ │ │ └── DebugFeatureFlags.kt
│ │ │ ├── emoji/
│ │ │ │ └── V13EmojiUrlResolver.kt
│ │ │ ├── hilt/
│ │ │ │ ├── HiltCoroutineDispatcherAnnotation.kt
│ │ │ │ └── di/
│ │ │ │ └── module/
│ │ │ │ └── CoroutineDispatcherModule.kt
│ │ │ ├── html/
│ │ │ │ └── MastodonHTML.kt
│ │ │ ├── mfm/
│ │ │ │ └── MFMParser.kt
│ │ │ ├── notification/
│ │ │ │ └── NotificationUtil.kt
│ │ │ ├── nyaize/
│ │ │ │ └── Nyaize.kt
│ │ │ ├── platform/
│ │ │ │ ├── FlowBroadcastReceiver.kt
│ │ │ │ ├── NetworkEventFlow.kt
│ │ │ │ ├── NetworkStatusUtil.kt
│ │ │ │ └── PermissionUtil.kt
│ │ │ ├── resource/
│ │ │ │ ├── DpHelper.kt
│ │ │ │ └── StringResource.kt
│ │ │ └── ui/
│ │ │ ├── ActivityUtils.kt
│ │ │ ├── AutoCollapsingLayout.kt
│ │ │ ├── BottomSheetViewPager.kt
│ │ │ ├── CircleOutlineHelper.kt
│ │ │ ├── FontSizeUnitConverter.kt
│ │ │ ├── MediaLayout.kt
│ │ │ ├── RoundedOutlineProvider.kt
│ │ │ ├── SafeUnbox.kt
│ │ │ ├── StringHelper.kt
│ │ │ ├── VisibilityHelper.kt
│ │ │ ├── haptic/
│ │ │ │ └── HapticFeedbackController.kt
│ │ │ ├── listview/
│ │ │ │ └── FlexBoxLayoutHelper.kt
│ │ │ └── text/
│ │ │ ├── CustomEmojiDecorator.kt
│ │ │ ├── CustomEmojiTokenizer.kt
│ │ │ ├── DateFormatHelper.kt
│ │ │ ├── DrawableEmojiSpan.kt
│ │ │ ├── EmojiAdapter.kt
│ │ │ ├── EmojiSpan.kt
│ │ │ └── GetElapsedTimeStringSource.kt
│ │ └── res/
│ │ ├── drawable/
│ │ │ └── ic_close_black_24dp.xml
│ │ └── values/
│ │ └── attrs.xml
│ ├── common_android_ui/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ ├── StringSourceHelper.kt
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── common_android_ui/
│ │ │ ├── APIErrorStringConverter.kt
│ │ │ ├── AvatarIconViewBindingAdapter.kt
│ │ │ ├── BindingProvider.kt
│ │ │ ├── DecorateTextHelper.kt
│ │ │ ├── DrawableTintCompat.kt
│ │ │ ├── EmojiText.kt
│ │ │ ├── MFMDecorator.kt
│ │ │ ├── MediaPreviewAspectLayout.kt
│ │ │ ├── MfmBorderSpan.kt
│ │ │ ├── MfmFlipSpan.kt
│ │ │ ├── MfmRotateSpan.kt
│ │ │ ├── MfmRubySpan.kt
│ │ │ ├── MfmText.kt
│ │ │ ├── PageableFragmentFactory.kt
│ │ │ ├── ReactionViewHelper.kt
│ │ │ ├── TextType.kt
│ │ │ ├── UserPinnedNotesFragmentFactory.kt
│ │ │ ├── UserTransitionHelper.kt
│ │ │ ├── ViewBackgroundColorHelper.kt
│ │ │ ├── account/
│ │ │ │ ├── AccountSwitchingDialog.kt
│ │ │ │ ├── AccountSwitchingDialogLayout.kt
│ │ │ │ ├── AccountTile.kt
│ │ │ │ ├── page/
│ │ │ │ │ └── PageTypeHelper.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── AccountViewModel.kt
│ │ │ │ ├── AccountViewModelUiState.kt
│ │ │ │ └── AccountViewModelUiStateHelper.kt
│ │ │ ├── error/
│ │ │ │ └── UserActionAppGlobalErrorListener.kt
│ │ │ ├── reaction/
│ │ │ │ ├── ReactionAutoCompleteArrayAdapter.kt
│ │ │ │ └── ReactionChoicesAdapter.kt
│ │ │ ├── report/
│ │ │ │ ├── ReportDialog.kt
│ │ │ │ └── ReportViewModel.kt
│ │ │ ├── tab/
│ │ │ │ ├── TabViewCompositeClickListener.kt
│ │ │ │ └── TabbedFlexboxListMediator.kt
│ │ │ └── user/
│ │ │ ├── FollowRequestsFragmentFactory.kt
│ │ │ ├── UserChipListAdapter.kt
│ │ │ └── UserTextHelper.kt
│ │ └── res/
│ │ ├── layout/
│ │ │ ├── dialog_report.xml
│ │ │ ├── dialog_switch_account.xml
│ │ │ ├── item_reaction_choice.xml
│ │ │ ├── item_reaction_preview.xml
│ │ │ └── item_user_chip.xml
│ │ └── values/
│ │ └── tags.xml
│ ├── common_compose/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── common_compose/
│ │ │ ├── AvatarIcon.kt
│ │ │ ├── BlurhashPainter.kt
│ │ │ ├── CircleCheckbox.kt
│ │ │ ├── ComposeAndFragment.kt
│ │ │ ├── CustomEmojiText.kt
│ │ │ ├── ElapsedTimeUtil.kt
│ │ │ ├── FavoriteButton.kt
│ │ │ ├── HorizontalFilePreviewList.kt
│ │ │ ├── MilkteaTheme.kt
│ │ │ ├── RadioTile.kt
│ │ │ ├── SensitiveIcon.kt
│ │ │ ├── Spinner.kt
│ │ │ ├── SwitchTile.kt
│ │ │ ├── drive/
│ │ │ │ ├── EditCaptionDialogLayout.kt
│ │ │ │ └── EditFileNameDialogLayout.kt
│ │ │ └── haptic/
│ │ │ └── HapticFeedback.kt
│ │ └── res/
│ │ ├── values/
│ │ │ └── strings.xml
│ │ ├── values-ja-rJP/
│ │ │ └── strings.xml
│ │ └── values-zh/
│ │ └── strings.xml
│ ├── common_navigation/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── common_navigation/
│ │ ├── AccountSettingNavigation.kt
│ │ ├── ActivityNavigation.kt
│ │ ├── AntennaNavigation.kt
│ │ ├── AuthorizationNavigation.kt
│ │ ├── ChannelNavigation.kt
│ │ ├── ClipNavigation.kt
│ │ ├── DriveNavigation.kt
│ │ ├── MainNavigation.kt
│ │ ├── MediaNavigation.kt
│ │ ├── MessageNavigation.kt
│ │ ├── SearchAndSelectUserNavigation.kt
│ │ ├── SearchNavigation.kt
│ │ ├── TimelineMachineNavigation.kt
│ │ ├── UserDetailNavigation.kt
│ │ └── UserListNavigation.kt
│ ├── common_resource/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ └── res/
│ │ ├── drawable/
│ │ │ ├── bottom_navigation_colors.xml
│ │ │ ├── ic_access_time_black_24dp.xml
│ │ │ ├── ic_account_circle_24px.xml
│ │ │ ├── ic_account_circle_40px.xml
│ │ │ ├── ic_account_circle_48px.xml
│ │ │ ├── ic_add_black_24dp.xml
│ │ │ ├── ic_add_circle_outline_black_24dp.xml
│ │ │ ├── ic_add_to_tab_24px.xml
│ │ │ ├── ic_arrow_back_black_24dp.xml
│ │ │ ├── ic_attach_file_black_24dp.xml
│ │ │ ├── ic_attachment_24px.xml
│ │ │ ├── ic_baseline_edit_calendar_24.xml
│ │ │ ├── ic_baseline_favorite_border_24.xml
│ │ │ ├── ic_baseline_hide_image_24.xml
│ │ │ ├── ic_baseline_image_24.xml
│ │ │ ├── ic_baseline_keyboard_arrow_down_24.xml
│ │ │ ├── ic_baseline_radio_24.xml
│ │ │ ├── ic_baseline_report_gmailerrorred_24.xml
│ │ │ ├── ic_baseline_report_problem_24.xml
│ │ │ ├── ic_baseline_translate_24.xml
│ │ │ ├── ic_call_received_black_24dp.xml
│ │ │ ├── ic_chat_bubble_outline_black_24dp.xml
│ │ │ ├── ic_check_black_24dp.xml
│ │ │ ├── ic_chevron_right_black_24dp.xml
│ │ │ ├── ic_clear_black_24dp.xml
│ │ │ ├── ic_cloud_black_24dp.xml
│ │ │ ├── ic_cloud_queue_black_24dp.xml
│ │ │ ├── ic_compass.xml
│ │ │ ├── ic_delete_black_24dp.xml
│ │ │ ├── ic_done_black_24dp.xml
│ │ │ ├── ic_drafts_black_24dp.xml
│ │ │ ├── ic_edit_black_24dp.xml
│ │ │ ├── ic_email_black_24dp.xml
│ │ │ ├── ic_expand_less_black_24dp.xml
│ │ │ ├── ic_expand_more_black_24dp.xml
│ │ │ ├── ic_folder_black_24dp.xml
│ │ │ ├── ic_folder_open_black_24dp.xml
│ │ │ ├── ic_follow.xml
│ │ │ ├── ic_format_list_bulleted_black_24dp.xml
│ │ │ ├── ic_format_quote_black_24dp.xml
│ │ │ ├── ic_groups.xml
│ │ │ ├── ic_history_black_24dp.xml
│ │ │ ├── ic_home_black_24dp.xml
│ │ │ ├── ic_info_black_24dp.xml
│ │ │ ├── ic_insert_emoticon_black_24dp.xml
│ │ │ ├── ic_insert_link_black_24dp.xml
│ │ │ ├── ic_keyboard_arrow_right_black_24dp.xml
│ │ │ ├── ic_keyboard_black_24dp.xml
│ │ │ ├── ic_language_black_24dp.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── ic_light.xml
│ │ │ ├── ic_lightbulb_outline_black_24dp.xml
│ │ │ ├── ic_list_add_black_24dp.xml
│ │ │ ├── ic_lock_black_24dp.xml
│ │ │ ├── ic_mention.xml
│ │ │ ├── ic_menu_black_24dp.xml
│ │ │ ├── ic_menu_camera.xml
│ │ │ ├── ic_menu_gallery.xml
│ │ │ ├── ic_menu_manage.xml
│ │ │ ├── ic_menu_send.xml
│ │ │ ├── ic_menu_share.xml
│ │ │ ├── ic_menu_slideshow.xml
│ │ │ ├── ic_message_black_24dp.xml
│ │ │ ├── ic_mode_edit_black_24dp.xml
│ │ │ ├── ic_more_horiz_black_24dp.xml
│ │ │ ├── ic_more_vert_black_24dp.xml
│ │ │ ├── ic_music_note_black_24dp.xml
│ │ │ ├── ic_notifications_black_24dp.xml
│ │ │ ├── ic_notifications_fill_40px.xml
│ │ │ ├── ic_notifications_fill_48px.xml
│ │ │ ├── ic_notifications_none_black_24dp.xml
│ │ │ ├── ic_notifications_outlined_40px.xml
│ │ │ ├── ic_notifications_outlined_48px.xml
│ │ │ ├── ic_person_add_black_24dp.xml
│ │ │ ├── ic_person_black_24dp.xml
│ │ │ ├── ic_play_circle_outline_black_24dp.xml
│ │ │ ├── ic_poll_black_24dp.xml
│ │ │ ├── ic_re_note.xml
│ │ │ ├── ic_refresh_black_24dp.xml
│ │ │ ├── ic_remove_black_24dp.xml
│ │ │ ├── ic_remove_circle_outline_black_24dp.xml
│ │ │ ├── ic_remove_to_tab_24px.xml
│ │ │ ├── ic_reply_black_24dp.xml
│ │ │ ├── ic_save_black_24dp.xml
│ │ │ ├── ic_search_40px.xml
│ │ │ ├── ic_search_48px.xml
│ │ │ ├── ic_search_black_24dp.xml
│ │ │ ├── ic_selectable_drive.xml
│ │ │ ├── ic_selectable_file.xml
│ │ │ ├── ic_selectable_message.xml
│ │ │ ├── ic_selectable_notification.xml
│ │ │ ├── ic_settings_black_24dp.xml
│ │ │ ├── ic_sharp.xml
│ │ │ ├── ic_star.xml
│ │ │ ├── ic_star_black_24dp.xml
│ │ │ ├── ic_star_border_black_24dp.xml
│ │ │ ├── ic_star_state.xml
│ │ │ ├── ic_supervisor_account_black_24dp.xml
│ │ │ ├── ic_sync_alt_24px.xml
│ │ │ ├── ic_visibility_off_black_24dp.xml
│ │ │ ├── ic_zoom_out_map_black_24dp.xml
│ │ │ ├── shape_chip.xml
│ │ │ ├── shape_message_recipient.xml
│ │ │ ├── shape_message_self.xml
│ │ │ ├── shape_messages_badge.xml
│ │ │ ├── shape_normal_reaction_backgruond.xml
│ │ │ ├── shape_rounded_square_line.xml
│ │ │ ├── shape_selected_reaction_background.xml
│ │ │ ├── side_nav_bar.xml
│ │ │ └── tab_dot_background.xml
│ │ ├── menu/
│ │ │ ├── activity_auth_menu.xml
│ │ │ ├── activity_custom_app_menu.xml
│ │ │ ├── activity_main_drawer.xml
│ │ │ ├── activity_search_menu.xml
│ │ │ ├── activity_sign_in_menu.xml
│ │ │ ├── activity_user_menu.xml
│ │ │ ├── bottom_menu.xml
│ │ │ ├── main.xml
│ │ │ ├── menu_drive.xml
│ │ │ ├── menu_search.xml
│ │ │ ├── menu_user_list_detail.xml
│ │ │ ├── note_detail_menu.xml
│ │ │ ├── search_top_menu.xml
│ │ │ ├── tab_pager_menu.xml
│ │ │ └── tab_setting_menu.xml
│ │ ├── values/
│ │ │ ├── arrays.xml
│ │ │ ├── attrs.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── strings.xml
│ │ │ ├── styles.xml
│ │ │ ├── themes.xml
│ │ │ └── values.xml
│ │ ├── values-ja/
│ │ │ └── strings.xml
│ │ └── values-zh/
│ │ └── strings.xml
│ ├── common_viewmodel/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ └── common_viewmodel/
│ │ ├── CurrentPageableTimelineViewModel.kt
│ │ ├── ScrollToTopViewModel.kt
│ │ └── UserViewData.kt
│ ├── data/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── objectbox-models/
│ │ │ ├── default.json
│ │ │ └── default.json.bak
│ │ ├── proguard-rules.pro
│ │ ├── schemas/
│ │ │ ├── net.pantasystem.milktea.data.infrastructure.DataBase/
│ │ │ │ ├── 10.json
│ │ │ │ ├── 11.json
│ │ │ │ ├── 12.json
│ │ │ │ ├── 13.json
│ │ │ │ ├── 14.json
│ │ │ │ ├── 15.json
│ │ │ │ ├── 16.json
│ │ │ │ ├── 17.json
│ │ │ │ ├── 18.json
│ │ │ │ ├── 19.json
│ │ │ │ ├── 20.json
│ │ │ │ ├── 21.json
│ │ │ │ ├── 22.json
│ │ │ │ ├── 23.json
│ │ │ │ ├── 24.json
│ │ │ │ ├── 25.json
│ │ │ │ ├── 26.json
│ │ │ │ ├── 27.json
│ │ │ │ ├── 28.json
│ │ │ │ ├── 29.json
│ │ │ │ ├── 3.json
│ │ │ │ ├── 30.json
│ │ │ │ ├── 31.json
│ │ │ │ ├── 32.json
│ │ │ │ ├── 33.json
│ │ │ │ ├── 34.json
│ │ │ │ ├── 35.json
│ │ │ │ ├── 36.json
│ │ │ │ ├── 37.json
│ │ │ │ ├── 38.json
│ │ │ │ ├── 39.json
│ │ │ │ ├── 4.json
│ │ │ │ ├── 40.json
│ │ │ │ ├── 41.json
│ │ │ │ ├── 42.json
│ │ │ │ ├── 43.json
│ │ │ │ ├── 44.json
│ │ │ │ ├── 45.json
│ │ │ │ ├── 46.json
│ │ │ │ ├── 47.json
│ │ │ │ ├── 48.json
│ │ │ │ ├── 49.json
│ │ │ │ ├── 5.json
│ │ │ │ ├── 50.json
│ │ │ │ ├── 51.json
│ │ │ │ ├── 52.json
│ │ │ │ ├── 53.json
│ │ │ │ ├── 54.json
│ │ │ │ ├── 55.json
│ │ │ │ ├── 56.json
│ │ │ │ ├── 57.json
│ │ │ │ ├── 58.json
│ │ │ │ ├── 59.json
│ │ │ │ ├── 6.json
│ │ │ │ ├── 60.json
│ │ │ │ ├── 61.json
│ │ │ │ ├── 62.json
│ │ │ │ ├── 63.json
│ │ │ │ ├── 64.json
│ │ │ │ ├── 65.json
│ │ │ │ ├── 66.json
│ │ │ │ ├── 67.json
│ │ │ │ ├── 68.json
│ │ │ │ ├── 69.json
│ │ │ │ ├── 7.json
│ │ │ │ ├── 70.json
│ │ │ │ ├── 71.json
│ │ │ │ ├── 72.json
│ │ │ │ ├── 73.json
│ │ │ │ ├── 74.json
│ │ │ │ ├── 8.json
│ │ │ │ └── 9.json
│ │ │ ├── net.pantasystem.milktea.data.model.DataBase/
│ │ │ │ ├── 10.json
│ │ │ │ ├── 11.json
│ │ │ │ ├── 12.json
│ │ │ │ ├── 3.json
│ │ │ │ ├── 4.json
│ │ │ │ ├── 5.json
│ │ │ │ ├── 6.json
│ │ │ │ ├── 7.json
│ │ │ │ ├── 8.json
│ │ │ │ └── 9.json
│ │ │ └── schemas/
│ │ │ └── jp.panta.misskeyandroidclient.model.DataBase/
│ │ │ ├── 10.json
│ │ │ ├── 11.json
│ │ │ ├── 12.json
│ │ │ ├── 3.json
│ │ │ ├── 4.json
│ │ │ ├── 5.json
│ │ │ ├── 6.json
│ │ │ ├── 7.json
│ │ │ ├── 8.json
│ │ │ └── 9.json
│ │ └── src/
│ │ ├── androidTest/
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── data/
│ │ │ └── infrastructure/
│ │ │ ├── DatabaseMigrationTest.kt
│ │ │ ├── image/
│ │ │ │ └── ImageCacheRepositoryImplTest.kt
│ │ │ ├── note/
│ │ │ │ ├── timeline/
│ │ │ │ │ └── TimelineCacheDAOTest.kt
│ │ │ │ └── wordmute/
│ │ │ │ └── WordFilterConfigRepositoryImplTest.kt
│ │ │ └── settings/
│ │ │ └── LocalConfigRepositoryImplTest.kt
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── data/
│ │ │ ├── api/
│ │ │ │ ├── NodeInfoAPIBuilder.kt
│ │ │ │ ├── mastodon/
│ │ │ │ │ ├── MastodonAPIFactory.kt
│ │ │ │ │ └── MastodonAPIProvider.kt
│ │ │ │ └── misskey/
│ │ │ │ └── MisskeyAPIProvider.kt
│ │ │ ├── converters/
│ │ │ │ ├── ClipDTOEntityConverter.kt
│ │ │ │ ├── FilePropertyDTOEntityConverter.kt
│ │ │ │ ├── GalleryPostDTOEntityConverter.kt
│ │ │ │ ├── MastodonAccountDTOEntityConverter.kt
│ │ │ │ ├── NoteDTOEntityConverter.kt
│ │ │ │ ├── NotificationDTOEntityConverter.kt
│ │ │ │ ├── TootDTOEntityConverter.kt
│ │ │ │ └── UserDTOEntityConverter.kt
│ │ │ ├── di/
│ │ │ │ └── module/
│ │ │ │ ├── AccountModule.kt
│ │ │ │ ├── AntennaModule.kt
│ │ │ │ ├── ApResolverModule.kt
│ │ │ │ ├── BookmarkModule.kt
│ │ │ │ ├── ChannelModule.kt
│ │ │ │ ├── ClipModule.kt
│ │ │ │ ├── CustomEmojiModule.kt
│ │ │ │ ├── DbModule.kt
│ │ │ │ ├── DriveDirectoryModule.kt
│ │ │ │ ├── DriveFileModule.kt
│ │ │ │ ├── FavoriteModule.kt
│ │ │ │ ├── FileModule.kt
│ │ │ │ ├── GalleryModule.kt
│ │ │ │ ├── GetterModule.kt
│ │ │ │ ├── GroupModule.kt
│ │ │ │ ├── HashtagModule.kt
│ │ │ │ ├── ImageCacheBindModule.kt
│ │ │ │ ├── InstanceInfoModule.kt
│ │ │ │ ├── InstanceTickerModule.kt
│ │ │ │ ├── MarkerModule.kt
│ │ │ │ ├── MastodonInstanceInfoModule.kt
│ │ │ │ ├── MessagingModule.kt
│ │ │ │ ├── MetaModule.kt
│ │ │ │ ├── NodeInfoModule.kt
│ │ │ │ ├── NoteModule.kt
│ │ │ │ ├── NotificationModule.kt
│ │ │ │ ├── ReactionModule.kt
│ │ │ │ ├── RenoteMuteModule.kt
│ │ │ │ ├── SearchModule.kt
│ │ │ │ ├── SettingModule.kt
│ │ │ │ ├── SocketModule.kt
│ │ │ │ ├── UrlPreviewModule.kt
│ │ │ │ ├── UserListModule.kt
│ │ │ │ ├── UserModule.kt
│ │ │ │ ├── UserNicknameModule.kt
│ │ │ │ ├── WordFilterConfigModule.kt
│ │ │ │ └── WordFilterModule.kt
│ │ │ ├── infrastructure/
│ │ │ │ ├── DataBase.kt
│ │ │ │ ├── DateConverter.kt
│ │ │ │ ├── MemoryCacheCleaner.kt
│ │ │ │ ├── Migrations.kt
│ │ │ │ ├── MisskeyEntityConverters.kt
│ │ │ │ ├── TootEntityConverters.kt
│ │ │ │ ├── account/
│ │ │ │ │ ├── AuthImpl.kt
│ │ │ │ │ ├── ClientIdRepositoryImpl.kt
│ │ │ │ │ ├── SignOutUseCaseImpl.kt
│ │ │ │ │ ├── converter.kt
│ │ │ │ │ ├── db/
│ │ │ │ │ │ ├── AccountDAO.kt
│ │ │ │ │ │ ├── AccountRecord.kt
│ │ │ │ │ │ ├── AccountRelation.kt
│ │ │ │ │ │ ├── MediatorAccountRepository.kt
│ │ │ │ │ │ └── RoomAccountRepository.kt
│ │ │ │ │ └── page/
│ │ │ │ │ └── db/
│ │ │ │ │ ├── PageDAO.kt
│ │ │ │ │ ├── PageRecord.kt
│ │ │ │ │ ├── PageRecordParams.kt
│ │ │ │ │ └── TimelinePageTypeConverter.kt
│ │ │ │ ├── antenna/
│ │ │ │ │ └── AntennaRepositoryImpl.kt
│ │ │ │ ├── ap/
│ │ │ │ │ └── ApResolverRepositoryImpl.kt
│ │ │ │ ├── auth/
│ │ │ │ │ ├── Authorization.kt
│ │ │ │ │ ├── KeyStoreSystemEncryption.kt
│ │ │ │ │ └── custom/
│ │ │ │ │ ├── AccessToken.kt
│ │ │ │ │ ├── CustomAuthBridge.kt
│ │ │ │ │ └── CustomAuthStore.kt
│ │ │ │ ├── channel/
│ │ │ │ │ ├── ChannelAPIAdapter.kt
│ │ │ │ │ ├── ChannelAPIAdapterWebImpl.kt
│ │ │ │ │ ├── ChannelPagingModel.kt
│ │ │ │ │ └── ChannelRepositoryImpl.kt
│ │ │ │ ├── clip/
│ │ │ │ │ └── ClipRepositoryImpl.kt
│ │ │ │ ├── drive/
│ │ │ │ │ ├── DriveDirectoryPagingStoreImpl.kt
│ │ │ │ │ ├── DriveDirectoryRepositoryImpl.kt
│ │ │ │ │ ├── DriveFileRecord.kt
│ │ │ │ │ ├── DriveFileRecordDao.kt
│ │ │ │ │ ├── DriveFileRepositoryImpl.kt
│ │ │ │ │ ├── FilePaginator.kt
│ │ │ │ │ ├── InMemoryFielPropertyDataSource.kt
│ │ │ │ │ ├── InputStreamRequestBody.kt
│ │ │ │ │ ├── MastodonOkHttpFileUploader.kt
│ │ │ │ │ ├── MediatorFilePropertyDataSource.kt
│ │ │ │ │ ├── MisskeyOkHttpDriveFileUploader.kt
│ │ │ │ │ ├── UriRequestBody.kt
│ │ │ │ │ └── uploaders.kt
│ │ │ │ ├── emoji/
│ │ │ │ │ ├── CustomEmojiApiAdapter.kt
│ │ │ │ │ ├── CustomEmojiAspectRatioDAO.kt
│ │ │ │ │ ├── CustomEmojiAspectRatioDataSourceImpl.kt
│ │ │ │ │ ├── CustomEmojiAspectRatioEntity.kt
│ │ │ │ │ ├── CustomEmojiCache.kt
│ │ │ │ │ ├── CustomEmojiDAO.kt
│ │ │ │ │ ├── CustomEmojiInserter.kt
│ │ │ │ │ ├── CustomEmojiRecord.kt
│ │ │ │ │ ├── CustomEmojiRepositoryImpl.kt
│ │ │ │ │ ├── EmojiEventHandlerImpl.kt
│ │ │ │ │ ├── UserEmojiConfigCache.kt
│ │ │ │ │ └── UserEmojiConfigRepositoryImpl.kt
│ │ │ │ ├── file/
│ │ │ │ │ ├── CopyFileToAppDirRepositoryImpl.kt
│ │ │ │ │ └── UriToAppFileUseCaseImpl.kt
│ │ │ │ ├── filter/
│ │ │ │ │ ├── MastodonWordFilterCache.kt
│ │ │ │ │ ├── MastodonWordFilterRepositoryImpl.kt
│ │ │ │ │ └── db/
│ │ │ │ │ ├── MastodonFilterDao.kt
│ │ │ │ │ └── MastodonWordFilterRecord.kt
│ │ │ │ ├── gallery/
│ │ │ │ │ ├── GalleryRepositoryImpl.kt
│ │ │ │ │ ├── InMemoryGalleryDataSource.kt
│ │ │ │ │ ├── MediatorGalleryPostPaginator.kt
│ │ │ │ │ ├── gallery_posts_paginators.kt
│ │ │ │ │ └── liked_gallery_posts_paginator.kt
│ │ │ │ ├── group/
│ │ │ │ │ ├── GroupDao.kt
│ │ │ │ │ ├── GroupDataSourceImpl.kt
│ │ │ │ │ ├── GroupRecord.kt
│ │ │ │ │ └── GroupRepositoryImpl.kt
│ │ │ │ ├── hashtag/
│ │ │ │ │ └── HashtagRepositoryImpl.kt
│ │ │ │ ├── image/
│ │ │ │ │ ├── ImageCacheDAO.kt
│ │ │ │ │ ├── ImageCacheEntity.kt
│ │ │ │ │ └── ImageCacheRepositoryImpl.kt
│ │ │ │ ├── instance/
│ │ │ │ │ ├── FeatureEnablesImpl.kt
│ │ │ │ │ ├── MastodonInstanceInfoCache.kt
│ │ │ │ │ ├── MastodonInstanceInfoRepositoryImpl.kt
│ │ │ │ │ ├── MetaCache.kt
│ │ │ │ │ ├── MetaRepositoryImpl.kt
│ │ │ │ │ ├── db/
│ │ │ │ │ │ ├── InMemoryMetaDataSource.kt
│ │ │ │ │ │ ├── InstanceInfoDao.kt
│ │ │ │ │ │ ├── InstanceInfoRecord.kt
│ │ │ │ │ │ ├── MastodonInstanceInfoDAO.kt
│ │ │ │ │ │ ├── MastodonInstanceInfoRecord.kt
│ │ │ │ │ │ ├── MediatorMetaDataSource.kt
│ │ │ │ │ │ ├── MetaDAO.kt
│ │ │ │ │ │ ├── MetaDTO.kt
│ │ │ │ │ │ ├── MetaRelation.kt
│ │ │ │ │ │ └── RoomMetaDataSource.kt
│ │ │ │ │ ├── online/
│ │ │ │ │ │ └── user/
│ │ │ │ │ │ └── count/
│ │ │ │ │ │ └── OnlineUserCountRepositoryImpl.kt
│ │ │ │ │ └── ticker/
│ │ │ │ │ ├── InstanceTickerRepositoryImpl.kt
│ │ │ │ │ └── db/
│ │ │ │ │ ├── InstanceTickerDAO.kt
│ │ │ │ │ └── InstanceTickerRecord.kt
│ │ │ │ ├── list/
│ │ │ │ │ ├── UserListDao.kt
│ │ │ │ │ ├── UserListRecord.kt
│ │ │ │ │ └── UserListRepositoryWebAPIImpl.kt
│ │ │ │ ├── markers/
│ │ │ │ │ ├── MarkerCache.kt
│ │ │ │ │ └── MarkerRepositoryImpl.kt
│ │ │ │ ├── messaging/
│ │ │ │ │ ├── MessageDataSource.kt
│ │ │ │ │ ├── MessageObserverImpl.kt
│ │ │ │ │ ├── MessagePagingStoreImpl.kt
│ │ │ │ │ ├── MessageRelationGetterImpl.kt
│ │ │ │ │ ├── MessageRepositoryImpl.kt
│ │ │ │ │ └── MessagingRepositoryImpl.kt
│ │ │ │ ├── nodeinfo/
│ │ │ │ │ ├── NodeInfoCache.kt
│ │ │ │ │ ├── NodeInfoFetcher.kt
│ │ │ │ │ ├── NodeInfoRepositoryImpl.kt
│ │ │ │ │ └── db/
│ │ │ │ │ ├── NodeInfoDao.kt
│ │ │ │ │ └── NodeInfoRecord.kt
│ │ │ │ ├── note/
│ │ │ │ │ ├── FavoriteNoteTimelinePagingStoreImpl.kt
│ │ │ │ │ ├── MastodonTimelineStorePagingStoreImpl.kt
│ │ │ │ │ ├── NoteCaptureAPIAdapterImpl.kt
│ │ │ │ │ ├── NoteCaptureAPIWithAccountProvider.kt
│ │ │ │ │ ├── NoteDataSourceAdder.kt
│ │ │ │ │ ├── NoteEventReducer.kt
│ │ │ │ │ ├── NoteStreamingImpl.kt
│ │ │ │ │ ├── NoteTranslationStoreImpl.kt
│ │ │ │ │ ├── PageParams.kt
│ │ │ │ │ ├── ReplyStreamingImpl.kt
│ │ │ │ │ ├── TimelinePagingStoreImpl.kt
│ │ │ │ │ ├── TimelineScrollPositionRepositoryImpl.kt
│ │ │ │ │ ├── TimelineStoreImpl.kt
│ │ │ │ │ ├── UnusedPageReleaser.kt
│ │ │ │ │ ├── bookmark/
│ │ │ │ │ │ └── BookmarkRepositoryImpl.kt
│ │ │ │ │ ├── draft/
│ │ │ │ │ │ ├── DraftNoteRepositoryImpl.kt
│ │ │ │ │ │ └── db/
│ │ │ │ │ │ ├── DraftFileDTO.kt
│ │ │ │ │ │ ├── DraftNoteDTO.kt
│ │ │ │ │ │ ├── DraftNoteDao.kt
│ │ │ │ │ │ ├── DraftNoteRelation.kt
│ │ │ │ │ │ ├── DraftPollDTO.kt
│ │ │ │ │ │ ├── PollChoiceDTO.kt
│ │ │ │ │ │ └── UserIdDTO.kt
│ │ │ │ │ ├── favorite/
│ │ │ │ │ │ ├── FavoriteAPIAdapter.kt
│ │ │ │ │ │ └── FavoriteRepositoryImpl.kt
│ │ │ │ │ ├── impl/
│ │ │ │ │ │ ├── DraftNoteServiceImpl.kt
│ │ │ │ │ │ ├── InMemoryNoteDataSource.kt
│ │ │ │ │ │ ├── NoteApiAdapter.kt
│ │ │ │ │ │ ├── NoteRepositoryImpl.kt
│ │ │ │ │ │ ├── PostNoteTask.kt
│ │ │ │ │ │ ├── ThreadContextApiAdapter.kt
│ │ │ │ │ │ └── sqlite/
│ │ │ │ │ │ ├── NoteDAO.kt
│ │ │ │ │ │ ├── NoteEntity.kt
│ │ │ │ │ │ ├── NoteThreadDAO.kt
│ │ │ │ │ │ ├── NoteThreadEntity.kt
│ │ │ │ │ │ └── SQLiteNoteDataSource.kt
│ │ │ │ │ ├── reaction/
│ │ │ │ │ │ └── impl/
│ │ │ │ │ │ ├── ReactionAuthorDAO.kt
│ │ │ │ │ │ ├── ReactionAuthorEntity.kt
│ │ │ │ │ │ ├── ReactionRepositoryImpl.kt
│ │ │ │ │ │ ├── ReactionUserRepositoryImpl.kt
│ │ │ │ │ │ ├── history/
│ │ │ │ │ │ │ ├── FrequentlyReactionAndUnFollowedUserRecord.kt
│ │ │ │ │ │ │ ├── ReactionHistoryCountRecord.kt
│ │ │ │ │ │ │ ├── ReactionHistoryDao.kt
│ │ │ │ │ │ │ ├── ReactionHistoryRecord.kt
│ │ │ │ │ │ │ └── ReactionHistoryRepositoryImpl.kt
│ │ │ │ │ │ └── usercustom/
│ │ │ │ │ │ ├── ReactionUserSetting.kt
│ │ │ │ │ │ └── ReactionUserSettingDao.kt
│ │ │ │ │ ├── renote/
│ │ │ │ │ │ └── RenotesPagingService.kt
│ │ │ │ │ ├── timeline/
│ │ │ │ │ │ ├── TimelineCacheDAO.kt
│ │ │ │ │ │ ├── TimelineFetcher.kt
│ │ │ │ │ │ ├── TimelineFetcherImpl.kt
│ │ │ │ │ │ ├── TimelineItemEntity.kt
│ │ │ │ │ │ ├── TimelineLocalDataSource.kt
│ │ │ │ │ │ ├── TimelineLocalDataSourceImpl.kt
│ │ │ │ │ │ ├── TimelineRepositoryImpl.kt
│ │ │ │ │ │ └── favorite/
│ │ │ │ │ │ └── FavoriteTimelineRepositoryImpl.kt
│ │ │ │ │ └── wordmute/
│ │ │ │ │ ├── WordFilterConditionRecord.kt
│ │ │ │ │ ├── WordFilterConfigCache.kt
│ │ │ │ │ ├── WordFilterConfigDao.kt
│ │ │ │ │ └── WordFilterConfigRepositoryImpl.kt
│ │ │ │ ├── notification/
│ │ │ │ │ ├── db/
│ │ │ │ │ │ ├── AccountNotificationCount.kt
│ │ │ │ │ │ ├── NotificationCacheDAO.kt
│ │ │ │ │ │ ├── NotificationEntity.kt
│ │ │ │ │ │ ├── NotificationJsonCacheRecord.kt
│ │ │ │ │ │ ├── NotificationJsonCacheRecordDAO.kt
│ │ │ │ │ │ ├── NotificationTimelineEntity.kt
│ │ │ │ │ │ ├── UnreadNotification.kt
│ │ │ │ │ │ └── UnreadNotificationDAO.kt
│ │ │ │ │ └── impl/
│ │ │ │ │ ├── MediatorNotificationDataSource.kt
│ │ │ │ │ ├── NotificationCacheAdder.kt
│ │ │ │ │ ├── NotificationPagingStoreImpl.kt
│ │ │ │ │ ├── NotificationRepositoryImpl.kt
│ │ │ │ │ ├── NotificationStoreImpl.kt
│ │ │ │ │ ├── NotificationStreamingImpl.kt
│ │ │ │ │ └── NotificationTimelineRepositoryImpl.kt
│ │ │ │ ├── report/
│ │ │ │ │ └── ReportRepositoryImpl.kt
│ │ │ │ ├── search/
│ │ │ │ │ ├── SearchHistoryDao.kt
│ │ │ │ │ ├── SearchHistoryRecord.kt
│ │ │ │ │ └── SearchHistoryRepositoryImpl.kt
│ │ │ │ ├── settings/
│ │ │ │ │ ├── Config.kt
│ │ │ │ │ ├── LocalConfigRepository.kt
│ │ │ │ │ └── Theme.kt
│ │ │ │ ├── streaming/
│ │ │ │ │ ├── MediatorMainEventDispatcher.kt
│ │ │ │ │ ├── StreamingMainEventDispatcher.kt
│ │ │ │ │ ├── StreamingMainMessageEventDispatcher.kt
│ │ │ │ │ ├── StreamingMainNotificationEventDispatcher.kt
│ │ │ │ │ ├── StreamingMainUserEventDispatcher.kt
│ │ │ │ │ └── socket_state.kt
│ │ │ │ ├── sw/
│ │ │ │ │ └── register/
│ │ │ │ │ ├── DeviceTokenRepositoryImpl.kt
│ │ │ │ │ ├── EndpointBuilder.kt
│ │ │ │ │ ├── SubscriptionRegistrationImpl.kt
│ │ │ │ │ └── SubscriptionUnRegistration.kt
│ │ │ │ ├── url/
│ │ │ │ │ ├── MisskeyUrlPreviewStore.kt
│ │ │ │ │ ├── RetrofitMisskeyUrlPreview.kt
│ │ │ │ │ ├── UrlPreviewMediatorStore.kt
│ │ │ │ │ ├── UrlPreviewStoreFactory.kt
│ │ │ │ │ ├── UrlPreviewStoreProvider.kt
│ │ │ │ │ └── db/
│ │ │ │ │ ├── UrlPreviewDAO.kt
│ │ │ │ │ └── UrlPreviewRecord.kt
│ │ │ │ └── user/
│ │ │ │ ├── FollowFollowerPagingModel.kt
│ │ │ │ ├── FollowRequestApiAdapter.kt
│ │ │ │ ├── FollowRequestRepositoryImpl.kt
│ │ │ │ ├── InMemoryUserDataSource.kt
│ │ │ │ ├── MediatorUserDataSource.kt
│ │ │ │ ├── UserActionResult.kt
│ │ │ │ ├── UserApiAdapter.kt
│ │ │ │ ├── UserNicknameDAO.kt
│ │ │ │ ├── UserNicknameRepositoryOnMemoryImpl.kt
│ │ │ │ ├── UserNicknameRepositorySQLiteImpl.kt
│ │ │ │ ├── UserReactionPagingStoreImpl.kt
│ │ │ │ ├── UserRepositoryImpl.kt
│ │ │ │ ├── block/
│ │ │ │ │ ├── BlockApiAdapter.kt
│ │ │ │ │ └── BlockRepositoryImpl.kt
│ │ │ │ ├── db/
│ │ │ │ │ ├── UserDao.kt
│ │ │ │ │ └── UserRecord.kt
│ │ │ │ ├── follow/
│ │ │ │ │ ├── FollowApiAdapter.kt
│ │ │ │ │ └── FollowRepositoryImpl.kt
│ │ │ │ ├── mute/
│ │ │ │ │ ├── MuteApiAdapter.kt
│ │ │ │ │ └── MuteRepositoryImpl.kt
│ │ │ │ └── renote/
│ │ │ │ └── mute/
│ │ │ │ ├── FindAllRemoteRenoteMutes.kt
│ │ │ │ ├── IsSupportRenoteMuteInstance.kt
│ │ │ │ ├── RenoteMuteApiAdapter.kt
│ │ │ │ ├── RenoteMuteCache.kt
│ │ │ │ ├── RenoteMuteRepositoryImpl.kt
│ │ │ │ ├── UnPushedRenoteMutesDiffFilter.kt
│ │ │ │ ├── db/
│ │ │ │ │ ├── RenoteMuteDao.kt
│ │ │ │ │ └── RenoteMuteRecord.kt
│ │ │ │ └── delegate/
│ │ │ │ ├── CreateRenoteMuteAndPushToRemoteDelegate.kt
│ │ │ │ ├── FindRenoteMuteAndUpdateMemCacheDelegate.kt
│ │ │ │ └── SyncRenoteMuteDelegate.kt
│ │ │ └── streaming/
│ │ │ ├── ChannelAPIWithAccountProvider.kt
│ │ │ ├── SocketWithAccountProvider.kt
│ │ │ ├── StreamingAPIProvider.kt
│ │ │ └── impl/
│ │ │ └── SocketWithAccountProviderImpl.kt
│ │ └── test/
│ │ └── java/
│ │ └── net/
│ │ └── pantasystem/
│ │ └── milktea/
│ │ ├── api/
│ │ │ ├── milktea/
│ │ │ │ └── InstanceInfoResponseTest.kt
│ │ │ └── misskey/
│ │ │ └── notes/
│ │ │ ├── CreateNoteTest.kt
│ │ │ └── PollDTOTest.kt
│ │ └── data/
│ │ ├── converters/
│ │ │ ├── NoteDTOEntityConverterTest.kt
│ │ │ └── UserDTOEntityConverterTest.kt
│ │ └── infrastructure/
│ │ ├── account/
│ │ │ ├── db/
│ │ │ │ └── AccountInstanceTypeConverterTest.kt
│ │ │ └── page/
│ │ │ └── db/
│ │ │ └── PageRecordParamsTest.kt
│ │ ├── instance/
│ │ │ └── FeatureEnablesImplTest.kt
│ │ ├── nodeinfo/
│ │ │ ├── NodeInfoFetcherImplTest.kt
│ │ │ └── NodeInfoRepositoryImplTest.kt
│ │ ├── note/
│ │ │ ├── NoteEventReducerKtTest.kt
│ │ │ ├── UnusedPageReleaserTest.kt
│ │ │ └── impl/
│ │ │ └── InMemoryNoteDataSourceTest.kt
│ │ ├── settings/
│ │ │ ├── ConfigKtTest.kt
│ │ │ ├── KeysKtTest.kt
│ │ │ └── ThemeKtTest.kt
│ │ └── user/
│ │ └── renote/
│ │ └── mute/
│ │ ├── FindAllRemoteRenoteMutesTest.kt
│ │ ├── RenoteMuteCacheTest.kt
│ │ ├── RenoteMuteRepositoryImplTest.kt
│ │ ├── UnPushedRenoteMutesDiffFilterTest.kt
│ │ ├── db/
│ │ │ └── RenoteMuteRecordTest.kt
│ │ └── delegate/
│ │ ├── CreateRenoteMuteAndPushToRemoteDelegateTest.kt
│ │ ├── FindRenoteMuteAndUpdateMemCacheDelegateTest.kt
│ │ └── SyncRenoteMuteDelegateImplTest.kt
│ ├── features/
│ │ ├── account/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── account/
│ │ │ │ ├── AccountFragment.kt
│ │ │ │ ├── AccountInfoLayout.kt
│ │ │ │ ├── AccountScreenViewModel.kt
│ │ │ │ ├── AccountTabFragment.kt
│ │ │ │ ├── AccountTabPagerAdapter.kt
│ │ │ │ └── AccountTabViewModel.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ └── fragment_account_tab.xml
│ │ ├── antenna/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── antenna/
│ │ │ │ ├── AntennaEditorActivity.kt
│ │ │ │ ├── AntennaEditorFragment.kt
│ │ │ │ ├── AntennaListActivity.kt
│ │ │ │ ├── AntennaListAdapter.kt
│ │ │ │ ├── AntennaListFragment.kt
│ │ │ │ ├── AntennaPagedStateHelper.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── AntennaEditorViewModel.kt
│ │ │ │ └── AntennaListViewModel.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ ├── activity_antenna_editor.xml
│ │ │ ├── activity_antenna_list.xml
│ │ │ ├── fragment_antenna_editor.xml
│ │ │ ├── fragment_antenna_list.xml
│ │ │ └── item_antenna.xml
│ │ ├── auth/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ ├── main/
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── java/
│ │ │ │ │ └── net/
│ │ │ │ │ └── pantasystem/
│ │ │ │ │ └── milktea/
│ │ │ │ │ └── auth/
│ │ │ │ │ ├── AuthApprovedScreen.kt
│ │ │ │ │ ├── AuthFormScreen.kt
│ │ │ │ │ ├── AuthScreen.kt
│ │ │ │ │ ├── AuthorizationActivity.kt
│ │ │ │ │ ├── InstanceInfoCard.kt
│ │ │ │ │ ├── JoinMilkteaActivity.kt
│ │ │ │ │ ├── JoinMilkteaScreen.kt
│ │ │ │ │ ├── SignUpActivity.kt
│ │ │ │ │ ├── SignUpScreen.kt
│ │ │ │ │ ├── Waiting4ApproveScreen.kt
│ │ │ │ │ ├── WebViewAuthActivity.kt
│ │ │ │ │ ├── di/
│ │ │ │ │ │ └── module/
│ │ │ │ │ │ └── NavigationModule.kt
│ │ │ │ │ ├── suggestions/
│ │ │ │ │ │ └── InstanceSuggestionsPagingModel.kt
│ │ │ │ │ └── viewmodel/
│ │ │ │ │ ├── Permissions.kt
│ │ │ │ │ ├── SignUpViewModel.kt
│ │ │ │ │ └── app/
│ │ │ │ │ ├── AppAuthViewModel.kt
│ │ │ │ │ ├── AuthStateHelper.kt
│ │ │ │ │ ├── GetAccessToken.kt
│ │ │ │ │ └── UIState.kt
│ │ │ │ └── res/
│ │ │ │ └── layout/
│ │ │ │ └── activity_web_view_auth.xml
│ │ │ └── test/
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── auth/
│ │ │ └── viewmodel/
│ │ │ └── app/
│ │ │ └── AuthUserInputStateTest.kt
│ │ ├── channel/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── channel/
│ │ │ ├── ChannelActivity.kt
│ │ │ ├── ChannelCard.kt
│ │ │ ├── ChannelDetailScreen.kt
│ │ │ ├── ChannelDetailViewModel.kt
│ │ │ ├── ChannelListStatePage.kt
│ │ │ ├── ChannelScreen.kt
│ │ │ ├── ChannelViewModel.kt
│ │ │ └── di/
│ │ │ └── module/
│ │ │ └── NavigationModule.kt
│ │ ├── clip/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── clip/
│ │ │ ├── ClipDetailActivity.kt
│ │ │ ├── ClipListActivity.kt
│ │ │ ├── ClipListScreen.kt
│ │ │ ├── ClipListViewModel.kt
│ │ │ ├── ClipTile.kt
│ │ │ └── NavigationModule.kt
│ │ ├── drive/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── drive/
│ │ │ │ ├── CreateFolderDialog.kt
│ │ │ │ ├── DirectoryListScreen.kt
│ │ │ │ ├── DriveActivity.kt
│ │ │ │ ├── DriveFileCard.kt
│ │ │ │ ├── DriveFileScreen.kt
│ │ │ │ ├── DriveScreen.kt
│ │ │ │ ├── FileActionDropdownMenu.kt
│ │ │ │ ├── FilePropertyGridItem.kt
│ │ │ │ ├── FileUtils.kt
│ │ │ │ ├── di/
│ │ │ │ │ └── module/
│ │ │ │ │ └── NavigationModule.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── DriveUiStateBuilder.kt
│ │ │ │ ├── DriveViewModel.kt
│ │ │ │ └── FileViewData.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ └── dialog_create_folder.xml
│ │ ├── favorite/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── favorite/
│ │ │ │ └── FavoriteActivity.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ └── activity_favorite.xml
│ │ ├── gallery/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── gallery/
│ │ │ │ ├── GalleryEditorFragment.kt
│ │ │ │ ├── GalleryEditorPage.kt
│ │ │ │ ├── GalleryPostCard.kt
│ │ │ │ ├── GalleryPostCardList.kt
│ │ │ │ ├── GalleryPostTabFragment.kt
│ │ │ │ ├── GalleryPostsActivity.kt
│ │ │ │ ├── GalleryPostsFragment.kt
│ │ │ │ ├── PickedImagePreview.kt
│ │ │ │ ├── ThumbnailPreview.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── GalleryEditorViewModel.kt
│ │ │ │ ├── GalleryFavoriteable.kt
│ │ │ │ ├── GalleryPostActionViewModel.kt
│ │ │ │ ├── GalleryPostUiState.kt
│ │ │ │ └── GalleryPostsViewModel.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ └── ic_baseline_add_photo_alternate_24.xml
│ │ │ └── layout/
│ │ │ ├── activity_gallery_posts.xml
│ │ │ └── fragment_gallery_post_tab.xml
│ │ ├── group/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── group/
│ │ │ ├── GroupActivity.kt
│ │ │ ├── GroupCard.kt
│ │ │ ├── GroupCardListPage.kt
│ │ │ ├── GroupDetailPage.kt
│ │ │ ├── GroupDetailStatePage.kt
│ │ │ ├── GroupDetailUiStateBuilder.kt
│ │ │ ├── GroupDetailViewModel.kt
│ │ │ ├── GroupEditorDialog.kt
│ │ │ ├── GroupListViewModel.kt
│ │ │ └── GroupMemberCard.kt
│ │ ├── media/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── media/
│ │ │ │ ├── File.kt
│ │ │ │ ├── ImageFragment.kt
│ │ │ │ ├── ImageViewModel.kt
│ │ │ │ ├── MediaActivity.kt
│ │ │ │ ├── MediaPagerAdapter.kt
│ │ │ │ ├── MediaViewModel.kt
│ │ │ │ ├── PhotoViewViewPager.kt
│ │ │ │ ├── PlayerFragment.kt
│ │ │ │ ├── RemoteFileDownloadWorkManager.kt
│ │ │ │ ├── SwipeFinishLayout.kt
│ │ │ │ └── di/
│ │ │ │ └── module/
│ │ │ │ └── NavigationModule.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ └── ic_file_download_black_24dp.xml
│ │ │ ├── layout/
│ │ │ │ ├── activity_media.xml
│ │ │ │ ├── fragment_image.xml
│ │ │ │ └── fragment_player.xml
│ │ │ └── menu/
│ │ │ └── menu_media.xml
│ │ ├── messaging/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── messaging/
│ │ │ │ ├── MessageActivity.kt
│ │ │ │ ├── MessageBubble.kt
│ │ │ │ ├── MessageFragment.kt
│ │ │ │ ├── MessageHistoryCard.kt
│ │ │ │ ├── MessageHistoryScreen.kt
│ │ │ │ ├── MessageScreen.kt
│ │ │ │ ├── MessagingHistoryFragment.kt
│ │ │ │ ├── MessagingListActivity.kt
│ │ │ │ ├── di/
│ │ │ │ │ └── NavigationModule.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── MessageEditorViewModel.kt
│ │ │ │ ├── MessageHistoryViewModel.kt
│ │ │ │ └── MessageViewModel.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ ├── activity_message.xml
│ │ │ ├── activity_messaging_list.xml
│ │ │ └── fragment_messaging_history.xml
│ │ ├── note/
│ │ │ ├── .gitignore
│ │ │ ├── CustomEmojiCompleteAdapter.kt
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ ├── main/
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ ├── java/
│ │ │ │ │ └── net/
│ │ │ │ │ └── pantasystem/
│ │ │ │ │ └── milktea/
│ │ │ │ │ └── note/
│ │ │ │ │ ├── DraftNotesActivity.kt
│ │ │ │ │ ├── EmojiPickerUiState.kt
│ │ │ │ │ ├── NoteDetailActivity.kt
│ │ │ │ │ ├── NoteEditorActivity.kt
│ │ │ │ │ ├── clip/
│ │ │ │ │ │ ├── ToggleAddNoteToClipDialog.kt
│ │ │ │ │ │ ├── ToggleAddNoteToClipDialogLayout.kt
│ │ │ │ │ │ ├── ToggleAddNoteToClipDialogViewModel.kt
│ │ │ │ │ │ └── ToggleAddNoteToClipTile.kt
│ │ │ │ │ ├── compose/
│ │ │ │ │ │ ├── AutoCollapsingLayout.kt
│ │ │ │ │ │ ├── ComposeTimeline.kt
│ │ │ │ │ │ └── NoteCard.kt
│ │ │ │ │ ├── detail/
│ │ │ │ │ │ ├── NoteChildConversationAdapter.kt
│ │ │ │ │ │ ├── NoteDetailAccountSwitchDialog.kt
│ │ │ │ │ │ ├── NoteDetailAdapter.kt
│ │ │ │ │ │ ├── NoteDetailFragment.kt
│ │ │ │ │ │ ├── NoteDetailPagerFragment.kt
│ │ │ │ │ │ ├── pager/
│ │ │ │ │ │ │ └── NoteDetailViewPagerAdapter.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ ├── NoteConversationViewData.kt
│ │ │ │ │ │ ├── NoteDetailNotesFlowBuilder.kt
│ │ │ │ │ │ ├── NoteDetailPagerViewModel.kt
│ │ │ │ │ │ ├── NoteDetailViewData.kt
│ │ │ │ │ │ └── NoteDetailViewModel.kt
│ │ │ │ │ ├── dialog/
│ │ │ │ │ │ ├── ConfirmDeleteAndEditNoteDialog.kt
│ │ │ │ │ │ └── ConfirmDeleteNoteDialog.kt
│ │ │ │ │ ├── draft/
│ │ │ │ │ │ ├── DraftNoteCard.kt
│ │ │ │ │ │ ├── DraftNotesFragment.kt
│ │ │ │ │ │ ├── DraftNotesScreen.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ └── DraftNotesViewModel.kt
│ │ │ │ │ ├── editor/
│ │ │ │ │ │ ├── ConfirmSaveAsDraftDialog.kt
│ │ │ │ │ │ ├── CustomEmojiCompleteAdapter.kt
│ │ │ │ │ │ ├── EmojiAutoCompleteTextField.kt
│ │ │ │ │ │ ├── NoteEditorAddressSection.kt
│ │ │ │ │ │ ├── NoteEditorFileSizeWarningDialog.kt
│ │ │ │ │ │ ├── NoteEditorReplyPreview.kt
│ │ │ │ │ │ ├── NoteEditorScheduleSection.kt
│ │ │ │ │ │ ├── NoteEditorScreen.kt
│ │ │ │ │ │ ├── NoteEditorTextInputSection.kt
│ │ │ │ │ │ ├── NoteEditorToolbar.kt
│ │ │ │ │ │ ├── NoteEditorToolbarBinding.kt
│ │ │ │ │ │ ├── NoteEditorUserActionMenuLayout.kt
│ │ │ │ │ │ ├── NoteVisibilityIconHelper.kt
│ │ │ │ │ │ ├── ReservationPostDatePickerDialog.kt
│ │ │ │ │ │ ├── ReservationPostTimePickerDialog.kt
│ │ │ │ │ │ ├── SimpleEditorFragment.kt
│ │ │ │ │ │ ├── UriImageHelper.kt
│ │ │ │ │ │ ├── account/
│ │ │ │ │ │ │ └── NoteEditorSwitchAccountDialog.kt
│ │ │ │ │ │ ├── file/
│ │ │ │ │ │ │ ├── EditFileCaptionDialog.kt
│ │ │ │ │ │ │ └── EditFileNameDialog.kt
│ │ │ │ │ │ ├── note_file_preview.kt
│ │ │ │ │ │ ├── poll/
│ │ │ │ │ │ │ ├── PollDatePickerDialog.kt
│ │ │ │ │ │ │ ├── PollEditorFragment.kt
│ │ │ │ │ │ │ ├── PollEditorLayout.kt
│ │ │ │ │ │ │ └── PollTimePickerDialog.kt
│ │ │ │ │ │ ├── viewmodel/
│ │ │ │ │ │ │ ├── NoteEditorFilePreviewSourcesMapper.kt
│ │ │ │ │ │ │ ├── NoteEditorSavedHandlerHelper.kt
│ │ │ │ │ │ │ ├── NoteEditorSwitchAccountExecutor.kt
│ │ │ │ │ │ │ ├── NoteEditorUiState.kt
│ │ │ │ │ │ │ ├── NoteEditorUiStateBuilder.kt
│ │ │ │ │ │ │ ├── NoteEditorViewModel.kt
│ │ │ │ │ │ │ └── NoteEditorVisibilityCombiner.kt
│ │ │ │ │ │ └── visibility/
│ │ │ │ │ │ ├── ReactionAcceptanceSelection.kt
│ │ │ │ │ │ ├── VisibilityChannelSelection.kt
│ │ │ │ │ │ ├── VisibilityDialogSectionTitles.kt
│ │ │ │ │ │ ├── VisibilityResource.kt
│ │ │ │ │ │ ├── VisibilitySelectionDialogV2.kt
│ │ │ │ │ │ └── VisibilitySelectionTile.kt
│ │ │ │ │ ├── emojis/
│ │ │ │ │ │ ├── AddEmojiToUserConfigDialog.kt
│ │ │ │ │ │ ├── CustomEmojiPickerDialog.kt
│ │ │ │ │ │ ├── EmojiPickerFragment.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ ├── AddEmojiToUserConfigViewModel.kt
│ │ │ │ │ │ ├── EmojiPickerViewModel.kt
│ │ │ │ │ │ └── EmojiSelection.kt
│ │ │ │ │ ├── media/
│ │ │ │ │ │ ├── MediaPreviewHelper.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ ├── MediaViewData.kt
│ │ │ │ │ │ └── PreviewAbleFile.kt
│ │ │ │ │ ├── option/
│ │ │ │ │ │ ├── NoteOptionDialog.kt
│ │ │ │ │ │ ├── NoteOptionDialogLayout.kt
│ │ │ │ │ │ └── NoteOptionViewModel.kt
│ │ │ │ │ ├── pinned/
│ │ │ │ │ │ ├── PinnedNoteFragment.kt
│ │ │ │ │ │ └── PinnedNotesViewModel.kt
│ │ │ │ │ ├── poll/
│ │ │ │ │ │ ├── PollHelper.kt
│ │ │ │ │ │ ├── PollListAdapter.kt
│ │ │ │ │ │ └── PollListLinearLayoutBinder.kt
│ │ │ │ │ ├── reaction/
│ │ │ │ │ │ ├── CustomEmojiImageViewSizeHelper.kt
│ │ │ │ │ │ ├── ImageAspectRatioCache.kt
│ │ │ │ │ │ ├── NoteReactionViewHelper.kt
│ │ │ │ │ │ ├── ReactionButtonHelper.kt
│ │ │ │ │ │ ├── ReactionCountAdapter.kt
│ │ │ │ │ │ ├── ReactionHelper.kt
│ │ │ │ │ │ ├── ReactionSelectionDialog.kt
│ │ │ │ │ │ ├── ReactionViewData.kt
│ │ │ │ │ │ ├── RemoteReactionEmojiSuggestionDialog.kt
│ │ │ │ │ │ ├── SaveImageAspectRequestListener.kt
│ │ │ │ │ │ ├── choices/
│ │ │ │ │ │ │ └── EmojiListItemsAdapter.kt
│ │ │ │ │ │ ├── history/
│ │ │ │ │ │ │ ├── ReactionHistoryListAdapter.kt
│ │ │ │ │ │ │ ├── ReactionHistoryListFragment.kt
│ │ │ │ │ │ │ ├── ReactionHistoryPagerAdapter.kt
│ │ │ │ │ │ │ ├── ReactionHistoryPagerDialog.kt
│ │ │ │ │ │ │ └── ReactionHistoryViewModel.kt
│ │ │ │ │ │ ├── picker/
│ │ │ │ │ │ │ ├── ReactionPickerDialog.kt
│ │ │ │ │ │ │ └── ReactionPickerDialogViewModel.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ ├── ReactionHistoryPagerViewModel.kt
│ │ │ │ │ │ └── RemoteReactionEmojiSuggestionViewModel.kt
│ │ │ │ │ ├── renote/
│ │ │ │ │ │ ├── RenoteBottomSheetDialog.kt
│ │ │ │ │ │ ├── RenoteDialogLayout.kt
│ │ │ │ │ │ ├── RenoteResultHandler.kt
│ │ │ │ │ │ ├── RenoteTargetAccountList.kt
│ │ │ │ │ │ ├── RenoteUiState.kt
│ │ │ │ │ │ ├── RenoteUiStateBuilder.kt
│ │ │ │ │ │ ├── RenoteUserItem.kt
│ │ │ │ │ │ ├── RenoteUsers.kt
│ │ │ │ │ │ ├── RenoteViewModel.kt
│ │ │ │ │ │ ├── RenotesBottomSheetDialog.kt
│ │ │ │ │ │ └── RenotesViewModel.kt
│ │ │ │ │ ├── timeline/
│ │ │ │ │ │ ├── NoteFontSizeBinder.kt
│ │ │ │ │ │ ├── ReactionCountItemsInflater.kt
│ │ │ │ │ │ ├── TimeMachineDialog.kt
│ │ │ │ │ │ ├── TimelineErrorHandler.kt
│ │ │ │ │ │ ├── TimelineFragment.kt
│ │ │ │ │ │ ├── TimelineListAdapter.kt
│ │ │ │ │ │ ├── TimelineListAdapterViewHolders.kt
│ │ │ │ │ │ └── viewmodel/
│ │ │ │ │ │ ├── NoteStreamingCollector.kt
│ │ │ │ │ │ ├── TimeMachineDialogViewModel.kt
│ │ │ │ │ │ ├── TimeMachineEventViewModel.kt
│ │ │ │ │ │ ├── TimelineFilterService.kt
│ │ │ │ │ │ ├── TimelineListItem.kt
│ │ │ │ │ │ ├── TimelineViewModel.kt
│ │ │ │ │ │ └── filter/
│ │ │ │ │ │ ├── ExcludeIfExistsSensitiveMediaFilter.kt
│ │ │ │ │ │ └── ExcludeRepostOrReplyFilter.kt
│ │ │ │ │ ├── url/
│ │ │ │ │ │ ├── OtherFileView.kt
│ │ │ │ │ │ ├── UrlPreviewHelper.kt
│ │ │ │ │ │ └── UrlPreviewView.kt
│ │ │ │ │ ├── view/
│ │ │ │ │ │ ├── ContentFoldingHelper.kt
│ │ │ │ │ │ ├── CwAnimationHelper.kt
│ │ │ │ │ │ ├── InstanceInfoHelper.kt
│ │ │ │ │ │ ├── MastodonFavoriteButtonHelper.kt
│ │ │ │ │ │ ├── NormalBottomSheetDialogSelectionLayout.kt
│ │ │ │ │ │ ├── NoteActionHandler.kt
│ │ │ │ │ │ ├── NoteAutoCollapsingLayoutHelper.kt
│ │ │ │ │ │ ├── NoteBadgeRoleData.kt
│ │ │ │ │ │ ├── NoteCardActionHandler.kt
│ │ │ │ │ │ ├── NoteCardActionListenerAdapter.kt
│ │ │ │ │ │ ├── NoteTransitionHelper.kt
│ │ │ │ │ │ ├── NoteUserRoleBadgeBinder.kt
│ │ │ │ │ │ ├── RenoteButtonHelper.kt
│ │ │ │ │ │ ├── StatusMessageHelper.kt
│ │ │ │ │ │ └── TranslationHelper.kt
│ │ │ │ │ └── viewmodel/
│ │ │ │ │ ├── CwTextGenerator.kt
│ │ │ │ │ ├── HasReplyToNoteViewData.kt
│ │ │ │ │ ├── NoteStatusMessageTextGenerator.kt
│ │ │ │ │ ├── NoteViewData.kt
│ │ │ │ │ ├── NotesViewModel.kt
│ │ │ │ │ ├── PlaneNoteViewData.kt
│ │ │ │ │ ├── PlaneNoteViewDataCache.kt
│ │ │ │ │ └── Preview.kt
│ │ │ │ └── res/
│ │ │ │ ├── drawable/
│ │ │ │ │ ├── ic_baseline_timeline_24.xml
│ │ │ │ │ └── shape_media_message_background.xml
│ │ │ │ ├── layout/
│ │ │ │ │ ├── activity_draft_notes.xml
│ │ │ │ │ ├── activity_note_detail.xml
│ │ │ │ │ ├── dialog_custom_emoji_picker.xml
│ │ │ │ │ ├── dialog_reaction_history_pager.xml
│ │ │ │ │ ├── dialog_reaction_picker.xml
│ │ │ │ │ ├── dialog_remote_reaction_emoji_suggestion.xml
│ │ │ │ │ ├── dialog_select_reaction.xml
│ │ │ │ │ ├── dialog_time_machine.xml
│ │ │ │ │ ├── fragment_emoji_picker.xml
│ │ │ │ │ ├── fragment_note_detail.xml
│ │ │ │ │ ├── fragment_note_detail_pager.xml
│ │ │ │ │ ├── fragment_pinned_notes.xml
│ │ │ │ │ ├── fragment_reaction_history_list.xml
│ │ │ │ │ ├── fragment_simple_editor.xml
│ │ │ │ │ ├── fragment_timeline.xml
│ │ │ │ │ ├── item_category_with_list.xml
│ │ │ │ │ ├── item_choice.xml
│ │ │ │ │ ├── item_conversation.xml
│ │ │ │ │ ├── item_detail_note.xml
│ │ │ │ │ ├── item_emoji_choice.xml
│ │ │ │ │ ├── item_emoji_list_item_header.xml
│ │ │ │ │ ├── item_file_preview.xml
│ │ │ │ │ ├── item_has_reply_to_note.xml
│ │ │ │ │ ├── item_media_preview.xml
│ │ │ │ │ ├── item_note.xml
│ │ │ │ │ ├── item_note_editor_reply_to_note.xml
│ │ │ │ │ ├── item_reaction.xml
│ │ │ │ │ ├── item_reaction_history_header.xml
│ │ │ │ │ ├── item_reaction_history_loading.xml
│ │ │ │ │ ├── item_simple_note.xml
│ │ │ │ │ ├── item_simple_user.xml
│ │ │ │ │ ├── item_timeline_empty.xml
│ │ │ │ │ ├── item_timeline_error.xml
│ │ │ │ │ ├── item_timeline_loading.xml
│ │ │ │ │ ├── item_url_or_file_preview.xml
│ │ │ │ │ ├── item_url_preview.xml
│ │ │ │ │ ├── item_vote_result.xml
│ │ │ │ │ ├── view_other_file.xml
│ │ │ │ │ ├── view_translation.xml
│ │ │ │ │ └── view_url_preview.xml
│ │ │ │ ├── menu/
│ │ │ │ │ └── menu_timeline.xml
│ │ │ │ └── values/
│ │ │ │ └── dimens.xml
│ │ │ └── test/
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── note/
│ │ │ └── editor/
│ │ │ └── viewmodel/
│ │ │ └── NoteEditorUiStateTest.kt
│ │ ├── notification/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── notification/
│ │ │ │ ├── NotificationErrorHandler.kt
│ │ │ │ ├── NotificationFragment.kt
│ │ │ │ ├── NotificationHelper.kt
│ │ │ │ ├── NotificationListAdapter.kt
│ │ │ │ ├── NotificationMentionFragment.kt
│ │ │ │ ├── NotificationStatusIconHelper.kt
│ │ │ │ ├── NotificationTabViewModel.kt
│ │ │ │ ├── NotificationTitleHelper.kt
│ │ │ │ ├── NotificationsActivity.kt
│ │ │ │ ├── notification_message_helper.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── NotificationViewData.kt
│ │ │ │ └── NotificationViewModel.kt
│ │ │ └── res/
│ │ │ ├── layout/
│ │ │ │ ├── activity_notifications.xml
│ │ │ │ ├── fragment_notification.xml
│ │ │ │ ├── fragment_notification_mention.xml
│ │ │ │ ├── item_notification.xml
│ │ │ │ ├── item_notification_empty.xml
│ │ │ │ ├── item_notification_error.xml
│ │ │ │ └── item_notification_loading.xml
│ │ │ ├── menu/
│ │ │ │ └── notification_menu.xml
│ │ │ └── values/
│ │ │ └── dimens.xml
│ │ ├── search/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── search/
│ │ │ │ ├── SearchActivity.kt
│ │ │ │ ├── SearchResultActivity.kt
│ │ │ │ ├── SearchResultLayout.kt
│ │ │ │ ├── SearchResultViewModel.kt
│ │ │ │ ├── SearchResultViewPagerAdapter.kt
│ │ │ │ ├── SearchTopFragment.kt
│ │ │ │ ├── SearchTopTabsFactory.kt
│ │ │ │ ├── SearchTopViewModel.kt
│ │ │ │ ├── SearchViewModel.kt
│ │ │ │ ├── explore/
│ │ │ │ │ ├── ExploreFragment.kt
│ │ │ │ │ └── ExploreViewModel.kt
│ │ │ │ └── trend/
│ │ │ │ ├── HashtagTrendItem.kt
│ │ │ │ ├── TrendFragment.kt
│ │ │ │ └── TrendViewModel.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ ├── activity_search.xml
│ │ │ ├── activity_search_result.xml
│ │ │ └── fragment_search_top.xml
│ │ ├── setting/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── setting/
│ │ │ │ ├── EditTabSettingDialog.kt
│ │ │ │ ├── PageSettingActionDialog.kt
│ │ │ │ ├── PageTypeNameMap.kt
│ │ │ │ ├── SettingSection.kt
│ │ │ │ ├── activities/
│ │ │ │ │ ├── AboutMilkteaActivity.kt
│ │ │ │ │ ├── AccountSettingActivity.kt
│ │ │ │ │ ├── CacheSettingActivity.kt
│ │ │ │ │ ├── ClientWordFilterSettingActivity.kt
│ │ │ │ │ ├── DeveloperSettingActivity.kt
│ │ │ │ │ ├── ImportReactionFromWebViewActivity.kt
│ │ │ │ │ ├── PageSettingActivity.kt
│ │ │ │ │ ├── ReactionSettingActivity.kt
│ │ │ │ │ ├── RenoteMuteSettingActivity.kt
│ │ │ │ │ ├── SecuritySettingActivity.kt
│ │ │ │ │ ├── SettingAppearanceActivity.kt
│ │ │ │ │ ├── SettingMovementActivity.kt
│ │ │ │ │ └── SettingsActivity.kt
│ │ │ │ ├── compose/
│ │ │ │ │ ├── SettingRadioTile.kt
│ │ │ │ │ ├── SettingSwitchTile.kt
│ │ │ │ │ ├── SettingTIleLayoutBase.kt
│ │ │ │ │ ├── SettingTitleTile.kt
│ │ │ │ │ ├── account/
│ │ │ │ │ │ └── AccountSettingScreen.kt
│ │ │ │ │ ├── renote/
│ │ │ │ │ │ └── mute/
│ │ │ │ │ │ └── RenoteMuteSettingScreen.kt
│ │ │ │ │ └── tab/
│ │ │ │ │ ├── DragAndDropState.kt
│ │ │ │ │ ├── TabItemSelectionDialog.kt
│ │ │ │ │ ├── TabItemsList.kt
│ │ │ │ │ └── TabItemsListScreen.kt
│ │ │ │ └── viewmodel/
│ │ │ │ ├── CacheSettingViewModel.kt
│ │ │ │ ├── ImportReactionFromWebViewViewModel.kt
│ │ │ │ ├── RenoteMuteSettingViewModel.kt
│ │ │ │ ├── muteword/
│ │ │ │ │ └── ClientWordFilterSettingViewModel.kt
│ │ │ │ ├── page/
│ │ │ │ │ ├── PageCandidateGenerator.kt
│ │ │ │ │ ├── PageSettingAction.kt
│ │ │ │ │ ├── PageSettingViewModel.kt
│ │ │ │ │ └── SelectPageTypeToAdd.kt
│ │ │ │ └── reaction/
│ │ │ │ └── ReactionPickerSettingViewModel.kt
│ │ │ └── res/
│ │ │ └── layout/
│ │ │ ├── activity_import_reaction_from_web_view.xml
│ │ │ ├── activity_reaction_setting.xml
│ │ │ ├── activity_settings.xml
│ │ │ ├── dialog_edit_tab_name.xml
│ │ │ ├── dialog_page_setting_action.xml
│ │ │ └── settings_activity.xml
│ │ ├── user/
│ │ │ ├── .gitignore
│ │ │ ├── build.gradle
│ │ │ ├── consumer-rules.pro
│ │ │ ├── proguard-rules.pro
│ │ │ └── src/
│ │ │ └── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java/
│ │ │ │ └── net/
│ │ │ │ └── pantasystem/
│ │ │ │ └── milktea/
│ │ │ │ └── user/
│ │ │ │ ├── FollowButton.kt
│ │ │ │ ├── ReportStateHandler.kt
│ │ │ │ ├── UserCardListActionHandler.kt
│ │ │ │ ├── compose/
│ │ │ │ │ ├── SimpleUsers.kt
│ │ │ │ │ ├── UserDetailCard.kt
│ │ │ │ │ ├── UserDetailCardList.kt
│ │ │ │ │ ├── UserDetailCardPageableList.kt
│ │ │ │ │ └── screen/
│ │ │ │ │ └── FollowFollowerScreen.kt
│ │ │ │ ├── di/
│ │ │ │ │ └── module/
│ │ │ │ │ └── FollowRequestModule.kt
│ │ │ │ ├── followlist/
│ │ │ │ │ ├── FollowFollowerActivity.kt
│ │ │ │ │ └── FollowFollowerViewModel.kt
│ │ │ │ ├── followrequests/
│ │ │ │ │ ├── FollowRequestItem.kt
│ │ │ │ │ ├── FollowRequestsErrorHandler.kt
│ │ │ │ │ ├── FollowRequestsFragment.kt
│ │ │ │ │ ├── FollowRequestsScreen.kt
│ │ │ │ │ └── FollowRequestsViewModel.kt
│ │ │ │ ├── helper/
│ │ │ │ │ └── HeaderImageHelper.kt
│ │ │ │ ├── nickname/
│ │ │ │ │ └── EditNicknameDialog.kt
│ │ │ │ ├── profile/
│ │ │ │ │ ├── ConfirmUserBlockDialog.kt
│ │ │ │ │ ├── ProfileAccountSwitchDialog.kt
│ │ │ │ │ ├── ProfileTabPagerAdapter.kt
│ │ │ │ │ ├── UserDetailActivity.kt
│ │ │ │ │ ├── UserDetailActivityMenuBinder.kt
│ │ │ │ │ ├── UserDetailErrorHandler.kt
│ │ │ │ │ ├── UserProfileFieldListAdapter.kt
│ │ │ │ │ ├── mute/
│ │ │ │ │ │ ├── MuteUserViewModel.kt
│ │ │ │ │ │ ├── SpecifyMuteExpiredAtDialog.kt
│ │ │ │ │ │ └── SpecifyMuteExpiredAtDialogContent.kt
│ │ │ │ │ ├── view/
│ │ │ │ │ │ └── ProfileBadgeRoles.kt
│ │ │ │ │ └── viewmodel/
│ │ │ │ │ ├── UserDetailTabType.kt
│ │ │ │ │ ├── UserDetailViewModel.kt
│ │ │ │ │ ├── UserIdResolver.kt
│ │ │ │ │ └── UserProfileArgTypeCombiner.kt
│ │ │ │ ├── qrshare/
│ │ │ │ │ ├── QRCodeBitmapGenerator.kt
│ │ │ │ │ └── QRShareDialog.kt
│ │ │ │ ├── reaction/
│ │ │ │ │ ├── UserReactionBindingModel.kt
│ │ │ │ │ ├── UserReactionsFragment.kt
│ │ │ │ │ ├── UserReactionsListAdapter.kt
│ │ │ │ │ └── UserReactionsViewModel.kt
│ │ │ │ ├── search/
│ │ │ │ │ ├── SearchAndSelectUserActivity.kt
│ │ │ │ │ ├── SearchAndSelectUserScreen.kt
│ │ │ │ │ ├── SearchUserFragment.kt
│ │ │ │ │ ├── SearchUserViewModel.kt
│ │ │ │ │ └── SelectedUserViewModel.kt
│ │ │ │ └── viewmodel/
│ │ │ │ └── ToggleFollowViewModel.kt
│ │ │ └── res/
│ │ │ ├── drawable/
│ │ │ │ ├── ic_baseline_cake_24.xml
│ │ │ │ ├── ic_baseline_calendar_month_24.xml
│ │ │ │ └── shape_follower_state_background.xml
│ │ │ └── layout/
│ │ │ ├── activity_user_detail.xml
│ │ │ ├── dialog_edit_nickname.xml
│ │ │ ├── fragment_user_reactions.xml
│ │ │ ├── item_user_profile_field.xml
│ │ │ └── item_user_reaction.xml
│ │ └── userlist/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ └── main/
│ │ ├── AndroidManifest.xml
│ │ ├── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── userlist/
│ │ │ ├── ListListActivity.kt
│ │ │ ├── UserListDetailActivity.kt
│ │ │ ├── UserListEditorDialog.kt
│ │ │ ├── compose/
│ │ │ │ ├── RemovableSimpleUserCard.kt
│ │ │ │ ├── RemovableSimpleUserCardList.kt
│ │ │ │ ├── UserListCard.kt
│ │ │ │ ├── UserListCardScreen.kt
│ │ │ │ └── UserListDetailScreen.kt
│ │ │ └── viewmodel/
│ │ │ ├── ListListViewModel.kt
│ │ │ └── UserListDetailViewModel.kt
│ │ └── res/
│ │ └── layout/
│ │ └── dialog_user_list_editor.xml
│ ├── model/
│ │ ├── .gitignore
│ │ ├── build.gradle
│ │ ├── consumer-rules.pro
│ │ ├── proguard-rules.pro
│ │ └── src/
│ │ ├── main/
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── model/
│ │ │ ├── AddResult.kt
│ │ │ ├── Entity.kt
│ │ │ ├── UseCase.kt
│ │ │ ├── account/
│ │ │ │ ├── Account.kt
│ │ │ │ ├── AccountExceptions.kt
│ │ │ │ ├── AccountRepository.kt
│ │ │ │ ├── Auth.kt
│ │ │ │ ├── ClientId.kt
│ │ │ │ ├── ClientIdRepository.kt
│ │ │ │ ├── CurrentAccountWatcher.kt
│ │ │ │ ├── MakeDefaultPagesUseCase.kt
│ │ │ │ ├── SignOutUseCase.kt
│ │ │ │ ├── SyncAccountInfoUseCase.kt
│ │ │ │ ├── UnauthorizedException.kt
│ │ │ │ └── page/
│ │ │ │ ├── Page.kt
│ │ │ │ ├── PageParams.kt
│ │ │ │ ├── PageType.kt
│ │ │ │ ├── Pageable.kt
│ │ │ │ ├── PageableTemplate.kt
│ │ │ │ └── Pagenate.kt
│ │ │ ├── antenna/
│ │ │ │ ├── AccountService.kt
│ │ │ │ ├── Antenna.kt
│ │ │ │ ├── AntennaRepository.kt
│ │ │ │ ├── AntennaToggleAddToTabUseCase.kt
│ │ │ │ └── SaveAntennaParam.kt
│ │ │ ├── ap/
│ │ │ │ ├── ApResolver.kt
│ │ │ │ ├── ApResolverRepository.kt
│ │ │ │ └── ApResolverService.kt
│ │ │ ├── app/
│ │ │ │ └── AppType.kt
│ │ │ ├── channel/
│ │ │ │ ├── Channel.kt
│ │ │ │ ├── ChannelRepository.kt
│ │ │ │ ├── ChannelStateModel.kt
│ │ │ │ ├── CreateChannel.kt
│ │ │ │ └── UpdateChannel.kt
│ │ │ ├── clip/
│ │ │ │ ├── Clip.kt
│ │ │ │ ├── ClipRepository.kt
│ │ │ │ ├── CreateClip.kt
│ │ │ │ └── ToggleClipAddToTabUseCase.kt
│ │ │ ├── drive/
│ │ │ │ ├── CreateDirectory.kt
│ │ │ │ ├── Directory.kt
│ │ │ │ ├── DriveDirectoryRepository.kt
│ │ │ │ ├── DriveFileRepository.kt
│ │ │ │ ├── FileProperty.kt
│ │ │ │ ├── FilePropertyDataSource.kt
│ │ │ │ └── UpdateFileProperty.kt
│ │ │ ├── emoji/
│ │ │ │ ├── AddEmojiToUserConfigUseCase.kt
│ │ │ │ ├── CustomEmoji.kt
│ │ │ │ ├── CustomEmojiAspectRatioDataSource.kt
│ │ │ │ ├── CustomEmojiAspectRatioStore.kt
│ │ │ │ ├── CustomEmojiRepository.kt
│ │ │ │ ├── EmojiEventHandler.kt
│ │ │ │ ├── EmojiImageCacheStore.kt
│ │ │ │ ├── SaveCustomEmojiImageUseCase.kt
│ │ │ │ ├── SimpleCustomEmojiParser.kt
│ │ │ │ ├── UserEmojiConfig.kt
│ │ │ │ └── UserEmojiConfigRepository.kt
│ │ │ ├── file/
│ │ │ │ ├── AppFile.kt
│ │ │ │ ├── CopyFileToAppDirRepository.kt
│ │ │ │ ├── CopyFileToAppDirUseCase.kt
│ │ │ │ ├── FileUploadFailedException.kt
│ │ │ │ ├── UpdateAppFileSensitiveUseCase.kt
│ │ │ │ └── UriToAppFileUseCase.kt
│ │ │ ├── filter/
│ │ │ │ ├── ClientWordFilterService.kt
│ │ │ │ ├── FilterPatternCache.kt
│ │ │ │ ├── GetMatchContextFilters.kt
│ │ │ │ ├── MastodonFilterService.kt
│ │ │ │ ├── MastodonWordFilter.kt
│ │ │ │ ├── MastodonWordFilterRepository.kt
│ │ │ │ └── WordFilterService.kt
│ │ │ ├── gallery/
│ │ │ │ ├── CreateGalleryPost.kt
│ │ │ │ ├── GalleryDataSource.kt
│ │ │ │ ├── GalleryNotFoundException.kt
│ │ │ │ ├── GalleryPost.kt
│ │ │ │ ├── GalleryRepository.kt
│ │ │ │ └── UpdateGalleryPost.kt
│ │ │ ├── group/
│ │ │ │ ├── AcceptGroupInvitationUseCase.kt
│ │ │ │ ├── CreateGroup.kt
│ │ │ │ ├── Group.kt
│ │ │ │ ├── GroupDataSource.kt
│ │ │ │ ├── GroupNotFoundException.kt
│ │ │ │ ├── GroupRepository.kt
│ │ │ │ ├── InvitationId.kt
│ │ │ │ ├── Invite.kt
│ │ │ │ ├── Pull.kt
│ │ │ │ ├── RejectGroupInvitationUseCase.kt
│ │ │ │ ├── Transfer.kt
│ │ │ │ └── UpdateGroup.kt
│ │ │ ├── hashtag/
│ │ │ │ ├── HashTag.kt
│ │ │ │ └── HashtagRepository.kt
│ │ │ ├── image/
│ │ │ │ ├── ImageCache.kt
│ │ │ │ └── ImageCacheRepository.kt
│ │ │ ├── instance/
│ │ │ │ ├── FeatureEnables.kt
│ │ │ │ ├── HostWithVersion.kt
│ │ │ │ ├── IllegalVersionException.kt
│ │ │ │ ├── InstanceInfo.kt
│ │ │ │ ├── InstanceInfoService.kt
│ │ │ │ ├── InstanceInfoType.kt
│ │ │ │ ├── MastodonInstanceInfo.kt
│ │ │ │ ├── MastodonInstanceInfoRepository.kt
│ │ │ │ ├── Meta.kt
│ │ │ │ ├── MetaDataSource.kt
│ │ │ │ ├── MetaRepository.kt
│ │ │ │ ├── SyncMetaExecutor.kt
│ │ │ │ ├── Version.kt
│ │ │ │ ├── online/
│ │ │ │ │ └── user/
│ │ │ │ │ └── count/
│ │ │ │ │ └── OnlineUserCountRepository.kt
│ │ │ │ └── ticker/
│ │ │ │ ├── InstanceTicker.kt
│ │ │ │ └── InstanceTickerRepository.kt
│ │ │ ├── list/
│ │ │ │ ├── UserList.kt
│ │ │ │ ├── UserListRepository.kt
│ │ │ │ └── UserListTabToggleAddToTabUseCase.kt
│ │ │ ├── markers/
│ │ │ │ └── MarkerRepository.kt
│ │ │ ├── messaging/
│ │ │ │ ├── Message.kt
│ │ │ │ ├── MessageNotFoundException.kt
│ │ │ │ ├── MessageObserver.kt
│ │ │ │ ├── MessageRelationGetter.kt
│ │ │ │ ├── MessageRepository.kt
│ │ │ │ ├── MessagingId.kt
│ │ │ │ ├── MessagingRepository.kt
│ │ │ │ └── UnReadMessages.kt
│ │ │ ├── nodeinfo/
│ │ │ │ ├── NodeInfo.kt
│ │ │ │ └── NodeInfoRepository.kt
│ │ │ ├── note/
│ │ │ │ ├── CreateNote.kt
│ │ │ │ ├── CreateNoteUseCase.kt
│ │ │ │ ├── DeleteAndEditUseCase.kt
│ │ │ │ ├── DeleteNoteUseCase.kt
│ │ │ │ ├── FindPinnedNoteUseCase.kt
│ │ │ │ ├── GetAllMentionUsersUseCase.kt
│ │ │ │ ├── GetShareNoteUrlUseCase.kt
│ │ │ │ ├── Note.kt
│ │ │ │ ├── NoteCaptureAPIAdapter.kt
│ │ │ │ ├── NoteDataSource.kt
│ │ │ │ ├── NoteDeletedException.kt
│ │ │ │ ├── NoteEditingState.kt
│ │ │ │ ├── NoteNotFoundException.kt
│ │ │ │ ├── NoteRelationGetter.kt
│ │ │ │ ├── NoteRepository.kt
│ │ │ │ ├── NoteResult.kt
│ │ │ │ ├── NoteService.kt
│ │ │ │ ├── NoteState.kt
│ │ │ │ ├── NoteStreaming.kt
│ │ │ │ ├── NoteThreadContext.kt
│ │ │ │ ├── ReactionAcceptanceType.kt
│ │ │ │ ├── ReplyStreaming.kt
│ │ │ │ ├── TimelineScrollPositionRepository.kt
│ │ │ │ ├── Translation.kt
│ │ │ │ ├── Visibility.kt
│ │ │ │ ├── bookmark/
│ │ │ │ │ ├── BookmarkRepository.kt
│ │ │ │ │ ├── CreateBookmarkUseCase.kt
│ │ │ │ │ └── DeleteBookmarkUseCase.kt
│ │ │ │ ├── draft/
│ │ │ │ │ ├── DraftNote.kt
│ │ │ │ │ ├── DraftNoteRepository.kt
│ │ │ │ │ ├── DraftNoteService.kt
│ │ │ │ │ └── DraftPoll.kt
│ │ │ │ ├── favorite/
│ │ │ │ │ ├── CreateFavoriteUseCase.kt
│ │ │ │ │ ├── DeleteFavoriteUseCase.kt
│ │ │ │ │ ├── FavoriteRepository.kt
│ │ │ │ │ └── ToggleFavoriteUseCase.kt
│ │ │ │ ├── muteword/
│ │ │ │ │ ├── FilterConditionType.kt
│ │ │ │ │ ├── WordFilterConfig.kt
│ │ │ │ │ ├── WordFilterConfigRepository.kt
│ │ │ │ │ └── WordFilterConfigTextParser.kt
│ │ │ │ ├── poll/
│ │ │ │ │ ├── CreatePoll.kt
│ │ │ │ │ ├── Poll.kt
│ │ │ │ │ └── VoteUseCase.kt
│ │ │ │ ├── reaction/
│ │ │ │ │ ├── CreateReaction.kt
│ │ │ │ │ ├── DeleteReaction.kt
│ │ │ │ │ ├── DeleteReactionsUseCase.kt
│ │ │ │ │ ├── LegacyReaction.kt
│ │ │ │ │ ├── Reaction.kt
│ │ │ │ │ ├── ReactionCount.kt
│ │ │ │ │ ├── ReactionHistoryRequest.kt
│ │ │ │ │ ├── ReactionRepository.kt
│ │ │ │ │ ├── ReactionSelection.kt
│ │ │ │ │ ├── ReactionUserRepository.kt
│ │ │ │ │ ├── ToggleReactionUseCase.kt
│ │ │ │ │ └── history/
│ │ │ │ │ ├── ReactionHistory.kt
│ │ │ │ │ ├── ReactionHistoryCount.kt
│ │ │ │ │ └── ReactionHistoryRepository.kt
│ │ │ │ ├── repost/
│ │ │ │ │ ├── CheckCanRepostService.kt
│ │ │ │ │ ├── CreateRenote.kt
│ │ │ │ │ ├── CreateRenoteMultipleAccountUseCase.kt
│ │ │ │ │ ├── QuoteRenoteData.kt
│ │ │ │ │ ├── Renotes.kt
│ │ │ │ │ └── RenotesPagingService.kt
│ │ │ │ ├── reservation/
│ │ │ │ │ └── NoteReservationPostExecutor.kt
│ │ │ │ └── timeline/
│ │ │ │ ├── SyncTimelineFromLatestToCurrentUseCase.kt
│ │ │ │ ├── SyncTimelineUseCase.kt
│ │ │ │ ├── TimelineItem.kt
│ │ │ │ ├── TimelineRepository.kt
│ │ │ │ └── favorite/
│ │ │ │ └── FavoriteTimelineRepository.kt
│ │ │ ├── notification/
│ │ │ │ ├── Notification.kt
│ │ │ │ ├── NotificationDataSource.kt
│ │ │ │ ├── NotificationNotFoundException.kt
│ │ │ │ ├── NotificationPagingStore.kt
│ │ │ │ ├── NotificationRelation.kt
│ │ │ │ ├── NotificationRelationGetter.kt
│ │ │ │ ├── NotificationRepository.kt
│ │ │ │ ├── NotificationStreaming.kt
│ │ │ │ ├── NotificationTimelineRepository.kt
│ │ │ │ └── PushNotification.kt
│ │ │ ├── search/
│ │ │ │ ├── SearchHistory.kt
│ │ │ │ └── SearchHistoryRepository.kt
│ │ │ ├── setting/
│ │ │ │ ├── ColorSettingStore.kt
│ │ │ │ ├── Config.kt
│ │ │ │ ├── Keys.kt
│ │ │ │ ├── LocalConfigRepository.kt
│ │ │ │ ├── NoteExpandedHeightSize.kt
│ │ │ │ ├── PrefType.kt
│ │ │ │ ├── Theme.kt
│ │ │ │ └── WebClientBaseCache.kt
│ │ │ ├── sw/
│ │ │ │ └── register/
│ │ │ │ ├── DeviceTokenRepository.kt
│ │ │ │ ├── SubscriptionRegistration.kt
│ │ │ │ ├── SubscriptionState.kt
│ │ │ │ └── SubscriptionUnRegistration.kt
│ │ │ ├── task_executor.kt
│ │ │ ├── url/
│ │ │ │ ├── UrlPreview.kt
│ │ │ │ ├── UrlPreviewLoadTask.kt
│ │ │ │ └── UrlPreviewStore.kt
│ │ │ └── user/
│ │ │ ├── Acct.kt
│ │ │ ├── FollowRequestRepository.kt
│ │ │ ├── ToggleFollowUseCase.kt
│ │ │ ├── ToggleUserTimelineAddTabUseCase.kt
│ │ │ ├── User.kt
│ │ │ ├── UserDataSource.kt
│ │ │ ├── UserNotFoundException.kt
│ │ │ ├── UserRepository.kt
│ │ │ ├── block/
│ │ │ │ ├── BlockRepository.kt
│ │ │ │ ├── BlockUserUseCase.kt
│ │ │ │ └── UnBlockUserUseCase.kt
│ │ │ ├── follow/
│ │ │ │ ├── FollowRepository.kt
│ │ │ │ ├── FollowUpdateParams.kt
│ │ │ │ ├── ToggleNotifyUserPostsUseCase.kt
│ │ │ │ └── requests/
│ │ │ │ ├── AcceptFollowRequestUseCase.kt
│ │ │ │ ├── FollowRequestPagingStore.kt
│ │ │ │ └── RejectFollowRequestUseCase.kt
│ │ │ ├── mute/
│ │ │ │ ├── CreateMute.kt
│ │ │ │ ├── MuteRepository.kt
│ │ │ │ ├── MuteUserUseCase.kt
│ │ │ │ └── UnMuteUserUseCase.kt
│ │ │ ├── nickname/
│ │ │ │ ├── DeleteNicknameUseCase.kt
│ │ │ │ ├── UpdateNickname.kt
│ │ │ │ ├── UserNickname.kt
│ │ │ │ ├── UserNicknameNotFoundException.kt
│ │ │ │ └── UserNicknameRepository.kt
│ │ │ ├── query/
│ │ │ │ └── FindUsersQuery.kt
│ │ │ ├── reaction/
│ │ │ │ └── UserReaction.kt
│ │ │ ├── renote/
│ │ │ │ └── mute/
│ │ │ │ ├── RenoteMute.kt
│ │ │ │ └── RenoteMuteRepository.kt
│ │ │ └── report/
│ │ │ ├── Report.kt
│ │ │ ├── ReportRepository.kt
│ │ │ ├── ReportState.kt
│ │ │ └── SendReportUseCase.kt
│ │ └── test/
│ │ ├── java/
│ │ │ └── net/
│ │ │ └── pantasystem/
│ │ │ └── milktea/
│ │ │ └── model/
│ │ │ ├── account/
│ │ │ │ ├── AccountTest.kt
│ │ │ │ ├── SyncAccountInfoUseCaseTest.kt
│ │ │ │ └── page/
│ │ │ │ ├── PageTypeTest.kt
│ │ │ │ └── PageableTest.kt
│ │ │ ├── filter/
│ │ │ │ ├── ClientWordFilterServiceTest.kt
│ │ │ │ ├── GetMatchContextFiltersTest.kt
│ │ │ │ └── MastodonWordFilterTest.kt
│ │ │ ├── instance/
│ │ │ │ └── MetaTest.kt
│ │ │ ├── nodeinfo/
│ │ │ │ └── NodeInfoTest.kt
│ │ │ ├── note/
│ │ │ │ ├── NoteTest.kt
│ │ │ │ ├── NoteTestUtil.kt
│ │ │ │ ├── muteword/
│ │ │ │ │ ├── WordFilterConfigTest.kt
│ │ │ │ │ └── WordFilterConfigTextParserTest.kt
│ │ │ │ └── reaction/
│ │ │ │ ├── ReactionTest.kt
│ │ │ │ └── ToggleReactionUseCaseTest.kt
│ │ │ └── user/
│ │ │ └── AcctTest.kt
│ │ └── resources/
│ │ ├── v10_meta_case1.json
│ │ └── v12_meta_case1.json
│ └── worker/
│ ├── .gitignore
│ ├── build.gradle
│ ├── consumer-rules.pro
│ ├── proguard-rules.pro
│ └── src/
│ └── main/
│ ├── AndroidManifest.xml
│ └── java/
│ └── net/
│ └── pantasystem/
│ └── milktea/
│ └── worker/
│ ├── SyncAccountInfoWorker.kt
│ ├── SyncNodeInfoCacheWorker.kt
│ ├── WorkerIdsModel.kt
│ ├── WorkerTags.kt
│ ├── di/
│ │ └── module/
│ │ └── ExecutorModule.kt
│ ├── drive/
│ │ └── CleanupUnusedCacheWorker.kt
│ ├── emoji/
│ │ └── cache/
│ │ └── CacheCustomEmojiImageWorker.kt
│ ├── filter/
│ │ └── SyncMastodonFilterWorker.kt
│ ├── meta/
│ │ ├── SpecifiedSyncMetaWorker.kt
│ │ └── SyncMetaWorker.kt
│ ├── note/
│ │ ├── BackgroundSyncTimelineWorker.kt
│ │ ├── CreateNoteWorker.kt
│ │ ├── CreateNoteWorkerExecutor.kt
│ │ └── SyncTimelineWorker.kt
│ ├── sw/
│ │ ├── RegisterAllSubscriptionRegistration.kt
│ │ └── SubscriptionRegistrationWorker.kt
│ └── user/
│ ├── SyncLoggedInUserInfoWorker.kt
│ └── renote/
│ └── mute/
│ └── SyncRenoteMutesWorker.kt
├── privacy_policy_ch.md
├── privacy_policy_en.md
├── privacy_policy_ja.md
├── pull_request_template.md
├── push-to-fcm/
│ ├── .air.toml
│ ├── .gitignore
│ ├── Dockerfile
│ ├── docker-compose.yml
│ ├── go.mod
│ ├── go.sum
│ ├── main.go
│ └── pkg/
│ ├── api/
│ │ ├── mastodon/
│ │ │ ├── account.go
│ │ │ ├── emoji.go
│ │ │ ├── notification.go
│ │ │ ├── notification_subscription.go
│ │ │ ├── report.go
│ │ │ └── status.go
│ │ ├── misskey/
│ │ │ ├── account.go
│ │ │ ├── account_test.go
│ │ │ ├── drive_file.go
│ │ │ ├── note.go
│ │ │ ├── notification.go
│ │ │ └── sw_subscription.go
│ │ ├── module.go
│ │ └── well_known/
│ │ ├── nodeinfo.go
│ │ ├── nodeinfo_test.go
│ │ ├── well_known.go
│ │ └── well_known_test.go
│ ├── config/
│ │ └── config.go
│ ├── dao/
│ │ ├── client_account.go
│ │ ├── module.go
│ │ └── push_subscription.go
│ ├── entity/
│ │ ├── client_account.go
│ │ └── push_subscription.go
│ ├── handler/
│ │ ├── client_account.go
│ │ ├── middleware/
│ │ │ └── client_account_auth.go
│ │ └── subscription.go
│ ├── repository/
│ │ ├── client_account.go
│ │ ├── module.go
│ │ └── push_notification.go
│ ├── root/
│ │ ├── impl/
│ │ │ └── module.go
│ │ └── module.go
│ ├── service/
│ │ ├── client_account.go
│ │ ├── module.go
│ │ ├── push_notification.go
│ │ └── push_notification_test.go
│ └── util/
│ ├── webpush_decrypter.go
│ └── webpush_decrypter_test.go
├── server/
│ ├── Dockerfile
│ ├── Dockerfile.production
│ ├── api/
│ │ ├── .air.toml
│ │ ├── .gitignore
│ │ ├── cli/
│ │ │ └── create_admin_account/
│ │ │ └── main.go
│ │ ├── config/
│ │ │ └── .gitignore
│ │ ├── go.mod
│ │ ├── go.sum
│ │ ├── main.go
│ │ └── pkg/
│ │ ├── config/
│ │ │ └── config.go
│ │ ├── dao/
│ │ │ ├── account_dao.go
│ │ │ ├── dao.go
│ │ │ ├── instance_dao.go
│ │ │ └── meta_dao.go
│ │ ├── domain/
│ │ │ ├── account.go
│ │ │ ├── instance.go
│ │ │ ├── instance_info.go
│ │ │ ├── meta.go
│ │ │ ├── token.go
│ │ │ ├── webpush_decrypter.go
│ │ │ └── webpush_decrypter_test.go
│ │ ├── handler/
│ │ │ ├── admin/
│ │ │ │ ├── account.go
│ │ │ │ ├── admin_auth_middleware.go
│ │ │ │ └── admin_instance.go
│ │ │ ├── instances.go
│ │ │ └── push_to_fcm.go
│ │ └── repository/
│ │ ├── account_repository.go
│ │ ├── instance_repository.go
│ │ └── meta_repository.go
│ ├── client/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── public/
│ │ │ ├── index.html
│ │ │ ├── manifest.json
│ │ │ └── robots.txt
│ │ ├── src/
│ │ │ ├── App.test.tsx
│ │ │ ├── App.tsx
│ │ │ ├── data/
│ │ │ │ └── instances.ts
│ │ │ ├── index.css
│ │ │ ├── index.tsx
│ │ │ ├── layout/
│ │ │ │ ├── app-bar-layout.tsx
│ │ │ │ ├── app-layout.tsx
│ │ │ │ ├── body-layout.tsx
│ │ │ │ ├── scroll-layout.tsx
│ │ │ │ └── side-menu-item-layout.tsx
│ │ │ ├── models/
│ │ │ │ ├── account.tsx
│ │ │ │ ├── date-schema.tsx
│ │ │ │ ├── instance-info.tsx
│ │ │ │ ├── instance.tsx
│ │ │ │ └── token.tsx
│ │ │ ├── pages/
│ │ │ │ └── admin/
│ │ │ │ ├── admin-root-page.tsx
│ │ │ │ ├── all-instances.tsx
│ │ │ │ ├── approved-instances-page.tsx
│ │ │ │ ├── components/
│ │ │ │ │ ├── instances-state-page.tsx
│ │ │ │ │ └── instances-table.tsx
│ │ │ │ ├── instance-client-max-body-size-form.tsx
│ │ │ │ ├── instance-detail-page.tsx
│ │ │ │ ├── instance-register-page.tsx
│ │ │ │ ├── instances-page.tsx
│ │ │ │ ├── login.tsx
│ │ │ │ └── unapproved-instances-page.tsx
│ │ │ ├── react-app-env.d.ts
│ │ │ ├── reportWebVitals.ts
│ │ │ ├── repositories/
│ │ │ │ ├── index.ts
│ │ │ │ ├── instance-repository.ts
│ │ │ │ └── token-repository.ts
│ │ │ ├── setupTests.ts
│ │ │ └── state/
│ │ │ └── auth.tsx
│ │ ├── tailwind.config.js
│ │ └── tsconfig.json
│ ├── docker/
│ │ ├── client/
│ │ │ ├── Dockerfile
│ │ │ └── Dockerfile.production
│ │ ├── nginx/
│ │ │ └── config/
│ │ │ └── default.conf
│ │ └── production/
│ │ └── nginx/
│ │ └── config/
│ │ └── default.conf
│ ├── docker-compose.production.yaml
│ └── docker-compose.yaml
├── settings.gradle
├── terms_of_service_ch.md
├── terms_of_service_en.md
└── terms_of_service_jp.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/-------.md
================================================
---
name: 質問&サポート
about: わからないことや質問
title: ''
labels: ''
assignees: ''
---
## 困っていること
## 画面名、機能名など(任意)
================================================
FILE: .github/ISSUE_TEMPLATE/-----.md
================================================
---
name: 不具合報告
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
## 不具合の概要
## 再現方法
**不具合の再現方法を箇条書きで記述してください**
## 期待する動作
## Screenshots
**不具合が発生した時のスクリーンショットやキャプチャー**
## 不具合が発生した時の端末
- Device:
- OS Version:
- App Version:
## 備考
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
## 不具合の概要
## 再現方法
**不具合の再現方法を箇条書きで記述してください**
## 期待する動作
## Screenshots
**不具合が発生した時のスクリーンショットやキャプチャー**
## 不具合が発生した時の端末
- Device:
- OS Version:
- App Version:
## 備考
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/other.md
================================================
---
name: Other
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''
---
================================================
FILE: .github/dependabot.yml
================================================
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
================================================
FILE: .github/workflows/android-unit-test.yml
================================================
name: Android Unit Test
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: zulu
cache: gradle
- name: Generate secret.properties
env:
PUSH_TO_FCM_AUTH: ${{ secrets.PUSH_TO_FCM_AUTH }}
PUSH_TO_FCM_PUBLIC_KEY: ${{ secrets.PUSH_TO_FCM_PUBLIC_KEY }}
PUSH_TO_FCM_SERVER_BASE_URL: ${{ secrets.PUSH_TO_FCM_SERVER_BASE_URL }}
run: |
echo "push_to_fcm.server_base_url=${PUSH_TO_FCM_SERVER_BASE_URL}" >> ./secret.properties
echo "push_to_fcm.public_key=${PUSH_TO_FCM_PUBLIC_KEY}" >> ./secret.properties
echo "push_to_fcm.auth=${PUSH_TO_FCM_AUTH}" >> ./secret.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run unit-test
run: ./gradlew lint testDebug --continue
- name: Build with Gradle
run: ./gradlew assembleRelease
- uses: actions/upload-artifact@v4
with:
name: outputs
path: app/build/outputs/
================================================
FILE: .github/workflows/release.yml
================================================
name: Release Android to Google Play Store
on:
push:
branches-ignore:
- '**'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: zulu
cache: gradle
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks
echo "KEYSTORE_PATH=$(pwd)/app/keystore.jks" >> $GITHUB_ENV
- name: Generate secret.properties
env:
PUSH_TO_FCM_AUTH: ${{ secrets.PUSH_TO_FCM_AUTH }}
PUSH_TO_FCM_PUBLIC_KEY: ${{ secrets.PUSH_TO_FCM_PUBLIC_KEY }}
PUSH_TO_FCM_SERVER_BASE_URL: ${{ secrets.PUSH_TO_FCM_SERVER_BASE_URL }}
run: |
echo "push_to_fcm.server_base_url=${PUSH_TO_FCM_SERVER_BASE_URL}" >> ./secret.properties
echo "push_to_fcm.public_key=${PUSH_TO_FCM_PUBLIC_KEY}" >> ./secret.properties
echo "push_to_fcm.auth=${PUSH_TO_FCM_AUTH}" >> ./secret.properties
- name: Get the version tag
run: echo "ORG_GRADLE_PROJECT_VERSION_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Restore publish json key and write to ANDROID_PUBLISHER_CREDENTIALS
run: |
echo "${{ secrets.ANDROID_PUBLISHER_CREDENTIALS_BASE64 }}" | base64 --decode > app/google-play-publisher.json
echo "ANDROID_PUBLISHER_CREDENTIALS_FILE=$(pwd)/app/google-play-publisher.json" >> $GITHUB_ENV
# run: |
# JSON_CONTENT="$(echo "${{ secrets.ANDROID_PUBLISHER_CREDENTIALS_BASE64 }}" | base64 --decode)"
# echo "ANDROID_PUBLISHER_CREDENTIALS=$JSON_CONTENT" >> $GITHUB_ENV
- name: Calculate version code
run: echo "ORG_GRADLE_PROJECT_VERSION_CODE=$((${{ github.run_number }} + 3000))" >> $GITHUB_ENV
- name: Assemble release build and publish
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
run: |
./gradlew publishBundle \
-Pandroid.injected.signing.store.file=$KEYSTORE_PATH \
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
-Pandroid.injected.signing.key.alias=$ALIAS \
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
================================================
FILE: .github/workflows/release2github.yml
================================================
name: Release Android to Github Releases
on:
push:
branches-ignore:
- '**'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: zulu
cache: gradle
- name: Decode Keystore
run: |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > app/keystore.jks
echo "KEYSTORE_PATH=$(pwd)/app/keystore.jks" >> $GITHUB_ENV
- name: Generate secret.properties
env:
PUSH_TO_FCM_AUTH: ${{ secrets.PUSH_TO_FCM_AUTH }}
PUSH_TO_FCM_PUBLIC_KEY: ${{ secrets.PUSH_TO_FCM_PUBLIC_KEY }}
PUSH_TO_FCM_SERVER_BASE_URL: ${{ secrets.PUSH_TO_FCM_SERVER_BASE_URL }}
run: |
echo "push_to_fcm.server_base_url=${PUSH_TO_FCM_SERVER_BASE_URL}" >> ./secret.properties
echo "push_to_fcm.public_key=${PUSH_TO_FCM_PUBLIC_KEY}" >> ./secret.properties
echo "push_to_fcm.auth=${PUSH_TO_FCM_AUTH}" >> ./secret.properties
- name: Get the version tag
run: echo "ORG_GRADLE_PROJECT_VERSION_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Calculate version code
run: echo "ORG_GRADLE_PROJECT_VERSION_CODE=$((${{ github.run_number }} + 3000))" >> $GITHUB_ENV
- name: build apk
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
run: |
./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=$KEYSTORE_PATH \
-Pandroid.injected.signing.store.password=$KEYSTORE_PASSWORD \
-Pandroid.injected.signing.key.alias=$ALIAS \
-Pandroid.injected.signing.key.password=$KEY_PASSWORD
- name: release to github releases
uses: ncipollo/release-action@v1
with:
artifacts: "app/build/outputs/**/*.apk"
token: ${{ secrets.GITHUB_TOKEN }}
================================================
FILE: .gitignore
================================================
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
secret.properties
benchmark.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml
.idea/codeStyles/*
# User-specific configurations
.idea/caches/build_file_checksums.ser
.idea/codeStyles/
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/dictionaries/
.idea/libraries/
.idea/misc.xml
.idea/scopes/scope_settings.xml
.idea/.name
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Google Services (e.g. APIs or Firebase)
# google-services.json
# Freeline
freeline.py
freeline/
freeline_project_description.json
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Version control
vcs.xml
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
SecretConstant.java
SecretConstantTest.java
MisskeyAndroidClient.zip
.DS_Store
*.jks
================================================
FILE: .idea/.gitignore
================================================
runConfigurations.xml
deploymentTargetDropDown.xml
!.gitignore
androidTestResultsUserPreferences.xml
/inspectionProfiles
================================================
FILE: .idea/AndroidProjectSystem.xml
================================================
================================================
FILE: .idea/GitLink.xml
================================================
================================================
FILE: .idea/deploymentTargetSelector.xml
================================================
================================================
FILE: .idea/deviceManager.xml
================================================
================================================
FILE: .idea/encodings.xml
================================================
================================================
FILE: .idea/jarRepositories.xml
================================================
================================================
FILE: .idea/kotlinc.xml
================================================
================================================
FILE: .idea/markdown.xml
================================================
================================================
FILE: CLAUDE.md
================================================
# Milktea Android SDK 対応チェックリスト
このファイルはAndroid最新SDK対応の進捗管理用です。
作業完了したタスクは `- [ ]` を `- [x]` に変えてください。
---
## Phase 1: M3 テーマ基盤の構築
**全 Compose 作業の前提条件。最初に完了させる。**
### 1-1. XML テーマを Material3 に移行
- [x] `app/src/main/res/values-v23/themes.xml` — `Theme.MaterialComponents` → `Theme.Material3`、システムバー色属性を削除
- [x] `app/src/main/res/values-v27/themes.xml` — 同上
- [x] `modules/common_resource/src/main/res/values/themes.xml` — 同上(Dark/Black/Bread/ElephantDark テーマ)
- [x] `app/src/main/res/values-v21/styles.xml` — 古いスタイル整理
- [x] `modules/common_resource/src/main/res/values/styles.xml` — Widget.MaterialComponents.* → Widget.Material3.* に更新
### 1-2. Compose M3 テーマラッパーの作成
現在 `MdcTheme`(Material2 ブリッジ)を使用中 → M3 の `MaterialTheme` に置き換える。
- [x] `modules/common_compose/MilkteaTheme.kt` に M3 用 `ColorScheme` を 5テーマ分定義
- White / Dark / Black / Bread / ElephantDark
- `Theme.toColorScheme()` 拡張関数で ThemeUtil.kt の Theme enum と同期
- [x] `MdcTheme { }` → `MaterialTheme(colorScheme = ...) { }` に置き換え
- [x] `libs.versions.toml` に `compose-material3 = "1.3.1"` を追加
- [x] `common_compose/build.gradle` で material2 → material3 に差し替え、MdcTheme アダプター削除
- [x] ビルド確認(Phase 2 の import 置き換え前なのでコンパイルエラーが大量に出る想定)
---
## Phase 2: Compose 全体の M3 移行
**ビルドエラーを潰しながら進める。一気にやらず機能モジュール単位で対応。**
### 2-1. 全ファイルの import 置き換え
- [x] `androidx.compose.material.` → `androidx.compose.material3.` に一括置換(注意: API が変わるものがある)
### 2-2. API 変更対応(M2 → M3 で変わる主要コンポーネント)
| M2 | M3 | 対応ファイル数 |
|----|-----|------------|
| `MaterialTheme.colors.*` | `MaterialTheme.colorScheme.*` | 多数 |
| `TopAppBar(backgroundColor=)` | `TopAppBar(colors=TopAppBarDefaults.*)` | 多数 |
| `ModalBottomSheetLayout` | `ModalBottomSheet` | 3ファイル |
| `Scaffold(backgroundColor=)` | `Scaffold(containerColor=)` | 33ファイル |
| `Card(backgroundColor=)` | `Card(colors=CardDefaults.*)` | 多数 |
| `Divider` | `HorizontalDivider` | 複数 |
| `TabRow` | `TabRow`(ほぼ同じだが色指定が変わる) | 複数 |
### 2-3. `ModalBottomSheetLayout` → `ModalBottomSheet` の書き換え(API が別物)
- [x] `SearchAndSelectUserScreen.kt`
- [x] `TabItemsListScreen.kt`
- [x] `AccountSettingScreen.kt`
### 2-4. モジュール別動作確認
- [x] `features/auth` — AuthScreen, SignUpScreen 等
- [x] `features/setting` — 22ファイル(最多)
- [x] `features/note` — エディタ周り
- [x] `features/channel` — ChannelScreen
- [x] `features/drive` — DriveScreen
- [x] `features/user` — ユーザー画面
- [x] `features/messaging` — MessageScreen
- [x] `features/gallery` — GalleryEditorPage
- [x] `features/clip`, `group`, `userlist`, `search`, `account`
- [x] `common_compose`, `common_android_ui` — 共通コンポーネント
### ビルド確認
- [x] `./gradlew :app:assembleDebug` BUILD SUCCESSFUL
---
## Phase 3: Accompanist 廃止ライブラリの置き換え
M3 移行後に対応(M3 の PullToRefreshBox を使うため)。
- [x] `accompanist-swiperefresh`(0.25.1)→ Material3 `PullToRefreshBox` に置き換え(`user/followrequests/FollowRequestsScreen.kt` 等)
- [x] `accompanist-pager`(0.14.0)→ Compose Foundation の `HorizontalPager` / `VerticalPager` に置き換え
- `ChannelScreen.kt`(`ExperimentalPagerApi` 使用中)
- `DriveScreen.kt`(`ExperimentalPagerApi` 使用中)
---
## Phase 4: enableEdgeToEdge() 追加 + テーマのシステムバー色設定を削除
`enableEdgeToEdge()` がシステムバー色を管理するため、テーマ側の設定と競合する(Phase 1 で XML テーマから削除済みのはず)。
- [x] 全 Activity に `enableEdgeToEdge()` を追加(`onCreate` の `setContentView` より前)
---
## Phase 5: Compose 画面の Insets 対応
Phase 4 で `enableEdgeToEdge()` が有効になった後、Compose 側の Insets を整備する。
- [x] 全 `Scaffold` に `contentWindowInsets = WindowInsets.safeDrawing` を設定(33ファイル)
- [x] `AuthScreen.kt` — 既存の `windowInsetsPadding` を `safeDrawing` に統一
- [x] `MessageScreen.kt` — 同上
---
## Phase 6: 簡単な Android View Activity の個別 Insets 対応
`adjustResize` → `adjustNothing` への変更 + `ViewCompat.setOnApplyWindowInsetsListener` で Insets を手動適用。
- [x] `AuthorizationActivity` — `windowSoftInputMode` 変更 + Insets 対応
- [x] `SearchActivity` — `windowSoftInputMode` 変更 + Insets 対応
- [x] `GalleryPostsActivity` — `windowSoftInputMode` 変更 + Insets 対応
- [x] `SearchAndSelectUserActivity` — `windowSoftInputMode` 変更 + Insets 対応
---
## Phase 7: MainActivity(DrawerLayout)対応
DrawerLayout は `fitsSystemWindows` の挙動が変わるため個別対応が必要。
> **注意: ViewPager2 の Insets 非伝播問題**
> ViewPager2 は内部の `RecyclerView` が Window Insets を子 View に伝播しない既知の問題がある。
> 各 Fragment が独自に Insets を処理するか、以下のワークアラウンドが必要:
> ```kotlin
> ViewCompat.setOnApplyWindowInsetsListener(viewPager) { _, insets ->
> for (i in 0 until viewPager.childCount) {
> ViewCompat.dispatchApplyWindowInsets(viewPager.getChildAt(i), insets)
> }
> insets
> }
> ```
>
> **ViewPager2 使用箇所(要個別確認):**
> - `TabFragment` — メインタブ(MainActivity 内)
> - `SearchTopFragment` — 検索タブ
> - `SearchResultActivity` — 検索結果タブ
> - `MediaActivity` — メディアビューア
> - `NoteDetailPagerFragment` — ノート詳細
> - `UserDetailActivity` — ユーザープロフィールタブ
> - `GalleryPostTabFragment` — ギャラリータブ
> - `NotificationMentionFragment` — 通知タブ
> - `EmojiPickerFragment` — 絵文字ピッカー
> - `ReactionHistoryPagerDialog` — リアクション履歴
> - `BottomSheetViewPager` — ボトムシート内 ViewPager
- [x] `activity_main.xml` の DrawerLayout から `android:fitsSystemWindows="true"` を削除(NavigationView は保持)
- [x] `MainActivity` に `enableEdgeToEdge()` 追加(Phase 4 で対応済み)
- [x] `MainActivity` に `ViewCompat.setOnApplyWindowInsetsListener` を追加、BottomNavigationView に bottom inset を適用
- [x] `fragment_tab.xml` の AppBarLayout に `fitsSystemWindows="true"` を追加して status bar inset を処理
- [ ] ナビゲーションドロワーの表示確認(要実機確認)
- [ ] `windowSoftInputMode="adjustPan"` → `adjustNothing` への変更検討
- [ ] `TabFragment` の ViewPager2 に Insets dispatch ワークアラウンドを追加(TabFragment は旧 ViewPager を使用、不要)
---
## Phase 8: キーボード絡みの Activity 対応
IME(ソフトキーボード)表示時のレイアウト調整が必要な Activity。
- [x] `NoteEditorActivity` — `adjustResize` → `adjustNothing` + `WindowInsetsCompat.Type.ime()` で対応
- [x] `MessageActivity` — `adjustResize` → `adjustNothing` + IME Insets でチャット UI を押し上げ(MessageScreen.kt の contentWindowInsets を safeContent に変更)
---
## Phase 9: SDK・ライブラリバージョン更新
### SDK
- [x] `compileSdk` 34 → 35
- [x] `targetSdk` 34 → 35
### AGP・ビルドツール
- [x] AGP `8.1.3` → `8.7.3` / Gradle `8.4` → `8.9`
- [x] Google Services Plugin `4.3.15` → `4.4.2`
- [x] Firebase Crashlytics Gradle `2.9.7` → `3.0.3`
### ライブラリ
- [ ] Kotlin `2.0.0` → `2.1.x`(**要 kapt → KSP 移行**。Dagger/Hilt の kapt が Kotlin 2.1.x メタデータ形式未対応)
- [ ] Compose BOM 最新化(現在 `1.7.1`)
- [x] Hilt `2.48.1` → `2.56` / hilt-work, hilt-compiler `1.0.0` → `1.2.0`
- [x] Room `2.6.0` → `2.7.0`
- [ ] Coil `2.4.0` → `3.x`(API 変更あり、要注意)
- [x] OkHttp `4.10.0` → `4.12.0`
- [x] Retrofit `2.9.0` → `2.11.0`
- [x] Firebase BOM `32.2.2` → `33.12.0`
- [x] kotlinx.datetime `0.4.0` → `0.6.1`
- [x] kotlinx.serialization `1.6.3` → `1.7.3`
- [x] coroutines `1.7.3` → `1.8.1`(新たに libs.versions.toml 管理へ)
- [x] `swiperefreshlayout` `1.2.0-alpha01` → `1.1.0`(安定版)
- [x] desugar_jdk_libs `1.1.5` → `2.1.3`
### benchmark モジュール
- [x] `benchmark/build.gradle` の Java バージョンを `1.8` → `17` に統一
### その他対応
- [x] バージョン定義を `libs.versions.toml` に一元化(room/retrofit/coroutines/nav/firebase-bom を ext ブロックから移行)
- [x] SDK 35 対応: `Bitmap.Config` nullable 化 (`QRCodeBitmapGenerator.kt`)
- [x] Firebase BOM 33.x 対応: `play-services-base` を data module に明示追加
### 残タスク(Phase 10 候補)
- [ ] Kotlin `2.1.x` 移行(kapt → KSP への全モジュール移行が必要)
- [ ] Coil `3.x` 移行(アーティファクト ID 変更 + API 変更)
- [ ] Compose BOM 最新化
---
## Phase 10: 16KB ページサイズ対応
Android 15 以降で 16KB ページサイズデバイスに対応するための変更。
- [x] `AndroidManifest.xml` に `android:extractNativeLibs="false"` を追加(.so を APK 内で非圧縮格納し直接 mmap 可能にする)
- [x] Flipper を削除(16KB 非対応のネイティブライブラリ libflipper.so 等を除去)
- `app/build.gradle` から `com.facebook.flipper:flipper`, `soloader`, `flipper-network-plugin` を削除
- `FlipperSetupManagerImpl.kt` を削除
- `DebugAppModule.kt` / `DebugAPIModule.kt` を no-op 実装に置き換え
- `EmptyDebuggerSetupManagerImpl` を `main` ソースセットに移動
---
## 参考:主要ファイルパス
| 内容 | パス |
|------|------|
| アプリ build.gradle | `app/build.gradle` |
| バージョンカタログ | `libs.versions.toml` |
| AndroidManifest | `app/src/main/AndroidManifest.xml` |
| Compose テーマ | `modules/common_compose/src/main/java/net/pantasystem/milktea/common_compose/MilkteaTheme.kt` |
| テーマユーティリティ | `app/src/main/java/jp/panta/misskeyandroidclient/ThemeUtil.kt` |
| MainActivity | `app/src/main/java/jp/panta/misskeyandroidclient/MainActivity.kt` |
| メインレイアウト | `app/src/main/res/layout/activity_main.xml` |
| テーマ(v23) | `app/src/main/res/values-v23/themes.xml` |
| テーマ(v27) | `app/src/main/res/values-v27/themes.xml` |
| 共通テーマ | `modules/common_resource/src/main/res/values/themes.xml` |
| AuthScreen | `modules/features/auth/src/main/java/net/pantasystem/milktea/auth/AuthScreen.kt` |
| MessageScreen | `modules/features/messaging/src/main/java/net/pantasystem/milktea/messaging/MessageScreen.kt` |
| ChannelScreen | `modules/features/channel/src/main/java/net/pantasystem/milktea/channel/ChannelScreen.kt` |
| DriveScreen | `modules/features/drive/src/main/java/net/pantasystem/milktea/drive/DriveScreen.kt` |
| 設定 Compose | `modules/features/setting/src/main/java/net/pantasystem/milktea/setting/` |
================================================
FILE: CONTRIBUTING.md
================================================
# Contribution Guide
Milkteaにコントリビュートするためのガイドです。
## Issue
下記のIssueを受け付けています。
- 不具合報告
- 新機能要望
- 機能強化要望
- 質問
## Pull Request
Pull Requestはいつでも大歓迎です!
IssueからPull Requestを作成するときは、必ずAssignするようにしてください。
Pull Requestを作成するときは下記ルールに従い作成するようにしてください。
- ライセンスや法を遵守したコードであること
- アーキテクチャやコーディング規約が存在する場合はそれらに従ったコードを書くこと
- テンプレートに従いPRを作成すること
- 動作するコードであること(CI/CDが完了する&エミュレーターで動作することを確認してください)
## ブランチの命名規則
### 機能開発&リファクタリング
Issueが存在しない場合はfeatureで初めてスラッシュで区切って、作業名や機能名で分割するようにしてください
`feature/機能名`
機能ブランチかつIssueが存在する場合はfeatureスラッシュ、で初めて次にシャープIssue番号、次にスラッシュで区切って作業名や機能名で分割するようにしてください。
`feature/#Issue番号/機能名`
### 不具合修正系
hotfixで始めるようにして、Issueが存在する場合はIssue番号を入れて、
存在しない場合はそのまま修正する機能名や不具合名で始めるようにしてください。
`hotfix/#Issue番号/機能名or不具合名`
`hotfix/機能名or不具合名`
# アーキテクチャ
現在MilkteaではMVVMアーキテクチャをベースとしたアーキテクチャを採用しています。
非同期系の処理にはCoroutinesを採用しています。
リアクティブ系の処理にはCoroutines Flowを使用して処理をしています。
## ディレクトリ構成
Milkteaではマルチモジュール構成になっていて、以下のような構造になっています。
```
.
├──app
├──modules
├──api
├──api_streaming
├──app_store
├──common
├──common_android
├──common_android_ui
├──common_compose
├──common_navigation
├──common_resource
├──common_viewmodel
├──data
├──features
├──antenna
├──auth
├──channel
├──drive
├──favorite
├──gallery
├──group
├──media
├──messaging
├──note
├──notification
├──search
├──setting
├──user
├──userlist
├──model
```
### app
MainActivityなどの初回起動系のActivityやその関連の処理が入っています。
### modules
各種モジュールが入っているモジュールディレクトリです。
### api
Retrofit2のインターフェースや、通信のためのDTOなどのオブジェクトがここに入っています。
### api_streaming
MisskeyのStreaming APIに関する処理のモジュールです。
### app_store
アプリ全体で共有したい状態を管理する機能のことをMilkteaでは.*Storeと呼んでいて、
app_storeモジュールはそれら機能を配置するためのモジュールです。
### common
Android, プロジェクトに依存しないような共通で使われる機能用のモジュールです。
### common_android
Androidに関する共通機能を内包したモジュールです。
UIに関する機能は後述するcommon_android_uiかcommon_composeに分類しています。
### common_android_ui
AndroidのUIに関する共通機能などをここに分類しています。
### common_compose
Jetpack Composeに関する共通機能をここに分類しています。
### common_navigation
マルチモジュールを実現するために、遷移先の実装を抽象化する必要がありました。
common_navigationは画面繊維や、その抽象のためのインターフェースが分類されています。
### common_resource
drawableやstringsなどで共通して使いたいリソースをここに分類しています。
### common_viewmodel
本来ViewModelは画面:1で存在するべきものですが、
確認ダイアログやアプリ全体で共通して使う必要のあるViewModel実装をここに分類しています。
基本的には.*Storeで事足りるので、滅多に使わないものだと思ってください。
### data
API通信やDB処理に関する実装クラスがここに入っています。
後述するmodelに作成された抽象をここで実装することが多いです。
### features
このディレクトリには、各種機能ごとのUIのモジュールが格納されています。
各種機能のモジュールには、viewmodelやそのUIに関する処理が格納されています。
### model
ビジネスロジックや、APIやDB処理やキャッシュ処理などの抽象がここに入っています。
一般的にはここに抽象が作成され、dataモジュールで実装され、HiltというDIコンテナーで依存性の解決を行うことが多いです。
## 代表的な役割クラス
MilkteaではMVVMアーキテクチャを採用しています。
その中でもMilktea内でよく使われる概念や用語の説明をします。
### リソース名(Entity)
UserやNoteなどのリソース名を直接指定したオブジェクトをEntityと呼称しています。
主にそのリソースに関するフィールドを持っていたり、そのデータに関連する振る舞いの実装を持っていることが多いです。
### リソース名Repository(Repository)
永続化処理に関する抽象クラスです。
主にAPIへの取得、更新リクエストや、DBへの取得更新リクエストを行なっています。
またMilkteaでは後述するDataSourceというサーバキャッシュ層を持っており、それらの更新をRepositoryが担っていたりします。
### リソース名DataSource(DataSource)
サーバーから取得したデータ(Entity)のキャッシュを行なっています。
実際には実装クラスがあり、メモリ上やSQLite上に実装されることがあります。
### リソース名Relation
複数のEntityを組み合わせた構造体です。
### 機能名,画面名ViewModel(ViewModel)
ViewModelです。
### 機能名,画面名Activity(Activity)
Activityです。
### 機能名,画面名Fragment(Fragment)
Fragmentです。
### 要素名Adapter(RecyclerView.Adapter)
RecyclerView.Adapterの実装クラスです。
ごく稀に諸事情でListViewのAdapter実装クラスの場合もあります。
### リソース名ViewData
EntityやRelationをよりViewに最適化した構造のことをViewDataと呼称しています。
レイヤーとしてはViewModelやアプリケーション層に分類されると思っています。
## ビルドするには
プロジェクトをgit cloneします。
secret.propertiesを作成します。
```
touch secret.properties
```
secret.propertiesには
以下のような属性を追加してプッシュ通知の中継鯖についての設定をします。
プッシュ通知中継サーバについて
https://github.com/pantasystem/MisskeyAndroidClient/blob/develop/PushToFCM/README.md
push_to_fcm.server_base_urlにはプッシュ通知サーバのベースURLを設定します。
push_to_fcm.public_keyにはPushToFCMで生成したpublicを設定します。
push_to_fcm.authにはPushToFCMで生成したauthを設定します。
```
push_to_fcm.server_base_url=https://hogehogehoge-pus
push_to_fcm.public_key=中継鯖(PushToFCM)に設定したpublic_keyを設定します
push_to_fcm.auth=中継鯖に設定したauth_secret.txtを設定します
```
Android SDK, AndroidStudioでビルドします。
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
================================================
FILE: PushToFCM/.dockerignore
================================================
node_modules
npm-debug.log
================================================
FILE: PushToFCM/.gitignore
================================================
/node_modules
================================================
FILE: PushToFCM/README.md
================================================
# プッシュ通知中継サーバ
これはプッシュ通知を受信するための中継サーバプログラムです。
## 説明
Misskeyからプッシュ通知を受信するには
中継サーバを構築して、そこからFirebase Cloud Massaging経由で通知を送信します。
## 使用方法
### secretとkeyの生成
初めにkeyGenerator.jsをnode.jsで実行してプッシュ通知を使用するための鍵を取得します。
```
node keyGenerator.js
public: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
private: yyyyyyyyyyyyyyyyyyyyyyyyyyyyy
auth: vvvvvvvvvvvvvv
```
keyディレクトリに以下のファイルを作成します。
auth_secret.txt
private_key.txt
public_key.txt
```
touch ./key/auth_secret.txt
touch ./key/private_key.txt
touch ./key/public_key.txt
```
それぞれのファイルにkeyGenerator.jsで生成した値を設定します。
publicを./key/public_key.txt
privateを./key/private_key.txt
authを./key/auth_secret.txt
```
echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx > ./key/public_key.txt
echo yyyyyyyyyyyyyyyyyyyyyyyyyyyyy > ./key/private_key.txt
echo vvvvvvvvvvvvvv > ./key/auth_secret.txt
```
### Firebase adminの設定
Firebase Cloud Messagingに接続するために
サーバーにFirebase Adminの設定をする必要があります。
https://firebase.google.cn/docs/admin/setup?hl=ja
```
export GOOGLE_APPLICATION_CREDENTIALS=firebase-adminのjsonファイル.json
```
index.jsを起動します。
あとはnginxなどで中継するように設定してください。
================================================
FILE: PushToFCM/docker/Dockerfile
================================================
from node:12
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
COPY . .
EXPOSE 3000
CMD ["node", "index.js"]
================================================
FILE: PushToFCM/docker/node/Dockerfile
================================================
FROM node:16
WORKDIR /usr/src/app
================================================
FILE: PushToFCM/docker-compose.yml
================================================
version: "3"
services:
push-server:
build: ./docker/node
user: ${user}
ports:
- 3000:3000
volumes:
- ./:/usr/src/app
command: ["node", "index.js"]
healthcheck:
test: ["CMD-SHELL", "curl -fSsO /dev/null http://localhost:3000/health || exit 1"]
interval: "1s"
timeout: "1s"
retries: "2"
================================================
FILE: PushToFCM/index.js
================================================
const express = require('express');
const app = express();
const Concat = require('concat-stream');
const fs = require('fs');
const i18n = require('i18n');
const notificationBuilder = require('./notification_builder');
const webPushDecipher = require('./webPushDecipher.js');
const AUTH_SECRET = fs.readFileSync('./key/auth_secret.txt', 'utf8');
const PUBLIC_KEY = fs.readFileSync('./key/public_key.txt', 'utf8');
const PRIVATE_KEY = fs.readFileSync('./key/private_key.txt', 'utf8');
const admin = require('firebase-admin');
const { resourceUsage } = require('process');
admin.initializeApp({
credential: admin.credential.applicationDefault(),
});
const messaging = admin.messaging();
i18n.configure({
locales: ['ja', 'en'],
defaultLocal: 'en',
directory: __dirname + "/locales",
objectNotation: true
});
console.log('start server');
app.use(i18n.init);
const switchLangMiddleware = (req, _, next) => {
if(req.query.lang) {
i18n.setLocale(req, req.query.lang);
}else{
i18n.setLocale(req, 'en');
}
next();
}
const rawBodyMiddlware = (req, _, next) => {
req.pipe(new Concat(function(data) {
req.rawBody = data;
next();
}))
}
const decodeBodyMiddleware = (req, res, next) => {
let rawBody = req.rawBody;
if (!rawBody) {
console.log('Invalid Body');
return res.status(200).send('Invalid Body.').end();
}
const converted = rawBody.toString('base64');
const key = webPushDecipher.buildReciverKey(PUBLIC_KEY, PRIVATE_KEY, AUTH_SECRET);
//console.log(`public_key:${PUBLIC_KEY}, private_key:${PRIVATE_KEY}, auth_secret:${AUTH_SECRET}`);
try {
let decrypted = webPushDecipher.decrypt(converted, key, false);
req.rawJson = decrypted;
} catch (e) {
console.log(`Decrypt Error: ${e}, request original url: ${req.originalUrl}, headers:${JSON.stringify(req.headers)}`);
throw e;
}
next();
}
const decodeMastodonWebPushMiddleware = (req, res, next) => {
let rawBody = req.rawBody;
if (!rawBody) {
console.log('Invalid Body');
return res.status(200).send('Invalid Body.').end();
}
const converted = rawBody.toString('base64');
const key = webPushDecipher.buildReciverKey(PUBLIC_KEY, PRIVATE_KEY, AUTH_SECRET);
//console.log(`public_key:${PUBLIC_KEY}, private_key:${PRIVATE_KEY}, auth_secret:${AUTH_SECRET}`);
try {
const saltInHeader = req.headers['encryption'];
const keyidInHeader = req.headers['crypto-key'];
const salt = webPushDecipher.decodeBase64(saltInHeader.substring("salt=".length, saltInHeader.length));
const keyid = webPushDecipher.decodeBase64(keyidInHeader.substring("keyid=".length, keyidInHeader.length));
console.log(`salt:${salt.length}, keyid:${keyid.length}`);
let decrypted = webPushDecipher.decryptContent(converted, key, salt, keyid, false);
req.rawJson = decrypted;
} catch (e) {
console.log(`Decrypt Error: ${e}, request original url: ${req.originalUrl}`);
throw e;
}
next();
}
const parseJsonMiddleware = (req, res, next) => {
try {
req.decodeJson = JSON.parse(req.rawJson);
next();
}catch(e) {
console.log('parse error', req.rawJson, e);
return res.status(400).end();
}
}
app.post('/webpushcallback', rawBodyMiddlware, decodeBodyMiddleware, parseJsonMiddleware, switchLangMiddleware ,async (req, res, next)=>{
let deviceToken = req.query.deviceToken;
let accountId = req.query.accountId;
console.log('call webpushcallback');
if(!(deviceToken && accountId)) {
console.warn('無効な値');
return res.status(410).end();
}
if(req.decodeJson.type != 'notification') {
return res.status(500).end();
}
let convertedNotification;
try {
convertedNotification = notificationBuilder.generateNotification(res, req.decodeJson.body);
} catch (e) {
return res.status(500).end();
}
const msgData = {
title: convertedNotification.title,
body: convertedNotification.body,
type: convertedNotification.type,
notificationId: req.decodeJson.body.id,
accountId: accountId
}
const message = {
token: deviceToken,
notification: {
title: convertedNotification.title,
body: convertedNotification.body
}
};
if(req.decodeJson.body.note != null) {
msgData.noteId = req.decodeJson.body.note.id;
}
if(req.decodeJson.body.userId != null) {
msgData.userId = req.decodeJson.body.userId;
}
message.data = msgData;
// console.log(message);
try {
await messaging.send(message);
res.status(204).end();
return;
} catch (e) {
if (
[
'The registration token is not a valid FCM registration token',
'Requested entity was not found.',
'NotRegistered.'
].includes(e.message)
) {
console.log('トークン切れ');
res.status(410).end();
} else {
console.error("未知のエラー", e);
res.status(500).end();
}
return;
}
});
app.post("/webpushcallback-4-mastodon", rawBodyMiddlware, decodeMastodonWebPushMiddleware, parseJsonMiddleware, switchLangMiddleware ,async (req, res)=>{
let deviceToken = req.query.deviceToken;
let accountId = req.query.accountId;
if(!(deviceToken && accountId)) {
console.warn('無効な値');
return res.status(410).end();
}
const title = req.decodeJson.title;
const body = req.decodeJson.body;
const message = {
token: deviceToken,
notification: {
title: title,
body: body
}
};
message.data = {
title: title,
body: body,
type: req.decodeJson.notification_type,
notificationId: req.decodeJson.notification_id,
accountId: accountId
}
console.log(message);
try {
await messaging.send(message);
res.status(204).end();
return;
} catch (e) {
if (
[
'The registration token is not a valid FCM registration token',
'Requested entity was not found.',
'NotRegistered.'
].includes(e.message)
) {
console.log('トークン切れ');
res.status(410).end();
} else {
console.error("未知のエラー", e);
res.status(500).end();
}
return;
}
});
app.get('/health', switchLangMiddleware,(req, res)=>{
let msg= res.__('test.message');
res.json({'msg': msg});
})
app.listen(3000);
================================================
FILE: PushToFCM/key/.gitignore
================================================
*
!.gitignore
================================================
FILE: PushToFCM/keyGenerator.js
================================================
const crypto = require('crypto');
const util = require('util');
const urlsafeBase64 = require('urlsafe-base64');
const keyCurve = crypto.createECDH('prime256v1');
keyCurve.generateKeys();
console.log("public:", urlsafeBase64.encode(keyCurve.getPublicKey()));
console.log("private:", urlsafeBase64.encode(keyCurve.getPrivateKey()));
console.log("auth:", urlsafeBase64.encode(crypto.randomBytes(16)));
================================================
FILE: PushToFCM/locales/en.json
================================================
{
"title": {
"follow": "Followed",
"mention": "Mentioned by {{name}}",
"reply": "Replied by {{name}}",
"renote": "Renoted by {{name}",
"quote": "Quoted by {{name}}",
"reaction": "{{reaction}}:{{name}}",
"pollVote": "Voted by {{name}}",
"receiveFollowRequest": "Receive follow request",
"followRequestAccepted": "Accepted the follow request"
},
"test": {
"message": "Test"
}
}
================================================
FILE: PushToFCM/locales/ja.json
================================================
{
"title": {
"follow": "フォローされました",
"mention": "{{name}}からメンションがきました",
"reply": "{{name}}さんから返信がきました",
"renote": "{{name}}さんにリノートされました",
"quote": "{{name}}さんに引用されました",
"reaction": "{{reaction}}:{{name}}",
"pollVote": "{{name}}さんが投票しました",
"receiveFollowRequest": "フォローリクエストを受け取りました",
"followRequestAccepted": "フォローリクエストを承認しました"
},
"test": {
"message": "てすと"
}
}
================================================
FILE: PushToFCM/notification_builder.js
================================================
const notificationType = {
follow: "follow",
mention: "mention",
reply: "reply",
renote: "renote",
quote: "quote",
reaction: "reaction",
pollVote: "pollVote",
receiveFollowRequest: "receiveFollowRequest",
followRequestAccepted: "followRequestAccepted"
};
function buildTitle(res, notification) {
if(notification.type == 'reaction') {
return res.__('title.reaction', {name : getDisplayUserName(notification.user), reaction: notification.reaction });
}
if(notification.type == notificationType.follow
|| notification.type == notificationType.receiveFollowRequest
|| notification.type == notificationType.followRequestAccepted
|| notification.type == notificationType.followRequestAccepted
) {
return res.__(`title.${notification.type}`);
}
return res.__(`title.${notification.type}`, {name: getDisplayUserName(notification.user)});
}
function getShortMessageFromNote(note) {
if(note.text || note.cw) {
return note.cw ?? note.text;
}
if(note.files && note.files.length) {
return `files: ${note.files.length}`;
}
if(note.poll != null) {
return `choices: ${note.poll.choices}`;
}
}
function buildBody(_, notification) {
let type = notification.type;
if(type == notificationType.follow) {
return getDisplayUserName(notification.user);
}
if(type == notificationType.mention) {
return getShortMessageFromNote(notification.note);
}
if(type == notificationType.reply) {
return getShortMessageFromNote(notification.note);
}
if(type == notificationType.renote) {
return getShortMessageFromNote(notification.note.renote);
}
if(type == notificationType.quote) {
return getShortMessageFromNote(notification.note);
}
if(type == notificationType.reaction) {
return getShortMessageFromNote(notification.note);
}
if(type == notificationType.pollVote) {
return getShortMessageFromNote(notification.note);
}
return null;
}
class MessagingNotification {
constructor(type, title, body) {
this.type = type;
this.title = title;
this.body = body;
}
}
exports.generateNotification = function (res, notification) {
let type = notification.type;
let title = buildTitle(res, notification);
let body = buildBody(res, notification);
return new MessagingNotification(type, title, body);
}
function getDisplayUserName(user) {
if(user.name) {
return user.name;
}
return user.userName;
}
================================================
FILE: PushToFCM/package.json
================================================
{
"name": "pushtofcm",
"version": "1.0.0",
"description": "Misskey Push to fcm server",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"concat-stream": "^2.0.0",
"crypt": "^0.0.2",
"encoding-japanese": "^1.0.30",
"express": "^4.17.3",
"firebase-admin": "^11.5.0",
"fs": "^0.0.1-security",
"i18n": "^0.13.3",
"node-forge": ">=1.3.0",
"urlsafe-base64": "^1.0.0",
"util": "^0.12.4"
}
}
================================================
FILE: PushToFCM/webPushDecipher.js
================================================
//
// WebPushをdecryptするヤツ(on Node.js)
//
// **参考**
// https://tools.ietf.org/html/rfc8188
// https://tools.ietf.org/html/rfc8291
// https://tools.ietf.org/html/rfc8291#appendix-A
// https://gist.github.com/tateisu/685eab242549d9c9ffc85020f09a4b71
// ↑一部 @tateisu氏のコードを参考にしています
// (アドバイスありがとうございました!→ https://mastodon.juggler.jp/@tateisu/104098620591598243)
// こちらのコードは@YuigaWadaさんのコードを一部改変して利用しています。
// https://github.com/YuigaWada/MissCat/blob/develop/ApiServer/api.js
const util = require("util");
const crypto = require("crypto");
const encoding = require('encoding-japanese');
function decodeBase64(src) {
return Buffer.from(src, "base64");
}
function sha256(key, data) {
return crypto.createHmac("sha256", key).update(data).digest();
}
function log(verbose, label, text) {
if (!verbose) { return; }
console.log(label, text);
}
// 通知を受け取る側で生成したキーを渡す
exports.buildReciverKey = function (public, private, authSecret) {
this.public = decodeBase64(public);
this.private = decodeBase64(private);
this.authSecret = decodeBase64(authSecret);
return this;
};
// WebPushで流れてきた通知をdecrypt
exports.decrypt = function (body64, receiverKey, verbose) {
let body = decodeBase64(body64);
// bodyを分解してsalt, keyid, 暗号化されたcontentsを取り出す
// bodyの構造は以下の通り↓
/*
https://tools.ietf.org/id/draft-ietf-httpbis-encryption-encoding-09.xml#header
+-----------+--------+-----------+---------------+
| salt (16) | rs (4) | idlen (1) | keyid (idlen) |
+-----------+--------+-----------+---------------+
*/
const salt = body.slice(0, 16);
const rs = body.slice(16, 16 + 4);
const idlen_hex = body.slice(16 + 4, 16 + 4 + 1).toString("hex");
const idlen = parseInt(idlen_hex, 16); // keyidの長さ
const keyid = body.slice(16 + 4 + 1, 16 + 4 + 1 + idlen);
const content = body.slice(16 + 4 + 1 + idlen, body.length);
// For Verbose Mode
log(verbose, "salt", salt.toString("base64"));
log(verbose, "rs", rs.toString("hex"));
log(verbose, "idlen_hex", idlen_hex);
log(verbose, "idlen", idlen);
log(verbose, "keyid", keyid.toString("base64"));
return decryptContent(content, receiverKey, salt, keyid, verbose);
};
function decryptContent(content, receiverKey, salt, keyid ,verbose) {
let auth_secret = receiverKey.authSecret;
let receiver_public = receiverKey.public;
let receiver_private = receiverKey.private;
const sender_public = decodeBase64(keyid.toString("base64"));
// 共有秘密鍵を生成(ECDH)
let receiver_curve = crypto.createECDH("prime256v1");
receiver_curve.setPrivateKey(receiver_private);
const sharedSecret = receiver_curve.computeSecret(keyid);
/*
# HKDF-Extract(salt=auth_secret, IKM=ecdh_secret)
PRK_key = HMAC-SHA-256(auth_secret, ecdh_secret)
# HKDF-Expand(PRK_key, key_info, L_key=32)
key_info = "WebPush: info" || 0x00 || ua_public || as_public
IKM = HMAC-SHA-256(PRK_key, key_info || 0x01)
## HKDF calculations from RFC 8188
# HKDF-Extract(salt, IKM)
PRK = HMAC-SHA-256(salt, IKM)
# HKDF-Expand(PRK, cek_info, L_cek=16)
cek_info = "Content-Encoding: aes128gcm" || 0x00
CEK = HMAC-SHA-256(PRK, cek_info || 0x01)[0..15]
# HKDF-Expand(PRK, nonce_info, L_nonce=12)
nonce_info = "Content-Encoding: nonce" || 0x00
NONCE = HMAC-SHA-256(PRK, nonce_info || 0x01)[0..11]
*/
// key
const prk_key = sha256(auth_secret, sharedSecret);
const keyInfo = Buffer.concat([
Buffer.from("WebPush: info\0"),
receiver_public,
sender_public,
Buffer.from("\1")
]);
const ikm = sha256(prk_key, keyInfo);
// prk
// https://tools.ietf.org/id/draft-ietf-httpbis-encryption-encoding-09.xml#derivation
const prk = sha256(salt, ikm);
log(verbose, "prk", prk.toString("base64"));
// cek
// https://tools.ietf.org/id/draft-ietf-httpbis-encryption-encoding-09.xml#derivation
const cekInfo = Buffer.from("Content-Encoding: aes128gcm\0\1");
const cek = sha256(prk, cekInfo).slice(0, 16);
log(verbose, "cek", cek.toString("base64"));
// initialization vector
// https://tools.ietf.org/id/draft-ietf-httpbis-encryption-encoding-09.xml#nonce
const nonceInfo = Buffer.from("Content-Encoding: nonce\0\1");
const nonce = sha256(prk, nonceInfo).slice(0, 12);
const iv = nonce;
log(verbose, "nonce:", nonce.toString("base64"));
// aes-128-gcm
const decipher = crypto.createDecipheriv("aes-128-gcm", cek, iv);
let result = decipher.update(content);
log(verbose, 'type:', typeof(result));
log(verbose, '文字コード:', encoding.detect(result));
log(verbose, "decrypted: ", result.toString("utf8"));
// remove padding and GCM auth tag
while (result.slice(result.length-1,result.length) != "}") { // jsonの末端が見えるまで一文字ずつ消していく
result = result.slice(0,result.length-1);
}
log(verbose, "shaped:", result.toString("utf8"));
return result.toString("utf8");
}
exports.decryptContent = decryptContent;
exports.decodeBase64 = decodeBase64;
================================================
FILE: README-EN.md
================================================
# Milktea
Would you like Milktea with Misskey?
Misskey Android client app
## Introduction
Milktea is Android client app for [Misskey](https://github.com/misskey-dev/misskey)
## Purpose
Milktea was developed to achieve following purposes.
- Provide as like Android UI
- Support as many Misskey features as possible
- Comfortable touch even if you have migrated from other social network apps
- Unique features to make Milktea easier to use
- Get more people to use Misskey
- Develop Milktea on an ongoing basis
## Features
### Timeline
Milktea can displaies Timeline from Misskey instance in real time.
### Timeline Tab function
You can fix and rearrange the most frequently viewed Timeline at the top of tabs.
The tab function can be used to fix below Timeline.
- Global Timeline
- Social Timeline
- Local Timeline
- Home Timeline
- User List Timeline
- List of user's Notes
- Search result
- Antenna Timeline
- Gallery
- List of Threads
- Favorite
- Notification
### Posting Note
You can create and post Notes from Milktea.
There is no need to wait until the finish of its upload when posting Notes, because its upload is done asynchronously.
### Reaction Picker
The function of making a reaction for Notes.
Reaction picker is categorized by (custom)emojis on the tabs.
- Pinned user's setting
- Frequently used emojis
- Several (custom)emoji categories
### Save drafts of Notes
This is one of the unique feature for Milktea.
You can save a draft of Notes while creating it.
### Drive
You can see your own files in Misskey Drive.
### Overwrite display name
In Misskey, there was a case that the Name displayed on the screen was different from the nickname which used in the conversation between Misskey users. It was very complicated to have a difference of Name and the nickname. So, I implemented a function to overwrite the nickname and only display it on Milktea.
## Installation
Download from [Google Play Store](https://play.google.com/store/apps/details?id=jp.panta.misskeyandroidclient) and install into your device.
Create your account on the instance you wish to use.
[About Misskey](https://misskey-hub.net/en/docs/misskey.html) /
[List of Instances](https://misskey-hub.net/en/instances.html)
Launch the app after its installation is complete.
When "Authentication" screen appears, type Misskey instance URL you're trying to use.
For example, when you want to use misskey.io, type `misskey.io` .
You can freely change "App name".
"App name" maybe displaied with "via" on the instance depending on a Misskey version of it.
Press AUTHENTICATION when you're ready.
The authentication screen will appear in your default browser. If there is no problem, click "Accept".
If you're not redirected to the app, press the "Back" button and press "I have given permission".
If successful, you will be redirected to Milktea and press "CONTINUE" to complete.
## Build
`git clone` this repo and create a file `secret.properties`.
```
touch secret.properties
```
Add the following attributes to secret.properties to configure the settings about the relay server for push notifications.
To read more about the relay server for push notifications, please check below link.
https://github.com/pantasystem/MisskeyAndroidClient/blob/develop/PushToFCM/README.md
Set these settings for each variables:
Base URL for the push notification server for `push_to_fcm.server_base_url`
`public_key` generated by PushToFCM for `push_to_fcm.public_key`
`auth_secret.txt` generated by PushToFCM for `push_to_fcm.auth`
For example:
```
push_to_fcm.server_base_url=https://FooBarFooBar-pus
push_to_fcm.public_key=public_key
push_to_fcm.auth=auth_secret.txt
```
And then, build Milktea on Android SDK or AndroidStudio.
================================================
FILE: README.md
================================================
# Milktea
FediverseにMilkteaはいかが?
Misskey, MastodonのAndroidクライアント
## 説明
MilkteaはMastodonと[Misskey](https://github.com/misskey-dev/misskey)のためのAndroidクライアントアプリケーションです。
## 目標
Milkteaでは以下のことを達成することを目標とし開発をしました。
- ソフトウェアの差をできる限り意識させることなくFediverseライフをおくれるようにすること
- AndroidらしいUIで提供すること
- 競合サービスから移住してきても違和感なく触れるUIであること
- 独自機能を追加してより使いやすくすること
- 継続的な開発ができること
- Fediverseの存在を意識せずにFediverse lifeをおくれるようにすること
## 機能
### タイムライン
Mastodon, Misskeyから流れてきたタイムラインを、
リアルタイムで表示することができます。
### タイムラインタブ機能
よく表示するタイムラインを上部のタブに固定&並び替えをすることができます。
タブ機能は以下のタイムラインの項目を固定することができます。
- グローバルタイムライン
- ソーシャルタイムライン
- ローカルタイムライン
- ホームタイムライン
- ユーザーリストタイムライン
- ユーザーの投稿一覧
- 検索結果
- アンテナタイムライン
- ギャラリー
- スレッド一覧
- お気に入り
- 通知
### ノート投稿
Milkteaから投稿を作成することができます。
ファイルのアップロードが非同期で行われるため、
投稿時にファイルアップロードを待つ必要がありません。
### リアクションピッカー
ノートにリアクションを付けるときのための機能です。
リアクションピッカーはタブ状にカスタム絵文字、絵文字が分類されています。
- ユーザー固定
- よく使うリアクション
- カテゴリ別(複数)
### ノートの下書き機能
Milkteaの独自機能で、
ノートを途中で下書き保存することができます。
### ドライブ
Misskeyのドライブのファイルを表示することができます。
### ニックネームの上書き
Misskeyでは表記上のニックネームと、
実際にユーザー間の会話で用いられる呼び名が異なることがありました。
表示名と呼び名が異なるのは非常にややこしかったので、
表面的にニックネームを上書き&表示する機能を実装しました。
## インストール方法
[GooglePlayストア](https://play.google.com/store/apps/details?id=jp.panta.misskeyandroidclient)でダウンロード&インストール
利用するインスタンスで事前にアカウントを作成してください。
[はじめに](https://join.misskey.page/ja/wiki/first)
[インスタンス一覧](https://join.misskey.page/ja/wiki/instances/)
インストールが完了したらアプリを起動します。
認可画面が表示されるので、利用しようとしているインスタンスのURLを入力します。
例えばmisskey.ioを利用する場合は、「misskey.io」と入力します。
app nameは自由に設定することがでます。
app nameはインスタンスのバージョンによってはvia名として公開される場合があります。
準備ができれば AUTHENTICATION (認証)を押します。
認証画面がブラウザに表示されるので、問題がなければ許可(Accept)を押します。
もし、リダイレクトしない場合は戻るボタンを押して、「私は許可をしました」を押してください。
成功すればMilkteaにリダイレクトするので[続行(CONTINUE)]を押し完了です。
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
plugins {
id('com.android.application')
id('kotlin-android')
id('kotlin-kapt')
alias libs.plugins.kotlin.serialization.plugin
id('com.google.gms.google-services')
id('com.google.android.gms.oss-licenses-plugin')
id('dagger.hilt.android.plugin')
id('com.github.triplet.play') version("3.7.0")
id('com.google.firebase.crashlytics')
alias(libs.plugins.compose.compiler)
}
play {
track = "internal"
enabled = (System.getenv("ANDROID_PUBLISHER_CREDENTIALS_FILE") != null)
if (System.getenv("ANDROID_PUBLISHER_CREDENTIALS_FILE") != null) {
serviceAccountCredentials.set(file(System.getenv("ANDROID_PUBLISHER_CREDENTIALS_FILE")))
}
}
android {
compileSdk 35
defaultConfig {
applicationId "jp.panta.misskeyandroidclient"
minSdkVersion 21
targetSdkVersion 35
multiDexEnabled true
versionCode VERSION_CODE as int
versionName VERSION_NAME
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
// プッシュ通知関連のデータをlocal.propertiesからBuildConfigへ書き込んでいます。
def properties = new Properties()
properties.load(project.rootProject.file('secret.properties').newDataInputStream())
def PUSH_TO_FCM_SERVER_BASE_URL = properties.getProperty('push_to_fcm.server_base_url')
def PUSH_TO_FCM_PUBLIC_KEY = properties.getProperty('push_to_fcm.public_key')
def PUSH_TO_FCM_AUTH = properties.getProperty('push_to_fcm.auth')
buildConfigField('String', 'PUSH_TO_FCM_SERVER_BASE_URL', "\"${PUSH_TO_FCM_SERVER_BASE_URL}\"")
buildConfigField('String', 'PUSH_TO_FCM_PUBLIC_KEY', "\"${PUSH_TO_FCM_PUBLIC_KEY}\"")
buildConfigField('String', 'PUSH_TO_FCM_AUTH', "\"${PUSH_TO_FCM_AUTH}\"")
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
benchmark {
initWith release
signingConfig signingConfigs.debug
matchingFallbacks = ['release']
debuggable false
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildFeatures {
compose true
dataBinding true
}
kotlinOptions {
jvmTarget = '17'
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
composeCompiler {
enableStrongSkippingMode = true
}
// for junit5
testOptions {
unitTests.all {
useJUnitPlatform()
}
}
namespace 'jp.panta.misskeyandroidclient'
packagingOptions {
jniLibs {
useLegacyPackaging = false
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':modules:data')
implementation project(path: ':modules:common')
implementation project(path: ':modules:model')
implementation project(path: ':modules:api')
implementation project(path: ':modules:app_store')
implementation project(path: ':modules:features:auth')
implementation project(path: ':modules:features:channel')
implementation project(path: ':modules:features:drive')
implementation project(path: ':modules:features:media')
implementation project(path: ':modules:common_compose')
implementation project(path: ':modules:common_resource')
implementation project(path: ':modules:common_compose')
implementation project(path: ':modules:features:messaging')
implementation project(path: ':modules:common_navigation')
implementation project(path: ':modules:common_viewmodel')
implementation project(path: ':modules:features:gallery')
implementation project(path: ':modules:api_streaming')
implementation project(path: ':modules:features:group')
implementation project(path: ':modules:features:note')
implementation project(path: ':modules:common_android_ui')
implementation project(path: ':modules:features:antenna')
implementation project(path: ':modules:features:user')
implementation project(path: ':modules:features:notification')
implementation project(path: ':modules:features:search')
implementation project(path: ':modules:features:favorite')
implementation project(path: ':modules:features:account')
implementation project(path: ':modules:worker')
implementation project(path: ':modules:features:clip')
testImplementation project(path: ':modules:api_streaming')
implementation project(path: ':modules:common_android')
implementation project(path: ':modules:features:setting')
implementation project(path: ':modules:features:userlist')
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.3'
//noinspection GradleCompatible
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation libs.appcompat.appcompat
implementation libs.androidx.emoji2
implementation libs.androidx.emoji2.bundled
// NOTE: リアクションピッカーなどでリフレクションを行っているのでバージョンを変更しないこと
implementation libs.android.material.material
implementation libs.androidx.constraintlayout
implementation 'androidx.preference:preference-ktx:1.2.0'
//noinspection GradleDynamicVersion
testImplementation 'junit:junit:4.+'
androidTestImplementation libs.androidx.test.ext.junit
// Required for instrumented tests
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation libs.androidx.test.espresso.core
androidTestImplementation 'com.android.support.test:rules:1.0.2'
implementation libs.room.runtime
kapt libs.room.compiler
// optional - Kotlin Extensions and Coroutines support for Room
implementation libs.room.ktx
// optional - Test helpers
testImplementation libs.room.testing
implementation libs.lifecycle.runtime
kapt libs.lifecycle.compiler
implementation libs.lifecycle.viewmodel
//Kotlin coroutines用ライブラリ(async, await)
implementation libs.coroutines.android
testImplementation libs.coroutines.test
testImplementation libs.arch.core.testing
implementation libs.recyclerview
//retrofit
implementation libs.retrofit
implementation libs.okhttp3.logging.inspector
//glide
//implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation libs.glide.glide
kapt libs.glide.compiler
implementation libs.accompanist.glide
implementation libs.animation.apng
//CardView
//implementation "com.android.support:cardview-v7:28.0.0"
implementation 'androidx.cardview:cardview:1.0.0'
//svg
implementation 'com.caverock:androidsvg-aar:1.4'
implementation libs.flexbox
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.1'
// Swipe refresh
implementation libs.androidx.swiperefreshlayout
// ViewPager2
implementation libs.androidx.viewpager2
implementation libs.kotlin.serialization
implementation libs.wada811.databinding
implementation libs.fragment.ktx
implementation platform(libs.firebase.bom)
implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation libs.androidx.core.ktx
implementation libs.androidx.work.ktx
implementation libs.kotlin.datetime
implementation libs.lifecycle.livedata
// compose
implementation libs.compose.ui.ui
implementation libs.compose.ui.ui.tooling
implementation libs.compose.foundation.foundation
implementation libs.compose.material.material
implementation libs.compose.material.material.icons.core
implementation libs.compose.material.material.icons.extended
androidTestImplementation libs.compose.ui.ui.test.junit4
implementation libs.compose.runtime.runtime.livedata
implementation libs.android.material.compose.theme.adapter
implementation libs.activity.compose
implementation libs.coil.compose
implementation libs.coil.gif
implementation libs.compose.constraintlayout
// hilt
implementation libs.hilt.android
kapt libs.hilt.compiler
androidTestImplementation libs.hilt.android.testing
kaptAndroidTest libs.hilt.compiler
testImplementation libs.hilt.android.testing
kaptTest libs.hilt.compiler
implementation libs.retrofit.serialization.converter
// Java language implementation
implementation libs.navigation.fragment.ktx
implementation libs.navigation.ui.ktx
// Kotlin
implementation libs.navigation.fragment.ktx
implementation libs.navigation.ui.ktx
// Feature module Support
implementation libs.navigation.dynamic.features
// Testing Navigation
androidTestImplementation libs.navigation.testing
// Jetpack Compose Integration
implementation libs.navigation.compose
// implementation libs.activity.ktx
implementation libs.activity.ktx
implementation libs.hilt.work
kapt libs.androidx.hilt.compiler
implementation libs.androidx.appstartup
testImplementation libs.junit.jupiter.api
testRuntimeOnly libs.junit.jupiter.engine
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.10'
testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0"
}
kapt {
correctErrorTypes true
}
================================================
FILE: app/google-services.json
================================================
{
"project_info": {
"project_number": "488937418039",
"project_id": "milktea-38a76",
"storage_bucket": "milktea-38a76.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:488937418039:android:e7eff50ab73cb4560f3eb2",
"android_client_info": {
"package_name": "jp.panta.misskeyandroidclient"
}
},
"oauth_client": [
{
"client_id": "488937418039-7a3aos75ncb4u8l5dpsbn6u2t6i7gj1a.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "jp.panta.misskeyandroidclient",
"certificate_hash": "305007c09b8c6d454c4aac5c88dfa92362c5ce88"
}
},
{
"client_id": "488937418039-ohoqu72vcf056djpqlitem3jch0cdjgb.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "jp.panta.misskeyandroidclient",
"certificate_hash": "a0829916db5a5dd7f72264ea3a0550e6ae57b012"
}
},
{
"client_id": "488937418039-qvdak1q6k7n67e0jvi4lc19gtkjvhbnh.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "jp.panta.misskeyandroidclient",
"certificate_hash": "2defef4045b7a3626f4441ee74b61746e5048e46"
}
},
{
"client_id": "488937418039-8utt6eghs42mg99lsc3eepb279pu9d1c.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAGbZBLasgeDN9cziJnlaV1kBxSScWVYYA"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "488937418039-8utt6eghs42mg99lsc3eepb279pu9d1c.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
================================================
FILE: app/proguard-rules.pro
================================================
# flipperの除外設定
-keep class com.facebook.jni.** { *; }
-keep class com.facebook.flipper.** { *; }
-dontwarn com.facebook.litho.**
-dontwarn com.facebook.flipper.**
-dontwarn com.facebook.yoga.**
-dontwarn org.mozilla.**
-dontwarn com.facebook.fbui.**
# retrofitの設定
-keepattributes Signature, InnerClasses, EnclosingMethod
# Retrofit does reflection on method and parameter annotations.
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
-keepattributes AnnotationDefault
# Retain service method parameters when optimizing.
-keepclassmembers,allowshrinking,allowobfuscation interface * {
@retrofit2.http.* ;
}
# Ignore JSR 305 annotations for embedding nullability information.
-dontwarn javax.annotation.**
# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit
# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.KotlinExtensions
-dontwarn retrofit2.KotlinExtensions$*
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
-if interface * { @retrofit2.http.* ; }
-keep,allowobfuscation interface <1>
# Keep inherited services.
-if interface * { @retrofit2.http.* ; }
-keep,allowobfuscation interface * extends <1>
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
-keep,allowobfuscation,allowshrinking class retrofit2.Response
# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
# Kotlin serializationの設定
# Kotlin serialization looks up the generated serializer classes through a function on companion
# objects. The companions are looked up reflectively so we need to explicitly keep these functions.
-keepclasseswithmembers class **.*$Companion {
kotlinx.serialization.KSerializer serializer(...);
}
# If a companion has the serializer function, keep the companion field on the original type so that
# the reflective lookup succeeds.
-if class **.*$Companion {
kotlinx.serialization.KSerializer serializer(...);
}
-keepclassmembers class <1>.<2> {
<1>.<2>$Companion Companion;
}
# glideの設定
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
*** rewind();
}
# ViewPagerの設定
-keep class androidx.viewpager.widget.ViewPager$LayoutParams { int position; }
-keep class com.google.android.material.bottomsheet.BottomSheetBehavior { *** findScrollingChild(...); }
-keepclassmembers enum * {
public *;
}
# databinding
-dontwarn androidx.databinding.**
-keep class androidx.databinding.** { *; }
-keep class * extends androidx.databinding.DataBinderMapper
# glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
*** rewind();
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/10.json
================================================
{
"formatVersion": 1,
"database": {
"version": 10,
"identityHash": "e57ecde54b614792af12c09f03436dc1",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT)",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `id` INTEGER PRIMARY KEY AUTOINCREMENT, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, `file_id` INTEGER PRIMARY KEY AUTOINCREMENT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
},
{
"tableName": "unread_notifications_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `notificationId` TEXT NOT NULL, PRIMARY KEY(`accountId`, `notificationId`), FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"notificationId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "nicknames",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`nickname` TEXT NOT NULL, `username` TEXT NOT NULL, `host` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "nickname",
"columnName": "nickname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "username",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_nicknames_username_host",
"unique": true,
"columnNames": [
"username",
"host"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_nicknames_username_host` ON `${TABLE_NAME}` (`username`, `host`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'e57ecde54b614792af12c09f03436dc1')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/11.json
================================================
{
"formatVersion": 1,
"database": {
"version": 11,
"identityHash": "c50ce2972f355ed260b3b30b300c8a9f",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT)",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `id` INTEGER PRIMARY KEY AUTOINCREMENT, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, `file_id` INTEGER PRIMARY KEY AUTOINCREMENT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `instanceType` TEXT NOT NULL DEFAULT 'misskey', `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceType",
"columnName": "instanceType",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'misskey'"
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
},
{
"tableName": "unread_notifications_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `notificationId` TEXT NOT NULL, PRIMARY KEY(`accountId`, `notificationId`), FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"notificationId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "nicknames",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`nickname` TEXT NOT NULL, `username` TEXT NOT NULL, `host` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "nickname",
"columnName": "nickname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "username",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_nicknames_username_host",
"unique": true,
"columnNames": [
"username",
"host"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_nicknames_username_host` ON `${TABLE_NAME}` (`username`, `host`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'c50ce2972f355ed260b3b30b300c8a9f')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/12.json
================================================
{
"formatVersion": 1,
"database": {
"version": 12,
"identityHash": "d16f596614a6ec0c5703e7719b14256b",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT)",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `id` INTEGER PRIMARY KEY AUTOINCREMENT, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, `file_id` INTEGER PRIMARY KEY AUTOINCREMENT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `channelId` TEXT, `draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "channelId",
"columnName": "channelId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `instanceType` TEXT NOT NULL DEFAULT 'misskey', `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceType",
"columnName": "instanceType",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'misskey'"
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT, `channelId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.channelId",
"columnName": "channelId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
},
{
"tableName": "unread_notifications_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `notificationId` TEXT NOT NULL, PRIMARY KEY(`accountId`, `notificationId`), FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"notificationId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "nicknames",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`nickname` TEXT NOT NULL, `username` TEXT NOT NULL, `host` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "nickname",
"columnName": "nickname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "username",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_nicknames_username_host",
"unique": true,
"columnNames": [
"username",
"host"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_nicknames_username_host` ON `${TABLE_NAME}` (`username`, `host`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'd16f596614a6ec0c5703e7719b14256b')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/3.json
================================================
{
"formatVersion": 1,
"database": {
"version": 3,
"identityHash": "786087deeceb0d1e04244116153de219",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '786087deeceb0d1e04244116153de219')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/4.json
================================================
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "522c0549c443474673b33153ce928a8c",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '522c0549c443474673b33153ce928a8c')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/5.json
================================================
{
"formatVersion": 1,
"database": {
"version": 5,
"identityHash": "4d4ea06174551643c866184ef5de6130",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '4d4ea06174551643c866184ef5de6130')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/6.json
================================================
{
"formatVersion": 1,
"database": {
"version": 6,
"identityHash": "f0b44b577de14e836e23b7ff464647a6",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'f0b44b577de14e836e23b7ff464647a6')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/7.json
================================================
{
"formatVersion": 1,
"database": {
"version": 7,
"identityHash": "75b46cd180746b997e83291bf1013d1a",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '75b46cd180746b997e83291bf1013d1a')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/8.json
================================================
{
"formatVersion": 1,
"database": {
"version": 8,
"identityHash": "7a5223ff0728af36a89dccaed48f97ec",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`updatedAt` TEXT NOT NULL, `accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`file_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
},
{
"tableName": "unread_notifications_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `notificationId` TEXT NOT NULL, PRIMARY KEY(`accountId`, `notificationId`), FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"notificationId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '7a5223ff0728af36a89dccaed48f97ec')"
]
}
}
================================================
FILE: app/schemas/jp.panta.misskeyandroidclient.model.DataBase/9.json
================================================
{
"formatVersion": 1,
"database": {
"version": 9,
"identityHash": "9ca4eba1d0228c9795b0c3a2995db32a",
"entities": [
{
"tableName": "connection_information",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT NOT NULL, `instanceBaseUrl` TEXT NOT NULL, `encryptedI` TEXT NOT NULL, `viaName` TEXT, `createdAt` TEXT NOT NULL, `isDirect` INTEGER NOT NULL, `updatedAt` TEXT NOT NULL, PRIMARY KEY(`accountId`, `encryptedI`, `instanceBaseUrl`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceBaseUrl",
"columnName": "instanceBaseUrl",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedI",
"columnName": "encryptedI",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "viaName",
"columnName": "viaName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "createdAt",
"columnName": "createdAt",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isDirect",
"columnName": "isDirect",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "updatedAt",
"columnName": "updatedAt",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"encryptedI",
"instanceBaseUrl"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "reaction_history",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `id` INTEGER PRIMARY KEY AUTOINCREMENT)",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "Account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "reaction_user_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`reaction` TEXT NOT NULL, `instance_domain` TEXT NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`reaction`, `instance_domain`))",
"fields": [
{
"fieldPath": "reaction",
"columnName": "reaction",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instance_domain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"reaction",
"instance_domain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "page",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` TEXT, `title` TEXT NOT NULL, `pageNumber` INTEGER, `id` INTEGER PRIMARY KEY AUTOINCREMENT, `global_timeline_with_files` INTEGER, `global_timeline_type` TEXT, `local_timeline_with_files` INTEGER, `local_timeline_exclude_nsfw` INTEGER, `local_timeline_type` TEXT, `hybrid_timeline_withFiles` INTEGER, `hybrid_timeline_includeLocalRenotes` INTEGER, `hybrid_timeline_includeMyRenotes` INTEGER, `hybrid_timeline_includeRenotedMyRenotes` INTEGER, `hybrid_timeline_type` TEXT, `home_timeline_withFiles` INTEGER, `home_timeline_includeLocalRenotes` INTEGER, `home_timeline_includeMyRenotes` INTEGER, `home_timeline_includeRenotedMyRenotes` INTEGER, `home_timeline_type` TEXT, `user_list_timeline_listId` TEXT, `user_list_timeline_withFiles` INTEGER, `user_list_timeline_includeLocalRenotes` INTEGER, `user_list_timeline_includeMyRenotes` INTEGER, `user_list_timeline_includeRenotedMyRenotes` INTEGER, `user_list_timeline_type` TEXT, `mention_following` INTEGER, `mention_visibility` TEXT, `mention_type` TEXT, `show_noteId` TEXT, `show_type` TEXT, `tag_tag` TEXT, `tag_reply` INTEGER, `tag_renote` INTEGER, `tag_withFiles` INTEGER, `tag_poll` INTEGER, `tag_type` TEXT, `featured_offset` INTEGER, `featured_type` TEXT, `notification_following` INTEGER, `notification_markAsRead` INTEGER, `notification_type` TEXT, `user_userId` TEXT, `user_includeReplies` INTEGER, `user_includeMyRenotes` INTEGER, `user_withFiles` INTEGER, `user_type` TEXT, `search_query` TEXT, `search_host` TEXT, `search_userId` TEXT, `search_type` TEXT, `favorite_type` TEXT, `antenna_antennaId` TEXT, `antenna_type` TEXT, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageNumber",
"columnName": "pageNumber",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.withFiles",
"columnName": "global_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "globalTimeline.type",
"columnName": "global_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "localTimeline.withFiles",
"columnName": "local_timeline_with_files",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.excludeNsfw",
"columnName": "local_timeline_exclude_nsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localTimeline.type",
"columnName": "local_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "hybridTimeline.withFiles",
"columnName": "hybrid_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeLocalRenotes",
"columnName": "hybrid_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeMyRenotes",
"columnName": "hybrid_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.includeRenotedMyRenotes",
"columnName": "hybrid_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "hybridTimeline.type",
"columnName": "hybrid_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "homeTimeline.withFiles",
"columnName": "home_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeLocalRenotes",
"columnName": "home_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeMyRenotes",
"columnName": "home_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.includeRenotedMyRenotes",
"columnName": "home_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "homeTimeline.type",
"columnName": "home_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.listId",
"columnName": "user_list_timeline_listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userListTimeline.withFiles",
"columnName": "user_list_timeline_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeLocalRenotes",
"columnName": "user_list_timeline_includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeMyRenotes",
"columnName": "user_list_timeline_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.includeRenotedMyRenotes",
"columnName": "user_list_timeline_includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userListTimeline.type",
"columnName": "user_list_timeline_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.following",
"columnName": "mention_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "mention.visibility",
"columnName": "mention_visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mention.type",
"columnName": "mention_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.noteId",
"columnName": "show_noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "show.type",
"columnName": "show_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.tag",
"columnName": "tag_tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "searchByTag.reply",
"columnName": "tag_reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.renote",
"columnName": "tag_renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.withFiles",
"columnName": "tag_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.poll",
"columnName": "tag_poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "searchByTag.type",
"columnName": "tag_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "featured.offset",
"columnName": "featured_offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "featured.type",
"columnName": "featured_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "notification.following",
"columnName": "notification_following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.markAsRead",
"columnName": "notification_markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "notification.type",
"columnName": "notification_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.userId",
"columnName": "user_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "userTimeline.includeReplies",
"columnName": "user_includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.includeMyRenotes",
"columnName": "user_includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.withFiles",
"columnName": "user_withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "userTimeline.type",
"columnName": "user_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.query",
"columnName": "search_query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.host",
"columnName": "search_host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.userId",
"columnName": "search_userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "search.type",
"columnName": "search_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "favorite.type",
"columnName": "favorite_type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.antennaId",
"columnName": "antenna_antennaId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "antenna.type",
"columnName": "antenna_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": [
{
"table": "Account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"accountId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "poll_choice_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`choice` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, `weight` INTEGER NOT NULL, PRIMARY KEY(`choice`, `weight`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "choice",
"columnName": "choice",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"choice",
"weight",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_poll_choice_table_draft_note_id_choice",
"unique": false,
"columnNames": [
"draft_note_id",
"choice"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_poll_choice_table_draft_note_id_choice` ON `${TABLE_NAME}` (`draft_note_id`, `choice`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "user_id",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `draft_note_id` INTEGER NOT NULL, PRIMARY KEY(`userId`, `draft_note_id`), FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"userId",
"draft_note_id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_user_id_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_user_id_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_file_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL DEFAULT 'name none', `remote_file_id` TEXT, `file_path` TEXT, `is_sensitive` INTEGER, `type` TEXT, `thumbnailUrl` TEXT, `draft_note_id` INTEGER NOT NULL, `folder_id` TEXT, `file_id` INTEGER PRIMARY KEY AUTOINCREMENT, FOREIGN KEY(`draft_note_id`) REFERENCES `draft_note_table`(`draft_note_id`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true,
"defaultValue": "'name none'"
},
{
"fieldPath": "remoteFileId",
"columnName": "remote_file_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "filePath",
"columnName": "file_path",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "isSensitive",
"columnName": "is_sensitive",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnailUrl",
"columnName": "thumbnailUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "folderId",
"columnName": "folder_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "fileId",
"columnName": "file_id",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"file_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_file_table_draft_note_id",
"unique": false,
"columnNames": [
"draft_note_id"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_file_table_draft_note_id` ON `${TABLE_NAME}` (`draft_note_id`)"
}
],
"foreignKeys": [
{
"table": "draft_note_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"draft_note_id"
],
"referencedColumns": [
"draft_note_id"
]
}
]
},
{
"tableName": "draft_note_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `visibility` TEXT NOT NULL, `text` TEXT, `cw` TEXT, `viaMobile` INTEGER, `localOnly` INTEGER, `noExtractMentions` INTEGER, `noExtractHashtags` INTEGER, `noExtractEmojis` INTEGER, `replyId` TEXT, `renoteId` TEXT, `draft_note_id` INTEGER PRIMARY KEY AUTOINCREMENT, `multiple` INTEGER, `expiresAt` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "text",
"columnName": "text",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cw",
"columnName": "cw",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "viaMobile",
"columnName": "viaMobile",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "localOnly",
"columnName": "localOnly",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractMentions",
"columnName": "noExtractMentions",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractHashtags",
"columnName": "noExtractHashtags",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "noExtractEmojis",
"columnName": "noExtractEmojis",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "replyId",
"columnName": "replyId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "renoteId",
"columnName": "renoteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "draftNoteId",
"columnName": "draft_note_id",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.multiple",
"columnName": "multiple",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "poll.expiresAt",
"columnName": "expiresAt",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"draft_note_id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_draft_note_table_accountId_text",
"unique": false,
"columnNames": [
"accountId",
"text"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_draft_note_table_accountId_text` ON `${TABLE_NAME}` (`accountId`, `text`)"
}
],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "url_preview",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `title` TEXT NOT NULL, `icon` TEXT, `description` TEXT, `thumbnail` TEXT, `siteName` TEXT, PRIMARY KEY(`url`))",
"fields": [
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "icon",
"columnName": "icon",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "thumbnail",
"columnName": "thumbnail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "siteName",
"columnName": "siteName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"url"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "account_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`remoteId` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `userName` TEXT NOT NULL, `encryptedToken` TEXT NOT NULL, `accountId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL)",
"fields": [
{
"fieldPath": "remoteId",
"columnName": "remoteId",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "userName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "encryptedToken",
"columnName": "encryptedToken",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_account_table_remoteId",
"unique": false,
"columnNames": [
"remoteId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_remoteId` ON `${TABLE_NAME}` (`remoteId`)"
},
{
"name": "index_account_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_account_table_userName",
"unique": false,
"columnNames": [
"userName"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_account_table_userName` ON `${TABLE_NAME}` (`userName`)"
}
],
"foreignKeys": []
},
{
"tableName": "page_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `title` TEXT NOT NULL, `weight` INTEGER NOT NULL, `pageId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` TEXT NOT NULL, `withFiles` INTEGER, `excludeNsfw` INTEGER, `includeLocalRenotes` INTEGER, `includeMyRenotes` INTEGER, `includeRenotedMyRenotes` INTEGER, `listId` TEXT, `following` INTEGER, `visibility` TEXT, `noteId` TEXT, `tag` TEXT, `reply` INTEGER, `renote` INTEGER, `poll` INTEGER, `offset` INTEGER, `markAsRead` INTEGER, `userId` TEXT, `includeReplies` INTEGER, `query` TEXT, `host` TEXT, `antennaId` TEXT)",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "title",
"columnName": "title",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "weight",
"columnName": "weight",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageId",
"columnName": "pageId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pageParams.type",
"columnName": "type",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "pageParams.withFiles",
"columnName": "withFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.excludeNsfw",
"columnName": "excludeNsfw",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeLocalRenotes",
"columnName": "includeLocalRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeMyRenotes",
"columnName": "includeMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.includeRenotedMyRenotes",
"columnName": "includeRenotedMyRenotes",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.listId",
"columnName": "listId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.following",
"columnName": "following",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.visibility",
"columnName": "visibility",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.noteId",
"columnName": "noteId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.tag",
"columnName": "tag",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.reply",
"columnName": "reply",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.renote",
"columnName": "renote",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.poll",
"columnName": "poll",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.offset",
"columnName": "offset",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.markAsRead",
"columnName": "markAsRead",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.userId",
"columnName": "userId",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.includeReplies",
"columnName": "includeReplies",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "pageParams.query",
"columnName": "query",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "pageParams.antennaId",
"columnName": "antennaId",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"pageId"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_page_table_weight",
"unique": false,
"columnNames": [
"weight"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_weight` ON `${TABLE_NAME}` (`weight`)"
},
{
"name": "index_page_table_accountId",
"unique": false,
"columnNames": [
"accountId"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_page_table_accountId` ON `${TABLE_NAME}` (`accountId`)"
}
],
"foreignKeys": []
},
{
"tableName": "meta_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`uri` TEXT NOT NULL, `bannerUrl` TEXT, `cacheRemoteFiles` INTEGER, `description` TEXT, `disableGlobalTimeline` INTEGER, `disableLocalTimeline` INTEGER, `disableRegistration` INTEGER, `driveCapacityPerLocalUserMb` INTEGER, `driveCapacityPerRemoteUserMb` INTEGER, `enableDiscordIntegration` INTEGER, `enableEmail` INTEGER, `enableEmojiReaction` INTEGER, `enableGithubIntegration` INTEGER, `enableRecaptcha` INTEGER, `enableServiceWorker` INTEGER, `enableTwitterIntegration` INTEGER, `errorImageUrl` TEXT, `feedbackUrl` TEXT, `iconUrl` TEXT, `maintainerEmail` TEXT, `maintainerName` TEXT, `mascotImageUrl` TEXT, `maxNoteTextLength` INTEGER, `name` TEXT, `recaptchaSiteKey` TEXT, `secure` INTEGER, `swPublicKey` TEXT, `toSUrl` TEXT, `version` TEXT NOT NULL, PRIMARY KEY(`uri`))",
"fields": [
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "bannerUrl",
"columnName": "bannerUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "cacheRemoteFiles",
"columnName": "cacheRemoteFiles",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "description",
"columnName": "description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "disableGlobalTimeline",
"columnName": "disableGlobalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableLocalTimeline",
"columnName": "disableLocalTimeline",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "disableRegistration",
"columnName": "disableRegistration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerLocalUserMb",
"columnName": "driveCapacityPerLocalUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "driveCapacityPerRemoteUserMb",
"columnName": "driveCapacityPerRemoteUserMb",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableDiscordIntegration",
"columnName": "enableDiscordIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmail",
"columnName": "enableEmail",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableEmojiReaction",
"columnName": "enableEmojiReaction",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableGithubIntegration",
"columnName": "enableGithubIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableRecaptcha",
"columnName": "enableRecaptcha",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableServiceWorker",
"columnName": "enableServiceWorker",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "enableTwitterIntegration",
"columnName": "enableTwitterIntegration",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "errorImageUrl",
"columnName": "errorImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "feedbackUrl",
"columnName": "feedbackUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "iconUrl",
"columnName": "iconUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerEmail",
"columnName": "maintainerEmail",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maintainerName",
"columnName": "maintainerName",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mascotImageUrl",
"columnName": "mascotImageUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "maxNoteTextLength",
"columnName": "maxNoteTextLength",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "recaptchaSiteKey",
"columnName": "recaptchaSiteKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "secure",
"columnName": "secure",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "swPublicKey",
"columnName": "swPublicKey",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "toSUrl",
"columnName": "toSUrl",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"uri"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "emoji_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, `host` TEXT, `url` TEXT, `uri` TEXT, `type` TEXT, `category` TEXT, `id` TEXT, PRIMARY KEY(`name`, `instanceDomain`), FOREIGN KEY(`instanceDomain`) REFERENCES `meta_table`(`uri`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "url",
"columnName": "url",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "uri",
"columnName": "uri",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_emoji_table_instanceDomain",
"unique": false,
"columnNames": [
"instanceDomain"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_instanceDomain` ON `${TABLE_NAME}` (`instanceDomain`)"
},
{
"name": "index_emoji_table_name",
"unique": false,
"columnNames": [
"name"
],
"orders": [],
"createSql": "CREATE INDEX IF NOT EXISTS `index_emoji_table_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": [
{
"table": "meta_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"instanceDomain"
],
"referencedColumns": [
"uri"
]
}
]
},
{
"tableName": "emoji_alias_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`alias` TEXT NOT NULL, `name` TEXT NOT NULL, `instanceDomain` TEXT NOT NULL, PRIMARY KEY(`alias`, `name`, `instanceDomain`), FOREIGN KEY(`name`, `instanceDomain`) REFERENCES `emoji_table`(`name`, `instanceDomain`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "alias",
"columnName": "alias",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "instanceDomain",
"columnName": "instanceDomain",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"alias",
"name",
"instanceDomain"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "emoji_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"name",
"instanceDomain"
],
"referencedColumns": [
"name",
"instanceDomain"
]
}
]
},
{
"tableName": "unread_notifications_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `notificationId` TEXT NOT NULL, PRIMARY KEY(`accountId`, `notificationId`), FOREIGN KEY(`accountId`) REFERENCES `account_table`(`accountId`) ON UPDATE CASCADE ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "accountId",
"columnName": "accountId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "notificationId",
"columnName": "notificationId",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"accountId",
"notificationId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "account_table",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
"accountId"
],
"referencedColumns": [
"accountId"
]
}
]
},
{
"tableName": "nicknames",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`nickname` TEXT NOT NULL, `username` TEXT NOT NULL, `host` TEXT NOT NULL, `id` INTEGER NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "nickname",
"columnName": "nickname",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "userName",
"columnName": "username",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "host",
"columnName": "host",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_nicknames_username_host",
"unique": true,
"columnNames": [
"username",
"host"
],
"orders": [],
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_nicknames_username_host` ON `${TABLE_NAME}` (`username`, `host`)"
}
],
"foreignKeys": []
}
],
"views": [],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '9ca4eba1d0228c9795b0c3a2995db32a')"
]
}
}
================================================
FILE: app/src/androidTest/java/jp/panta/misskeyandroidclient/ExampleInstrumentedTest.kt
================================================
package jp.panta.misskeyandroidclient
import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("jp.panta.misskeyandroidclient", appContext.packageName)
}
}
================================================
FILE: app/src/androidTest/java/jp/panta/misskeyandroidclient/model/account/db/RoomAccountRepositoryTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account.db
import android.content.Context
import androidx.room.Room
import androidx.test.core.app.ApplicationProvider
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.common.Encryption
import net.pantasystem.milktea.data.infrastructure.DataBase
import net.pantasystem.milktea.data.infrastructure.account.db.AccountDAO
import net.pantasystem.milktea.data.infrastructure.account.db.AccountRecord
import net.pantasystem.milktea.data.infrastructure.account.db.RoomAccountRepository
import net.pantasystem.milktea.data.infrastructure.auth.KeyStoreSystemEncryption
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.account.page.Page
import net.pantasystem.milktea.model.account.page.Pageable
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotEquals
import org.junit.Before
import org.junit.Test
class RoomAccountRepositoryTest {
private lateinit var database: DataBase
private lateinit var roomAccountRepository: RoomAccountRepository
private lateinit var accountDAO: AccountDAO
private lateinit var encryption: Encryption
@Before
fun setupRepository() {
val context = ApplicationProvider.getApplicationContext()
database = Room.inMemoryDatabaseBuilder(context, DataBase::class.java).build()
encryption = KeyStoreSystemEncryption(context)
roomAccountRepository = RoomAccountRepository(
database,
context.getSharedPreferences("test", Context.MODE_PRIVATE),
database.accountDAO(),
database.pageDAO(),
encryption = encryption,
)
accountDAO = database.accountDAO()
}
@Test
fun addAccountTest() {
val remoteId = "hogehoge"
val instanceDomain = "http://misskey.io"
val userName = "Panta"
val account = Account(
remoteId,
instanceDomain,
userName,
Account.InstanceType.MISSKEY,
"hogehogehoge"
)
runBlocking {
val result = roomAccountRepository.add(account).getOrThrow()
assertEquals(account.userName, result.userName)
assertEquals(account.instanceDomain, result.instanceDomain)
assertNotEquals(result.accountId, 0)
assertEquals(1, result.accountId)
println(result)
val account2 = Account(
remoteId,
instanceDomain,
"Test",
Account.InstanceType.MISSKEY,
"hogehogehoge"
)
val result2 = roomAccountRepository.add(account2).getOrThrow()
assertEquals("Test", result2.userName)
assertEquals(account.instanceDomain, result2.instanceDomain)
assertEquals(1, result2.accountId)
assert(result2.accountId > 0)
println(result2)
}
}
@Test
fun addAccountUpdateTest() {
val remoteId = "hogehoge"
val instanceDomain = "http://misskey.io"
val userName = "Panta"
val account = Account(
remoteId,
instanceDomain,
userName,
Account.InstanceType.MISSKEY,
"hogehogehoge"
)
runBlocking {
val result = roomAccountRepository.add(account).getOrThrow()
val updated =
result.copy(pages = listOf(Page(result.accountId, "hoge", 0, Pageable.Favorite)))
assertEquals(result.accountId, updated.accountId)
assertEquals(updated.accountId, 1)
val updatedResult = roomAccountRepository.add(updated, true).getOrThrow()
assertEquals(updatedResult.pages.size, 1)
val getResult = roomAccountRepository.get(updatedResult.accountId).getOrThrow()
assertEquals(getResult.pages.size, 1)
assertNotEquals(getResult.pages.first().pageId, 0)
}
}
@Test
fun insertAccountTest() {
val remoteId = "hogehoge"
val instanceDomain = "http://misskey.io"
val userName = "Panta"
val account = Account(
remoteId,
instanceDomain,
userName,
Account.InstanceType.MISSKEY,
"hogehogehoge"
)
runBlocking {
val resultId = accountDAO.insert(AccountRecord.from(account, encryption))
assertNotEquals(0, resultId)
val result = accountDAO.get(resultId)!!
assertEquals(account.userName, result.userName)
assertEquals(account.instanceDomain, result.instanceDomain)
assertNotEquals(0, result.accountId)
assertEquals(1, result.accountId)
println(result)
/*val account2 = Account(remoteId, instanceDomain, "Test", "hogehogehoge")
val result2 = roomAccountRepository.add(account2)
assertEquals(result2.userName, "Test")
assertEquals(result2.instanceDomain, account.instanceDomain)
assertNotEquals(result2.accountId, 0)
assertEquals(result2.accountId, 2)
assert(result2.accountId < 0)
println(result2)*/
}
}
}
================================================
FILE: app/src/androidTest/java/jp/panta/misskeyandroidclient/model/instance/db/RoomMetaDataSourceTest.kt
================================================
package jp.panta.misskeyandroidclient.model.instance.db
import android.content.Context
import androidx.room.Room
import androidx.test.core.app.ApplicationProvider
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.data.infrastructure.DataBase
import net.pantasystem.milktea.data.infrastructure.instance.db.RoomMetaDataSource
import net.pantasystem.milktea.model.instance.Meta
import net.pantasystem.milktea.model.instance.MetaDataSource
import org.junit.Assert.assertNotNull
import org.junit.Before
import org.junit.Test
class RoomMetaDataSourceTest {
private lateinit var metaRepository: MetaDataSource
private lateinit var database: DataBase
private lateinit var sampleMeta: Meta
@Before
fun setUp() {
val context = ApplicationProvider.getApplicationContext()
database = Room.inMemoryDatabaseBuilder(context, DataBase::class.java).build()
metaRepository = RoomMetaDataSource(database.metaDAO(), database)
sampleMeta = Meta(
bannerUrl = "https://hogehoge.io/hogehoge.jpg",
cacheRemoteFiles = true,
description = "hogehogeTest",
disableGlobalTimeline = false,
disableLocalTimeline = false,
disableRegistration = false,
driveCapacityPerLocalUserMb = 1000,
driveCapacityPerRemoteUserMb = 2000,
enableDiscordIntegration = true,
enableEmail = false,
enableEmojiReaction = true,
enableGithubIntegration = true,
enableRecaptcha = true,
enableServiceWorker = true,
enableTwitterIntegration = true,
errorImageUrl = "https://error.img",
feedbackUrl = "https://feedback.com",
iconUrl = "https://favicon.png",
maintainerEmail = "",
maintainerName = "",
mascotImageUrl = "",
maxNoteTextLength = 500,
name = "",
recaptchaSiteKey = "key",
secure = true,
swPublicKey = "swPublicKey",
toSUrl = "toSUrl",
version = "12.0.1",
uri = "https://test.misskey.io"
)
}
@Test
fun addAndGetMetaTest() {
runBlocking {
val added = metaRepository.add(sampleMeta)
val got = metaRepository.get(added.uri)
assertNotNull(got)
}
}
}
================================================
FILE: app/src/androidTest/java/net/pantasystem/milktea/model/filter/MastodonFilterServiceTest.kt
================================================
package net.pantasystem.milktea.model.filter
import net.pantasystem.milktea.model.account.page.Pageable
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.note.make
import net.pantasystem.milktea.model.note.poll.Poll
import net.pantasystem.milktea.model.user.User
import org.junit.Assert
import org.junit.Test
class MastodonFilterServiceTest {
@Test
fun isShouldFilterNote_GiveMatchText() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "hogepiyofuga"
)
)
Assert.assertTrue(actual)
}
@Test
fun isShouldFilterNote_GiveUnMatchText() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "piyutarou"
)
)
Assert.assertFalse(actual)
}
@Test
fun isShouldFilterNote_GiveMatchTextInPoll() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "piyutarou",
poll = Poll(
choices = listOf(
Poll.Choice(
0,
"piyo",
10,
false,
),
Poll.Choice(
1,
"hoge",
10,
false,
),
Poll.Choice(
2,
"fuga",
10,
false,
),
),
null,
false,
)
)
)
Assert.assertTrue(actual)
}
@Test
fun isShouldFilterNote_GiveOtherContext() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Public
),
wholeWord = false,
expiresAt = null,
irreversible = false
),
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "fuga",
context = listOf(
MastodonWordFilter.FilterContext.Public
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "piyopiyo",
poll = Poll(
choices = listOf(
Poll.Choice(
0,
"piyo",
10,
false,
),
Poll.Choice(
1,
"hoge",
10,
false,
),
Poll.Choice(
2,
"fuga",
10,
false,
),
),
null,
false,
)
)
)
Assert.assertFalse(actual)
}
@Test
fun isShouldFilterNote_GiveManyFilters() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
),
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "fuga",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
),
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "hoge",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "piyofugahoge"
)
)
Assert.assertTrue(actual)
}
@Test
fun isShouldFilterNote_GiveManyFiltersAndNotMatchText() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
),
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "fuga",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
),
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "hoge",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = false,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "kawaiipantaharunonmeltazuki"
)
)
Assert.assertFalse(actual)
}
@Test
fun isShouldFilterNote_GiveWholeWord() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = true,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "hoge piyo fuga"
)
)
Assert.assertTrue(actual)
}
@Test
fun isShouldFilterNote_GiveWholeWordNotMatched() {
val service = MastodonFilterService(
FilterPatternCache(),
GetMatchContextFilters()
)
val actual = service.isShouldFilterNote(
Pageable.Mastodon.HomeTimeline(),
filters = listOf(
MastodonWordFilter(
id = MastodonWordFilter.Id(
accountId = 0,
filterId = ""
),
phrase = "piyo",
context = listOf(
MastodonWordFilter.FilterContext.Home
),
wholeWord = true,
expiresAt = null,
irreversible = false
)
),
note = Note.make(
Note.Id(0L, ""),
User.Id(0L, ""),
text = "hogepiyofuga"
)
)
Assert.assertFalse(actual)
}
}
================================================
FILE: app/src/benchmark/java/jp/panta/misskeyandroidclient/di/module/ReleaseAPIModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.OkHttpClientProviderImpl
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
@InstallIn(SingletonComponent::class)
@Module
abstract class ReleaseAPIModule {
@Binds
abstract fun bindOkHttpClientProvider(
impl: OkHttpClientProviderImpl
): OkHttpClientProvider
}
================================================
FILE: app/src/benchmark/java/jp/panta/misskeyandroidclient/di/module/ReleaseAppModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.util.DebuggerSetupManager
import jp.panta.misskeyandroidclient.util.EmptyDebuggerSetupManagerImpl
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
abstract class ReleaseAppModule {
@Binds
@Singleton
abstract fun provideFlipperSetupManager(manager: EmptyDebuggerSetupManagerImpl): DebuggerSetupManager
}
================================================
FILE: app/src/benchmark/java/jp/panta/misskeyandroidclient/util/EmptyDebuggerSetupManagerImpl.kt
================================================
package jp.panta.misskeyandroidclient.util
import android.content.Context
import javax.inject.Inject
class EmptyDebuggerSetupManagerImpl @Inject constructor(): DebuggerSetupManager {
override fun setup(context: Context) {
}
}
================================================
FILE: app/src/debug/java/jp/panta/misskeyandroidclient/util/di/module/DebugAPIModule.kt
================================================
package jp.panta.misskeyandroidclient.util.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.OkHttpClientProviderImpl
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
@InstallIn(SingletonComponent::class)
@Module
abstract class DebugAPIModule {
@Binds
abstract fun bindOkHttpClientProvider(
impl: OkHttpClientProviderImpl
): OkHttpClientProvider
}
================================================
FILE: app/src/debug/java/jp/panta/misskeyandroidclient/util/di/module/DebugAppModule.kt
================================================
package jp.panta.misskeyandroidclient.util.di.module
import android.content.Context
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.util.DebuggerSetupManager
import javax.inject.Inject
import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
@Module
abstract class DebugAppModule {
@Binds
@Singleton
abstract fun bindDebuggerSetupManager(impl: EmptyDebuggerSetupManagerImpl): DebuggerSetupManager
}
class EmptyDebuggerSetupManagerImpl @Inject constructor() : DebuggerSetupManager {
override fun setup(context: Context) {
}
}
================================================
FILE: app/src/main/AndroidManifest.xml
================================================
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/AlarmNotePostReceiver.kt
================================================
package jp.panta.misskeyandroidclient
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.TaskStackBuilder
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import androidx.core.app.NotificationCompat
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import net.pantasystem.milktea.common.runCancellableCatching
import net.pantasystem.milktea.common_android.notification.NotificationUtil
import net.pantasystem.milktea.data.infrastructure.note.draft.db.DraftNoteDao
import net.pantasystem.milktea.model.account.AccountRepository
import net.pantasystem.milktea.model.note.CreateNoteUseCase
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.note.NoteRepository
import net.pantasystem.milktea.model.note.toCreateNote
import net.pantasystem.milktea.note.NoteDetailActivity
import net.pantasystem.milktea.note.NoteEditorActivity
import javax.inject.Inject
@AndroidEntryPoint
class AlarmNotePostReceiver : BroadcastReceiver() {
companion object {
private const val NOTIFICATION_CHANNEL_ID: String = "SCHEDULE_POST_NOTE_RESULT_NOTIFICATION"
}
@Inject
lateinit var draftNoteDAO: DraftNoteDao
@Inject
lateinit var accountRepository: AccountRepository
@Inject
lateinit var coroutineScope: CoroutineScope
@Inject
lateinit var noteRepository: NoteRepository
@Inject
lateinit var createNoteUseCase: CreateNoteUseCase
@Inject
lateinit var notificationUtil: NotificationUtil
override fun onReceive(context: Context, intent: Intent) {
val draftNoteId = intent.getLongExtra("DRAFT_NOTE_ID", -1)
val accountId = intent.getLongExtra("ACCOUNT_ID", -1)
require(draftNoteId >= 0)
require(accountId >= 0)
val notificationManager = notificationUtil.makeNotificationManager(
id = NOTIFICATION_CHANNEL_ID,
description = "Schedule post notification",
name = "Schedule Note"
)
coroutineScope.launch {
runCancellableCatching {
val draftNote =
draftNoteDAO.getDraftNote(accountId = accountId, draftNoteId = draftNoteId)
draftNote ?: return@launch
val account = accountRepository.get(accountId).getOrThrow()
val createNote = draftNote.toCreateNote(account)
createNoteUseCase.invoke(createNote).getOrThrow()
}.onFailure {
Log.e("AlarmPostExecutor", "failed create note", it)
showCreateNoteFailureNotification(context, notificationManager, draftNoteId)
}.onSuccess {
showCreateNoteSuccessNotification(context, notificationManager, draftNoteId, it)
}
}
}
private fun showCreateNoteSuccessNotification(context: Context,notificationManager: NotificationManager, draftNoteId: Long, note: Note) {
val builder = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_check_black_24dp)
.setContentTitle(context.getString(R.string.successfully_created_note))
builder.priority = NotificationCompat.PRIORITY_DEFAULT
val pendingIntentBuilder = TaskStackBuilder.create(context)
.addNextIntentWithParentStack(NoteDetailActivity.newIntent(context, note.id))
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_IMMUTABLE)
} else {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
}
builder.setContentIntent(pendingIntent)
with(notificationManager) {
notify((draftNoteId / Int.MAX_VALUE).toInt(), builder.build())
}
}
private fun showCreateNoteFailureNotification(context: Context, notificationManager: NotificationManager, draftNoteId: Long) {
val builder = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(android.R.drawable.ic_menu_close_clear_cancel)
.setContentTitle(context.getString(R.string.note_creation_failure))
builder.priority = NotificationCompat.PRIORITY_DEFAULT
val pendingIntentBuilder = TaskStackBuilder.create(context)
.addNextIntentWithParentStack(NoteEditorActivity.newBundle(context, draftNoteId = draftNoteId))
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_MUTABLE)
} else {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
}
builder.setContentIntent(pendingIntent)
with(notificationManager) {
notify((draftNoteId / Int.MAX_VALUE).toInt(), builder.build())
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/FCMService.kt
================================================
package jp.panta.misskeyandroidclient
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.TaskStackBuilder
import android.content.Context
import android.content.Intent
import android.os.Build
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.workDataOf
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common.runCancellableCatching
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.notification.PushNotification
import net.pantasystem.milktea.model.notification.toPushNotification
import net.pantasystem.milktea.model.sw.register.DeviceTokenRepository
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.note.NoteDetailActivity
import net.pantasystem.milktea.user.profile.UserDetailActivity
import net.pantasystem.milktea.worker.sw.SubscriptionRegistrationWorker
import javax.inject.Inject
const val NOTIFICATION_CHANNEL_ID =
"jp.panta.misskeyandroidclient.NotificationService.NOTIFICATION_CHANNEL_ID"
const val GROUP_KEY_MISSKEY_NOTIFICATION = "jp.panta.misskeyandroidclient.notifications"
@Suppress("SameParameterValue")
@FlowPreview
@ExperimentalCoroutinesApi
@AndroidEntryPoint
class FCMService : FirebaseMessagingService() {
@Inject internal lateinit var accountStore: AccountStore
@Inject internal lateinit var deviceTokenRepository: DeviceTokenRepository
override fun onNewToken(token: String) {
super.onNewToken(token)
deviceTokenRepository.save(token)
val subscriptionRegistrationWorker =
OneTimeWorkRequestBuilder()
.setInputData(
workDataOf(
SubscriptionRegistrationWorker.TOKEN to token
)
).build()
WorkManager.getInstance(this).enqueue(subscriptionRegistrationWorker)
}
override fun onMessageReceived(msg: RemoteMessage) {
super.onMessageReceived(msg)
// receive message
val pushNotification = msg.data.toPushNotification()
val isCurrentAccountsNotification =
accountStore.currentAccountId == pushNotification.accountId
if (isCurrentAccountsNotification) {
// 通知がcurrent accountでプッシュ通知の不要なActivityがActiveな時はこれ以上処理をしない
return
}
Log.d("FCMService", "pushNotification:$pushNotification")
val builder = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
builder.setContentTitle(pushNotification.title)
.setContentText(pushNotification.body)
.setSmallIcon(R.mipmap.ic_launcher_foreground)
.setGroup(GROUP_KEY_MISSKEY_NOTIFICATION)
.setGroupSummary(true)
runCancellableCatching {
val pendingIntentBuilder = TaskStackBuilder.create(this)
.addNextIntentWithParentStack(pushNotification.makeIntent())
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_MUTABLE)
} else {
pendingIntentBuilder
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
}
builder.setContentIntent(pendingIntent)
}.onFailure { e ->
Log.e("FCMService", "Intent作成に失敗", e)
throw e
}
with(makeNotificationManager(NOTIFICATION_CHANNEL_ID)) {
notify(5, builder.build())
this
}
}
// override fun onDeletedMessages() {
// super.onDeletedMessages()
//
// }
private fun PushNotification.makeIntent(): Intent {
return when (this.type) {
"follow", "receiveFollowRequest", "followRequestAccepted" -> UserDetailActivity.newInstance(
this@FCMService,
User.Id(accountId, this.userId!!)
).apply {
putExtra(UserDetailActivity.EXTRA_IS_MAIN_ACTIVE, false)
}
"mention", "reply", "renote", "quote", "reaction" -> NoteDetailActivity.newIntent(
this@FCMService,
Note.Id(accountId, noteId!!)
).apply {
putExtra(NoteDetailActivity.EXTRA_IS_MAIN_ACTIVE, false)
}
else -> Intent(this@FCMService, MainActivity::class.java)
}
}
private fun makeNotificationManager(channelId: String): NotificationManager {
val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val name = getString(R.string.app_name)
val description = "THE NOTIFICATION"
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (notificationManager.getNotificationChannel(channelId) == null) {
val channel =
NotificationChannel(channelId, name, NotificationManager.IMPORTANCE_HIGH)
channel.description = description
notificationManager.createNotificationChannel(channel)
}
}
return notificationManager
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/MainActivity.kt
================================================
package jp.panta.misskeyandroidclient
import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.annotation.MainThread
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.bumptech.glide.Glide
import com.google.android.gms.common.GoogleApiAvailability
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.logEvent
import com.wada811.databinding.dataBinding
import dagger.hilt.android.AndroidEntryPoint
import jp.panta.misskeyandroidclient.databinding.ActivityMainBinding
import jp.panta.misskeyandroidclient.ui.main.AccountViewModelHandler
import jp.panta.misskeyandroidclient.ui.main.FabClickHandler
import jp.panta.misskeyandroidclient.ui.main.IntentToAddAccountHandler
import jp.panta.misskeyandroidclient.ui.main.MainActivityEventHandler
import jp.panta.misskeyandroidclient.ui.main.MainActivityInitialIntentHandler
import jp.panta.misskeyandroidclient.ui.main.MainActivityMenuProvider
import jp.panta.misskeyandroidclient.ui.main.MainActivityNavigationDrawerMenuItemClickListener
import jp.panta.misskeyandroidclient.ui.main.SetSimpleEditor
import jp.panta.misskeyandroidclient.ui.main.SetUpNavHeader
import jp.panta.misskeyandroidclient.ui.main.SetupOnBackPressedDispatcherHandler
import jp.panta.misskeyandroidclient.ui.main.ToggleNavigationDrawerDelegate
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
import jp.panta.misskeyandroidclient.ui.setLongPressListenerOnNavigationItem
import kotlinx.coroutines.launch
import net.pantasystem.milktea.app_store.setting.SettingStore
import net.pantasystem.milktea.common.ui.ApplyTheme
import net.pantasystem.milktea.common.ui.ToolbarSetter
import net.pantasystem.milktea.common_android_ui.account.AccountSwitchingDialog
import net.pantasystem.milktea.common_android_ui.account.viewmodel.AccountViewModel
import net.pantasystem.milktea.common_android_ui.error.UserActionAppGlobalErrorListener
import net.pantasystem.milktea.common_android_ui.report.ReportViewModel
import net.pantasystem.milktea.common_navigation.MainNavigation
import net.pantasystem.milktea.common_viewmodel.CurrentPageableTimelineViewModel
import net.pantasystem.milktea.common_viewmodel.ScrollToTopViewModel
import net.pantasystem.milktea.data.infrastructure.streaming.ChannelAPIMainEventDispatcherAdapter
import net.pantasystem.milktea.data.infrastructure.streaming.MediatorMainEventDispatcher
import net.pantasystem.milktea.note.renote.RenoteResultHandler
import net.pantasystem.milktea.note.renote.RenoteViewModel
import net.pantasystem.milktea.note.view.NoteActionHandler
import net.pantasystem.milktea.note.viewmodel.NotesViewModel
import javax.inject.Inject
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
@AndroidEntryPoint
class MainActivity : AppCompatActivity(), ToolbarSetter {
@Inject
internal lateinit var settingStore: SettingStore
@Inject
internal lateinit var applyTheme: ApplyTheme
@Inject
internal lateinit var mainActivityEventHandlerFactory: MainActivityEventHandler.Factory
@Inject
internal lateinit var mainActivityInitialIntentHandlerFactory: MainActivityInitialIntentHandler.Factory
@Inject
internal lateinit var fabClickHandleFactory: FabClickHandler.Factory
@Inject
internal lateinit var mainEventDispatcherFactory: MediatorMainEventDispatcher.Factory
@Inject
internal lateinit var channelAPIMainEventDispatcherAdapter: ChannelAPIMainEventDispatcherAdapter
@Inject
internal lateinit var userActionAppGlobalErrorListener: UserActionAppGlobalErrorListener
@Inject
internal lateinit var intentToAddAccountHandler: IntentToAddAccountHandler.Factory
private val notesViewModel: NotesViewModel by viewModels()
private val accountViewModel: AccountViewModel by viewModels()
private val binding: ActivityMainBinding by dataBinding()
private val mainViewModel: MainViewModel by viewModels()
private val currentPageableTimelineViewModel: CurrentPageableTimelineViewModel by viewModels()
private val reportViewModel: ReportViewModel by viewModels()
private val scrollToTopViewModel: ScrollToTopViewModel by viewModels()
private val renoteViewMode by viewModels()
private lateinit var toggleNavigationDrawerDelegate: ToggleNavigationDrawerDelegate
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
applyTheme.invoke()
enableEdgeToEdge()
setContentView(R.layout.activity_main)
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _, windowInsets ->
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
binding.appBarMain.bottomNavigation.updatePadding(bottom = insets.bottom)
windowInsets
}
intentToAddAccountHandler.create(lifecycleScope, mainViewModel).invoke(intent)
toggleNavigationDrawerDelegate = ToggleNavigationDrawerDelegate(this, binding.drawerLayout)
binding.navView.setNavigationItemSelectedListener { item ->
MainActivityNavigationDrawerMenuItemClickListener(this, accountViewModel)
.onSelect(item)
binding.drawerLayout.closeDrawerWhenOpened()
false
}
binding.appBarMain.fab.setOnClickListener {
onFabClicked()
}
binding.appBarMain.bottomNavigation.setOnItemReselectedListener {
scrollToTopViewModel.scrollToTop()
}
binding.appBarMain.bottomNavigation.setLongPressListenerOnNavigationItem(
R.id.navigation_message_list
) {
AccountSwitchingDialog().show(supportFragmentManager, AccountSwitchingDialog.FRAGMENT_TAG)
true
}
AccountViewModelHandler(binding, this, accountViewModel).setup()
SetUpNavHeader(binding.navView, this, accountViewModel).invoke()
NoteActionHandler(
this.supportFragmentManager,
this,
this,
notesViewModel,
).initViewModelListener()
setupNavigation()
setupOnBackPressedDispatcherCallBack()
addMenuProvider(MainActivityMenuProvider(this, settingStore))
mainActivityEventHandlerFactory.create(
activity = this,
binding = binding,
mainViewModel = mainViewModel,
reportViewModel = reportViewModel,
requestPostNotificationsPermissionLauncher = requestPermissionLauncher,
currentPageableTimelineViewModel = currentPageableTimelineViewModel
).setup()
RenoteResultHandler(
viewModel = renoteViewMode,
lifecycle = lifecycle,
scope = lifecycleScope,
context = this
).setup()
handleIntent(savedInstanceState)
val mainEventDispatcher = mainEventDispatcherFactory.create()
lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) {
channelAPIMainEventDispatcherAdapter(mainEventDispatcher)
}
}
GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(this)
userActionAppGlobalErrorListener(
lifecycle = lifecycle,
fragmentManager = supportFragmentManager
)
}
override fun setToolbar(toolbar: Toolbar, visibleTitle: Boolean) {
setSupportActionBar(toolbar)
toggleNavigationDrawerDelegate.updateToolbar(toolbar)
supportActionBar?.setDisplayShowTitleEnabled(visibleTitle)
}
override fun onResume() {
super.onResume()
GoogleApiAvailability.getInstance().makeGooglePlayServicesAvailable(this)
}
/**
* シンプルエディターの表示・非表示を行う
*/
private fun ActivityMainBinding.setSimpleEditor() {
SetSimpleEditor(
supportFragmentManager,
settingStore,
appBarMain.fab
).invoke()
}
@MainThread
private fun DrawerLayout.closeDrawerWhenOpened() {
if (this.isDrawerOpen(GravityCompat.START)) {
this.closeDrawer(GravityCompat.START)
}
}
override fun onStart() {
super.onStart()
setBackgroundImage()
applyUI()
}
private fun setupNavigation() {
val navHostFragment = supportFragmentManager.findFragmentById(R.id.contentMain) as NavHostFragment
val navController = navHostFragment.navController
binding.appBarMain.bottomNavigation.setupWithNavController(navController)
navHostFragment.navController.addOnDestinationChangedListener { _, destination, _ ->
FirebaseAnalytics.getInstance(this).logEvent(FirebaseAnalytics.Event.SCREEN_VIEW) {
param(FirebaseAnalytics.Param.SCREEN_NAME, destination.label.toString())
param(FirebaseAnalytics.Param.SCREEN_CLASS, destination.label.toString())
}
}
}
private fun handleIntent(savedInstanceState: Bundle?) {
if (savedInstanceState == null) {
mainActivityInitialIntentHandlerFactory.create(
binding.appBarMain.bottomNavigation,
this,
).invoke(intent)
}
}
private fun setupOnBackPressedDispatcherCallBack() {
SetupOnBackPressedDispatcherHandler(
this,
binding
).setup()
}
private fun setBackgroundImage() {
val path = settingStore.backgroundImagePath
Glide.with(this)
.load(path)
.into(binding.appBarMain.contentMain.backgroundImage)
}
@MainThread
private fun applyUI() {
invalidateOptionsMenu()
binding.setSimpleEditor()
binding.appBarMain.bottomNavigation.visibility = if (settingStore.isClassicUI) {
View.GONE
} else {
View.VISIBLE
}
}
private fun onFabClicked() {
fabClickHandleFactory.create(
currentPageableTimelineViewModel = currentPageableTimelineViewModel,
activity = this,
).onClicked()
}
private val requestPermissionLauncher = registerForActivityResult(
ActivityResultContracts.RequestPermission()
) {
mainViewModel.onPushNotificationConfirmed()
}
}
class MainNavigationImpl @Inject constructor(
val activity: Activity
) : MainNavigation {
override fun newIntent(args: Unit): Intent {
return Intent(activity, MainActivity::class.java)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/MiApplication.kt
================================================
package jp.panta.misskeyandroidclient
import android.app.Application
import android.os.Build
import android.os.Looper
import android.util.Log
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import coil.Coil
import coil.ImageLoader
import coil.decode.GifDecoder
import coil.decode.ImageDecoderDecoder
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.HiltAndroidApp
import jp.panta.misskeyandroidclient.media.CoilApngDecoder
import jp.panta.misskeyandroidclient.setup.AppStateController
import jp.panta.misskeyandroidclient.worker.WorkerJobInitializer
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.plus
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.common_android.platform.activeNetworkFlow
import net.pantasystem.milktea.data.infrastructure.MemoryCacheCleaner
import net.pantasystem.milktea.data.streaming.SocketWithAccountProvider
import javax.inject.Inject
//基本的な情報はここを返して扱われる
@HiltAndroidApp
class MiApplication : Application(), Configuration.Provider {
@Inject
internal lateinit var mAccountStore: AccountStore
@Inject
internal lateinit var mSocketWithAccountProvider: SocketWithAccountProvider
@Inject
internal lateinit var applicationScope: CoroutineScope
@Inject
internal lateinit var lf: Logger.Factory
private val logger: Logger by lazy {
lf.create("MiApplication")
}
@Inject
lateinit var workerFactory: HiltWorkerFactory
@Inject
internal lateinit var memoryCacheCleaner: MemoryCacheCleaner
@Inject
internal lateinit var initWorkerJobs: WorkerJobInitializer
@Inject
internal lateinit var appStateController: AppStateController
@OptIn(ExperimentalCoroutinesApi::class)
override fun onCreate() {
super.onCreate()
val defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()
val mainThreadId = Looper.getMainLooper().thread.id
Thread.setDefaultUncaughtExceptionHandler { t, e ->
FirebaseCrashlytics.getInstance().recordException(e)
Log.e("MiApplication", "Thread上で致命的なエラーが発生しました thread id:${t.id}, name:${t.name}", e)
if (mainThreadId == t.id) {
defaultUncaughtExceptionHandler?.uncaughtException(t, e)
}
}
setupCoilImageLoader()
applicationScope.launch {
appStateController.initializeSettings()
}
activeNetworkFlow().distinctUntilChanged().onEach {
logger.debug { "接続状態が変化:${if (it) "接続" else "未接続"}" }
mSocketWithAccountProvider.all().forEach { socket ->
if (it) {
socket.onNetworkActive()
} else {
socket.onNetworkInActive()
}
}
}.catch { e ->
logger.error("致命的なエラー", e)
}.launchIn(applicationScope + Dispatchers.IO)
enqueueWorkManagers()
}
override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()
override fun onTrimMemory(level: Int) {
super.onTrimMemory(level)
when (level) {
TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_LOW -> {
applicationScope.launch {
memoryCacheCleaner.clean()
}
}
TRIM_MEMORY_BACKGROUND -> Unit
TRIM_MEMORY_UI_HIDDEN -> Unit
TRIM_MEMORY_COMPLETE -> Unit
}
}
/**
* Coil の ImageLoader をアプリ全体で共有するシングルトンとして設定する。
*
* GIF・APNG のアニメーション表示に必要なデコーダを登録する:
* - API 28+: ImageDecoderDecoder(Android ネイティブ, GIF + APNG 対応)
* - API 28未満: CoilApngDecoder(penfeizhou ラッパー, APNG 対応)+ GifDecoder(GIF 対応)
*
* この設定により CustomEmojiText・MfmText 等の InlineTextContent 内の
* AsyncImage がアニメーション絵文字を正しく再生できるようになる。
*/
private fun setupCoilImageLoader() {
val imageLoader = ImageLoader.Builder(this)
.components {
if (Build.VERSION.SDK_INT >= 28) {
add(ImageDecoderDecoder.Factory())
} else {
// CoilApngDecoder を GifDecoder より先に登録し、PNG を優先処理させる
add(CoilApngDecoder.Factory())
add(GifDecoder.Factory())
}
}
.build()
Coil.setImageLoader(imageLoader)
}
private fun enqueueWorkManagers() {
initWorkerJobs()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ThemeUtil.kt
================================================
package jp.panta.misskeyandroidclient
import android.app.Activity
import android.content.Context
import android.util.TypedValue
import android.view.Menu
import androidx.appcompat.app.AppCompatDelegate
import net.pantasystem.milktea.common.ui.ApplyMenuTint
import net.pantasystem.milktea.common.ui.ApplyTheme
import net.pantasystem.milktea.model.setting.LocalConfigRepository
import net.pantasystem.milktea.model.setting.Theme
import net.pantasystem.milktea.model.setting.isNightTheme
fun Activity.setTheme(configRepository: LocalConfigRepository) {
val config = configRepository.get().getOrNull() ?: return
val theme = config.theme
if (theme.isNightTheme()) {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
} else {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
}
when (theme) {
is Theme.Dark -> setTheme(R.style.AppThemeDark)
Theme.Black -> setTheme(R.style.AppThemeBlack)
Theme.Bread -> setTheme(R.style.AppThemeBread)
Theme.White -> setTheme(R.style.AppTheme)
Theme.ElephantDark -> setTheme(R.style.AppThemeMastodonDark)
}
}
fun Context.setMenuTint(menu: Menu) {
val typedValue = TypedValue()
theme.resolveAttribute(R.attr.normalIconTint, typedValue, true)
0.until(menu.size()).forEach {
val item = menu.getItem(it)
item.icon?.setTint(typedValue.data)
}
}
class ApplyThemeImpl(
val activity: Activity,
private val configRepository: LocalConfigRepository
) : ApplyTheme {
override fun invoke() {
activity.setTheme(configRepository)
}
}
class ApplyMenuTintImpl : ApplyMenuTint {
override fun invoke(context: Context, menu: Menu) {
context.setMenuTint(menu)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/entorypoint/InitializerEntryPoint.kt
================================================
package jp.panta.misskeyandroidclient.di.entorypoint
import android.content.Context
import dagger.hilt.EntryPoint
import dagger.hilt.InstallIn
import dagger.hilt.android.EntryPointAccessors
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.util.DebuggerSetupManager
@EntryPoint
@InstallIn(SingletonComponent::class)
interface InitializerEntryPoint {
companion object {
fun resolve(context: Context): InitializerEntryPoint {
val appContext = context.applicationContext ?: throw IllegalStateException()
return EntryPointAccessors.fromApplication(
appContext,
InitializerEntryPoint::class.java
)
}
}
fun debuggerSetupManager(): DebuggerSetupManager
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/AccountModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.PageDefaultStringsOnAndroid
import net.pantasystem.milktea.model.account.MakeDefaultPagesUseCase
import net.pantasystem.milktea.model.instance.MetaRepository
import net.pantasystem.milktea.model.nodeinfo.NodeInfoRepository
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object AccountModule {
@Provides
@Singleton
fun provideMakeDefaultPagesUseCase(
@ApplicationContext context: Context,
nodeInfoRepository: NodeInfoRepository,
metaRepository: MetaRepository
) : MakeDefaultPagesUseCase {
return MakeDefaultPagesUseCase(
PageDefaultStringsOnAndroid(context),
nodeInfoRepository,
metaRepository,
)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/AppLoggerModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import net.pantasystem.milktea.common.Logger
import jp.panta.misskeyandroidclient.impl.AndroidDefaultLogger
import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
@Module
object AppLoggerModule {
@Singleton
@Provides
fun loggerFactory(): Logger.Factory {
return AndroidDefaultLogger.Factory
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/CoroutineScopeModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
@Module
object CoroutinesScopesModule {
@Singleton // Provide always the same instance
@Provides
fun providesCoroutineScope(): CoroutineScope {
val errorHandler = CoroutineExceptionHandler { _, throwable ->
FirebaseCrashlytics.getInstance().recordException(throwable)
}
return CoroutineScope(SupervisorJob() + Dispatchers.Default + errorHandler)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/CustomAuthStoreModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import net.pantasystem.milktea.data.infrastructure.auth.custom.CustomAuthStore
import net.pantasystem.milktea.common.getPreferences
@Module
@InstallIn(SingletonComponent::class)
object CustomAuthStoreModule {
@Provides
fun provideCustomAuthStore(
@ApplicationContext context: Context
): CustomAuthStore {
return CustomAuthStore(context.getPreferences())
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/EmojiModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.CheckEmojiAndroidImpl
import net.pantasystem.milktea.model.note.reaction.CheckEmoji
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object EmojiModule {
@Singleton
@Provides
fun provideCheckEmoji(
): CheckEmoji {
return CheckEmojiAndroidImpl()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/EncryptionModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import net.pantasystem.milktea.common.Encryption
import net.pantasystem.milktea.data.infrastructure.auth.KeyStoreSystemEncryption
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object EncryptionModule {
@Provides
@Singleton
fun encryption(@ApplicationContext context: Context): Encryption {
return KeyStoreSystemEncryption(context)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/NavigationModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import jp.panta.misskeyandroidclient.MainNavigationImpl
import net.pantasystem.milktea.common_navigation.*
import net.pantasystem.milktea.search.SearchNavigationImpl
import net.pantasystem.milktea.setting.activities.AccountSettingActivityNavigationImpl
import net.pantasystem.milktea.user.search.SearchAndSelectUserNavigationImpl
import net.pantasystem.milktea.user.profile.UserDetailNavigationImpl
@Module
@InstallIn(ActivityComponent::class)
abstract class NavigationModule {
@Binds
abstract fun provideUserDetailNavigation(impl: UserDetailNavigationImpl): UserDetailNavigation
@Binds
abstract fun bindMainNavigation(impl: MainNavigationImpl): MainNavigation
@Binds
abstract fun bindSearchAndSelectUserNavigation(impl: SearchAndSelectUserNavigationImpl): SearchAndSelectUserNavigation
@Binds
abstract fun bindSearchResultNavigation(impl: SearchNavigationImpl): SearchNavigation
@Binds
abstract fun bindAccountSettingNav(impl: AccountSettingActivityNavigationImpl) : AccountSettingNavigation
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/NoteModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.content.Context
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.AndroidNoteReservationPostExecutor
import net.pantasystem.milktea.common_android_ui.UserPinnedNotesFragmentFactory
import net.pantasystem.milktea.data.infrastructure.note.reaction.impl.ReactionRepositoryImpl
import net.pantasystem.milktea.model.note.reaction.ReactionRepository
import net.pantasystem.milktea.model.note.reservation.NoteReservationPostExecutor
import net.pantasystem.milktea.note.pinned.UserPinnedNotesFragmentFactoryImpl
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object NoteModule {
@Provides
@Singleton
fun noteReservationPostExecutor(
@ApplicationContext context: Context
) : NoteReservationPostExecutor {
return AndroidNoteReservationPostExecutor(context)
}
}
@Module
@InstallIn(SingletonComponent::class)
abstract class NoteBindModule {
@Binds
@Singleton
abstract fun bindUserPinnedNotesFragmentFactory(impl: UserPinnedNotesFragmentFactoryImpl): UserPinnedNotesFragmentFactory
@Binds
@Singleton
abstract fun bindReactionRepository(impl: ReactionRepositoryImpl): ReactionRepository
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/PageableModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.ui.PageableFragmentFactoryImpl
import net.pantasystem.milktea.common_android_ui.PageableFragmentFactory
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
abstract class PageableModule {
@Binds
@Singleton
abstract fun bindsPageableFragmentFactory(impl: PageableFragmentFactoryImpl): PageableFragmentFactory
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/PushSubscriptionModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.content.Context
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.BuildConfig
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.common.getPreferences
import net.pantasystem.milktea.data.api.mastodon.MastodonAPIProvider
import net.pantasystem.milktea.data.api.misskey.MisskeyAPIProvider
import net.pantasystem.milktea.data.infrastructure.sw.register.DeviceTokenRepositoryImpl
import net.pantasystem.milktea.data.infrastructure.sw.register.SubscriptionRegistrationImpl
import net.pantasystem.milktea.data.infrastructure.sw.register.SubscriptionUnRegistrationImpl
import net.pantasystem.milktea.model.account.AccountRepository
import net.pantasystem.milktea.model.sw.register.DeviceTokenRepository
import net.pantasystem.milktea.model.sw.register.SubscriptionRegistration
import net.pantasystem.milktea.model.sw.register.SubscriptionUnRegistration
import java.util.*
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object PushSubscriptionModule {
@Singleton
@Provides
fun provideSubscriptionRegistration(
@ApplicationContext context: Context,
accountRepository: AccountRepository,
misskeyAPIProvider: MisskeyAPIProvider,
loggerFactory: Logger.Factory,
deviceTokenRepository: DeviceTokenRepository,
mastodonAPIProvider: MastodonAPIProvider,
): SubscriptionRegistration {
return SubscriptionRegistrationImpl(
accountRepository,
misskeyAPIProvider,
lang = Locale.getDefault().language,
loggerFactory,
auth = BuildConfig.PUSH_TO_FCM_AUTH,
publicKey = BuildConfig.PUSH_TO_FCM_PUBLIC_KEY,
endpointBase = BuildConfig.PUSH_TO_FCM_SERVER_BASE_URL,
context = context,
deviceTokenRepository = deviceTokenRepository,
mastodonAPIProvider = mastodonAPIProvider,
)
}
@Singleton
@Provides
fun provideUnSubscriptionRegistration(
@ApplicationContext context: Context,
accountRepository: AccountRepository,
misskeyAPIProvider: MisskeyAPIProvider,
mastodonAPIProvider: MastodonAPIProvider,
): SubscriptionUnRegistration {
return SubscriptionUnRegistrationImpl(
accountRepository,
lang = Locale.getDefault().language,
misskeyAPIProvider = misskeyAPIProvider,
endpointBase = BuildConfig.PUSH_TO_FCM_SERVER_BASE_URL,
auth = BuildConfig.PUSH_TO_FCM_AUTH,
publicKey = BuildConfig.PUSH_TO_FCM_PUBLIC_KEY,
context = context,
mastodonAPIProvider = mastodonAPIProvider,
)
}
@Singleton
@Provides
fun provideDeviceTokenRepository(
@ApplicationContext context: Context,
): DeviceTokenRepository {
return DeviceTokenRepositoryImpl(
context = context,
sharedPreferences = context.getPreferences()
)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/TaskExecutorsModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import kotlinx.coroutines.CoroutineScope
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.model.CreateGalleryTaskExecutor
import net.pantasystem.milktea.model.TaskExecutorImpl
import javax.inject.Singleton
@InstallIn(SingletonComponent::class)
@Module
object TaskExecutorsModule {
@Provides
@Singleton
fun provideGalleryPostTaskExecutor(
coroutineScope: CoroutineScope,
loggerFactory: Logger.Factory,
): CreateGalleryTaskExecutor {
return CreateGalleryTaskExecutor(
provideTaskExecutor(coroutineScope, loggerFactory)
)
}
private fun provideTaskExecutor(
coroutineScope: CoroutineScope,
loggerFactory: Logger.Factory,
): TaskExecutorImpl {
return TaskExecutorImpl(coroutineScope, loggerFactory.create("CreateNoteTaskExecutor"))
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/di/module/ThemeModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import android.app.Activity
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import jp.panta.misskeyandroidclient.ApplyMenuTintImpl
import jp.panta.misskeyandroidclient.ApplyThemeImpl
import net.pantasystem.milktea.common.ui.ApplyMenuTint
import net.pantasystem.milktea.common.ui.ApplyTheme
import net.pantasystem.milktea.model.setting.LocalConfigRepository
@Module
@InstallIn(ActivityComponent::class)
object ThemeModule {
@Provides
fun provideSetTheme(activity: Activity, configRepository: LocalConfigRepository): ApplyTheme {
return ApplyThemeImpl(activity, configRepository)
}
@Provides
fun provideMenuTint(): ApplyMenuTint {
return ApplyMenuTintImpl()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/AndroidDefaultLogger.kt
================================================
package jp.panta.misskeyandroidclient.impl
import android.util.Log
import com.google.firebase.crashlytics.FirebaseCrashlytics
import net.pantasystem.milktea.common.BuildConfig
import net.pantasystem.milktea.common.Logger
class AndroidDefaultLogger(
override val defaultTag: String
) : Logger {
override fun debug(tag: String, e: Throwable?, message: () -> String) {
if (BuildConfig.DEBUG) {
Log.d(tag, message(), e)
}
}
override fun debug(msg: String, tag: String, e: Throwable?) {
if (BuildConfig.DEBUG) {
Log.d(tag, msg, e)
}
}
override fun error(msg: String, e: Throwable?, tag: String) {
if (BuildConfig.DEBUG) {
Log.e(tag, msg, e)
} else {
if (e == null) {
FirebaseCrashlytics.getInstance().log("$tag: E:$msg")
} else {
FirebaseCrashlytics.getInstance().recordException(e)
}
}
}
override fun log(msg: String) {
FirebaseCrashlytics.getInstance().log(msg)
}
override fun info(msg: String, tag: String, e: Throwable?) {
Log.i(tag, msg, e)
}
override fun warning(msg: String, tag: String, e: Throwable?) {
Log.w(tag, msg, e)
}
object Factory : Logger.Factory {
override fun create(tag: String): Logger {
return AndroidDefaultLogger(tag)
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/AndroidNoteReservationPostExecutor.kt
================================================
package jp.panta.misskeyandroidclient.impl
import android.annotation.SuppressLint
import android.app.AlarmManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.os.Build
import jp.panta.misskeyandroidclient.AlarmNotePostReceiver
import net.pantasystem.milktea.model.note.draft.DraftNote
import net.pantasystem.milktea.model.note.reservation.NoteReservationPostExecutor
class AndroidNoteReservationPostExecutor(
val context: Context
) : NoteReservationPostExecutor {
@SuppressLint("ScheduleExactAlarm")
override fun register(draftNote: DraftNote) {
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as AlarmManager
val intent = Intent(context, AlarmNotePostReceiver::class.java)
intent.putExtra("DRAFT_NOTE_ID", draftNote.draftNoteId)
intent.putExtra("ACCOUNT_ID", draftNote.accountId)
val flag = when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
PendingIntent.FLAG_MUTABLE
.or(PendingIntent.FLAG_UPDATE_CURRENT)
}
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> {
PendingIntent.FLAG_UPDATE_CURRENT
}
else -> PendingIntent.FLAG_UPDATE_CURRENT
}
val pendingIntent = PendingIntent.getBroadcast(
context,
(draftNote.draftNoteId % 1000).toInt(),
intent,
flag
)
// NOTE: 参考にした https://qiita.com/upft_rkoshida/items/8149605f751137b4c21c
when {
Build.VERSION.SDK_INT < Build.VERSION_CODES.M -> {
alarmManager.setExact(
AlarmManager.RTC_WAKEUP,
draftNote.reservationPostingAt!!.time,
pendingIntent
)
}
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M -> {
alarmManager.setExactAndAllowWhileIdle(
AlarmManager.RTC_WAKEUP,
draftNote.reservationPostingAt!!.time,
pendingIntent
)
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/CheckEmojiAndroidImpl.kt
================================================
package jp.panta.misskeyandroidclient.impl
import net.pantasystem.milktea.model.note.reaction.CheckEmoji
import javax.inject.Inject
class CheckEmojiAndroidImpl @Inject constructor(
) : CheckEmoji {
override suspend fun checkEmoji(char: CharSequence): Boolean {
// return (EmojiCompat.get()?.hasEmojiGlyph(char) ?: false) || utf8EmojiRepository.exists(char)
// TODO: 正しく判定できるように修正する
return true
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/NavigationModule.kt
================================================
package jp.panta.misskeyandroidclient.impl
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import net.pantasystem.milktea.antenna.AntennaNavigationImpl
import net.pantasystem.milktea.common_navigation.AntennaNavigation
import net.pantasystem.milktea.common_navigation.UserListNavigation
import net.pantasystem.milktea.userlist.UserListNavigationImpl
@Module
@InstallIn(ActivityComponent::class)
abstract class NavigationModule {
@Binds
abstract fun bindUserListNavigation(impl: UserListNavigationImpl) : UserListNavigation
@Binds
abstract fun bindAntennaNavigation(impl: AntennaNavigationImpl) : AntennaNavigation
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/OkHttpClientProviderImpl.kt
================================================
package jp.panta.misskeyandroidclient.impl
import android.os.Build
import jp.panta.misskeyandroidclient.BuildConfig
import net.pantasystem.milktea.api.misskey.DefaultOkHttpClientProvider
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
import okhttp3.OkHttpClient
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class OkHttpClientProviderImpl @Inject constructor(): OkHttpClientProvider {
private val client by lazy {
DefaultOkHttpClientProvider().client.newBuilder()
.addInterceptor { interceptor ->
val request = interceptor.request().newBuilder()
.addHeader("User-Agent", "Milktea/:${BuildConfig.VERSION_NAME} Android/${Build.VERSION.RELEASE}")
.build()
interceptor.proceed(request)
}.build()
}
override fun get(): OkHttpClient {
return client
}
override fun create(): OkHttpClient {
return OkHttpClient()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/impl/PageDefaultStringsOnAndroid.kt
================================================
package jp.panta.misskeyandroidclient.impl
import android.content.Context
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.model.account.PageDefaultStrings
class PageDefaultStringsOnAndroid(val context: Context) :
PageDefaultStrings {
override val globalTimeline: String
get() = context.getString(R.string.global_timeline)
override val homeTimeline: String
get() = context.getString(R.string.home_timeline)
override val hybridThrowable: String
get() = context.getString(R.string.hybrid_timeline)
override val localTimeline: String
get() = context.getString(R.string.local_timeline)
override val recommendedTimeline: String
get() = context.getString(R.string.calckey_recomended_timeline)
override val media: String
get() = context.getString(R.string.media)
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/media/CoilApngDecoder.kt
================================================
package jp.panta.misskeyandroidclient.media
import android.graphics.BitmapFactory
import android.graphics.drawable.BitmapDrawable
import android.os.Build
import coil.ImageLoader
import coil.decode.DecodeResult
import coil.decode.Decoder
import coil.decode.ImageSource
import coil.fetch.SourceResult
import coil.request.Options
import com.github.penfeizhou.animation.apng.APNGDrawable
import com.github.penfeizhou.animation.apng.decode.APNGDecoder
import com.github.penfeizhou.animation.apng.decode.APNGParser
import com.github.penfeizhou.animation.io.ByteBufferReader
import com.github.penfeizhou.animation.loader.ByteBufferLoader
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.io.IOException
import java.nio.ByteBuffer
/**
* API 28 未満向けの APNG 対応 Coil Decoder。
*
* penfeizhou animation ライブラリ(既に Glide 経由で使用中)を Coil の Decoder インターフェースでラップし、
* Compose の AsyncImage / InlineTextContent 内で APNG アニメーションを表示できるようにする。
*
* API 28 以上では ImageDecoderDecoder が GIF・APNG 両方をネイティブに処理するためスキップする。
*
* PNG コンテンツに対して Factory が create() を返し、decode() 内で APNG かどうかを判定する:
* - APNG の場合: APNGDrawable(アニメーション)を返す
* - 静止 PNG の場合: BitmapDrawable にフォールバックする
*/
class CoilApngDecoder(
private val source: ImageSource,
private val options: Options,
) : Decoder {
override suspend fun decode(): DecodeResult {
val bytes = withContext(Dispatchers.IO) {
source.source().readByteArray()
}
val byteBuffer = ByteBuffer.wrap(bytes)
// IEND チャンク以降のデータが残っていると penfeizhou が例外を投げるため
// IEND チャンクの終端位置に limit を設定してトリムする
val iendPos = findIendChunkPosition(bytes)
if (iendPos >= 0) {
byteBuffer.limit(iendPos + IEND_CHUNK.size)
}
// APNG かどうかを判定(ByteBuffer を消費しないよう duplicate() を使用)
val isApng = APNGParser.isAPNG(ByteBufferReader(byteBuffer.duplicate()))
return if (isApng) {
val loader = object : ByteBufferLoader() {
override fun getByteBuffer(): ByteBuffer {
byteBuffer.position(0)
return byteBuffer
}
}
DecodeResult(
drawable = APNGDrawable(APNGDecoder(loader, null)),
isSampled = false,
)
} else {
// 静止 PNG として BitmapFactory でデコード
val bitmap = withContext(Dispatchers.IO) {
BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
} ?: throw IOException("Failed to decode PNG as bitmap")
DecodeResult(
drawable = BitmapDrawable(options.context.resources, bitmap),
isSampled = false,
)
}
}
class Factory : Decoder.Factory {
override fun create(result: SourceResult, options: Options, imageLoader: ImageLoader): Decoder? {
// API 28 以上は ImageDecoderDecoder に委ねる
if (Build.VERSION.SDK_INT >= 28) return null
// PNG 系 MIME タイプのみ対象(GIF は GifDecoder が処理する)
val mime = result.mimeType
if (mime != null &&
!mime.startsWith("image/png", ignoreCase = true) &&
!mime.equals("image/apng", ignoreCase = true)
) return null
return CoilApngDecoder(result.source, options)
}
}
companion object {
/** PNG ファイル末尾を示す IEND チャンク(長さ0 + "IEND" + CRC) */
private val IEND_CHUNK = byteArrayOf(
0x00, 0x00, 0x00, 0x00,
0x49, 0x45, 0x4E, 0x44,
0xAE.toByte(), 0x42, 0x60.toByte(), 0x82.toByte(),
)
/**
* バイト配列の末尾から IEND チャンクを探して先頭インデックスを返す。
* 見つからない場合は -1 を返す。
*/
private fun findIendChunkPosition(bytes: ByteArray): Int {
if (bytes.size < IEND_CHUNK.size) return -1
val startPos = bytes.size - IEND_CHUNK.size
for (i in startPos downTo 0) {
if (bytes[i] == IEND_CHUNK[0]) {
val slice = bytes.sliceArray(i until (i + IEND_CHUNK.size))
if (slice.contentEquals(IEND_CHUNK)) return i
}
}
return -1
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/setup/AppStateController.kt
================================================
package jp.panta.misskeyandroidclient.setup
import android.content.Context
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.model.account.ClientIdRepository
import net.pantasystem.milktea.model.setting.LocalConfigRepository
import javax.inject.Inject
class AppStateController @Inject constructor(
private val accountStore: AccountStore,
private val configRepository: LocalConfigRepository,
private val clientIdRepository: ClientIdRepository,
@ApplicationContext private val applicationContext: Context
) {
suspend fun initializeSettings() {
coroutineScope {
launch {
initAccountStore()
}
launch {
manageCrashlyticsCollectionState()
}
launch {
manageAnalyticsCollectionState()
}
setFirebaseUserIds()
}
}
private suspend fun initAccountStore() {
accountStore.initialize()
}
private suspend fun manageCrashlyticsCollectionState() {
configRepository.observe().map {
it.isCrashlyticsCollectionEnabled
}.distinctUntilChanged().collect {
FirebaseCrashlytics.getInstance()
.setCrashlyticsCollectionEnabled(it.isEnable)
}
}
private suspend fun manageAnalyticsCollectionState() {
configRepository.observe().map {
it.isAnalyticsCollectionEnabled
}.distinctUntilChanged().collect {
FirebaseAnalytics.getInstance(applicationContext)
.setAnalyticsCollectionEnabled(it.isEnabled)
}
}
private fun setFirebaseUserIds() {
val clientId = clientIdRepository.getOrCreate().clientId
FirebaseAnalytics.getInstance(applicationContext).setUserId(clientId)
FirebaseCrashlytics.getInstance().setUserId(clientId)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/startup/DebuggerSetupInitializer.kt
================================================
package jp.panta.misskeyandroidclient.startup
import android.content.Context
import androidx.startup.Initializer
import jp.panta.misskeyandroidclient.di.entorypoint.InitializerEntryPoint
class DebuggerSetupInitializer : Initializer {
override fun create(context: Context) {
return InitializerEntryPoint.resolve(context).debuggerSetupManager().setup(context)
}
override fun dependencies(): MutableList>> {
return mutableListOf()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/startup/EmojiCompatInitializer.kt
================================================
package jp.panta.misskeyandroidclient.startup
import android.content.Context
import androidx.emoji2.bundled.BundledEmojiCompatConfig
import androidx.emoji2.text.EmojiCompat
import androidx.startup.Initializer
class EmojiCompatInitializer : Initializer {
override fun create(context: Context): EmojiCompat {
EmojiCompat.init(
BundledEmojiCompatConfig(context)
.setReplaceAll(true)
.setMetadataLoadStrategy(EmojiCompat.LOAD_STRATEGY_MANUAL)
)
EmojiCompat.get().load()
return EmojiCompat.get()
}
override fun dependencies(): MutableList>> {
return mutableListOf()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/BottomNavigationLongClickListener.kt
================================================
package jp.panta.misskeyandroidclient.ui
import android.annotation.SuppressLint
import android.view.ViewGroup
import androidx.core.view.forEach
import com.google.android.material.bottomnavigation.BottomNavigationItemView
import com.google.android.material.bottomnavigation.BottomNavigationView
@SuppressLint("RestrictedApi")
fun BottomNavigationView.setLongPressListenerOnNavigationItem(
itemId: Int,
onLongClicked: () -> Boolean
) {
this.getChildAt(0)?.also { view ->
if (view is ViewGroup) {
view.forEach { child ->
if (child is BottomNavigationItemView) {
if (child.itemData?.itemId == itemId) {
child.setOnLongClickListener {
onLongClicked()
}
}
}
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/PageableFragmentFactoryImpl.kt
================================================
package jp.panta.misskeyandroidclient.ui
import androidx.fragment.app.Fragment
import net.pantasystem.milktea.common_android_ui.PageableFragmentFactory
import net.pantasystem.milktea.gallery.GalleryPostsFragment
import net.pantasystem.milktea.model.account.page.Page
import net.pantasystem.milktea.model.account.page.Pageable
import net.pantasystem.milktea.note.detail.NoteDetailFragment
import net.pantasystem.milktea.note.timeline.TimelineFragment
import net.pantasystem.milktea.notification.NotificationFragment
import javax.inject.Inject
class PageableFragmentFactoryImpl @Inject constructor(): PageableFragmentFactory {
override fun create(page: Page): Fragment {
return when(val pageable = page.pageable()){
is Pageable.Show ->{
NoteDetailFragment.newInstance(page)
}
is Pageable.Notification ->{
NotificationFragment.newInstance(page.attachedAccountId ?: page.accountId)
}
is Pageable.Gallery -> {
return GalleryPostsFragment.newInstance(pageable, page.attachedAccountId ?: page.accountId)
}
else ->{
TimelineFragment.newInstance(page)
}
}
}
override fun create(pageable: Pageable): Fragment {
return when(pageable){
is Pageable.Show ->{
NoteDetailFragment.newInstance(pageable.noteId)
}
is Pageable.Notification ->{
NotificationFragment()
}
is Pageable.Gallery -> {
return GalleryPostsFragment.newInstance(pageable, null)
}
else ->{
TimelineFragment.newInstance(pageable)
}
}
}
override fun create(accountId: Long?, pageable: Pageable): Fragment {
if (accountId == null) {
return create(pageable)
}
return when(pageable){
is Pageable.Show ->{
NoteDetailFragment.newInstance(pageable.noteId, accountId)
}
is Pageable.Notification ->{
NotificationFragment.newInstance(accountId)
}
is Pageable.Gallery -> {
return GalleryPostsFragment.newInstance(pageable, accountId)
}
else ->{
TimelineFragment.newInstance(pageable, accountId)
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/AccountViewModelHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import androidx.annotation.MainThread
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import jp.panta.misskeyandroidclient.databinding.ActivityMainBinding
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import net.pantasystem.milktea.common_android.ui.Activities
import net.pantasystem.milktea.common_android.ui.putActivity
import net.pantasystem.milktea.common_android_ui.account.AccountSwitchingDialog
import net.pantasystem.milktea.common_android_ui.account.viewmodel.AccountViewModel
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.user.followlist.FollowFollowerActivity
import net.pantasystem.milktea.user.profile.UserDetailActivity
class AccountViewModelHandler(
val binding: ActivityMainBinding,
val activity: AppCompatActivity,
val accountViewModel: AccountViewModel,
) {
fun setup() {
initAccountViewModelListener()
}
private fun initAccountViewModelListener() {
accountViewModel.switchAccountEvent.onEach {
binding.drawerLayout.closeDrawer(GravityCompat.START)
val dialog = AccountSwitchingDialog()
dialog.show(activity.supportFragmentManager, AccountSwitchingDialog.FRAGMENT_TAG)
}.flowWithLifecycle(activity.lifecycle, Lifecycle.State.RESUMED).launchIn(activity.lifecycleScope)
accountViewModel.showFollowersEvent.onEach {
binding.drawerLayout.closeDrawerWhenOpened()
val intent = FollowFollowerActivity.newIntent(activity, it, false)
activity.startActivity(intent)
}.flowWithLifecycle(activity.lifecycle, Lifecycle.State.RESUMED).launchIn(activity.lifecycleScope)
accountViewModel.showFollowingsEvent.onEach {
binding.drawerLayout.closeDrawerWhenOpened()
val intent = FollowFollowerActivity.newIntent(activity, it, true)
activity.startActivity(intent)
}.flowWithLifecycle(activity.lifecycle, Lifecycle.State.RESUMED).launchIn(activity.lifecycleScope)
accountViewModel.showProfileEvent.onEach {
binding.drawerLayout.closeDrawerWhenOpened()
val intent =
UserDetailActivity.newInstance(activity, userId = User.Id(it.accountId, it.remoteId))
intent.putActivity(Activities.ACTIVITY_IN_APP)
activity.startActivity(intent)
}.flowWithLifecycle(activity.lifecycle, Lifecycle.State.RESUMED).launchIn(activity.lifecycleScope)
}
@MainThread
private fun DrawerLayout.closeDrawerWhenOpened() {
if (this.isDrawerOpen(GravityCompat.START)) {
this.closeDrawer(GravityCompat.START)
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ChangeNavMenuVisibilityFromAPIVersion.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import com.google.android.material.navigation.NavigationView
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.instance.FeatureEnables
import net.pantasystem.milktea.model.instance.FeatureType
internal class ChangeNavMenuVisibilityFromAPIVersion(
private val navView: NavigationView,
private val featureEnables: FeatureEnables,
) {
suspend operator fun invoke(currentAccount: Account) {
val enableFeatures = featureEnables.enableFeatures(currentAccount.normalizedInstanceUri)
navView.menu.also { menu ->
menu.findItem(R.id.nav_antenna).isVisible = enableFeatures.contains(FeatureType.Antenna)
menu.findItem(R.id.nav_channel).isVisible = enableFeatures.contains(FeatureType.Channel)
menu.findItem(R.id.nav_gallery).isVisible = enableFeatures.contains(FeatureType.Gallery)
menu.findItem(R.id.nav_group).isVisible = enableFeatures.contains(FeatureType.Group)
menu.findItem(R.id.nav_drive).isVisible = enableFeatures.contains(FeatureType.Drive)
menu.findItem(R.id.nav_clip).isVisible = enableFeatures.contains(FeatureType.Clip)
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ConfirmCrashlyticsDialog.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Dialog
import android.os.Bundle
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.fragment.app.activityViewModels
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
@AndroidEntryPoint
class ConfirmCrashlyticsDialog : AppCompatDialogFragment() {
companion object {
const val FRAGMENT_TAG = "ConfirmCrashlyticsDialog"
}
private val mainViewModel by activityViewModels()
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.send_a_crash_report)
.setPositiveButton(R.string.agree) { _, _ ->
mainViewModel.setCrashlyticsCollectionEnabled(true)
}
.setNegativeButton(R.string.cancel) { _, _ ->
mainViewModel.setCrashlyticsCollectionEnabled(false)
}
.setMessage(R.string.crash_reports_are_useful_for_development)
.show()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ConfirmGoogleAnalyticsDialog.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Dialog
import android.os.Bundle
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.activityViewModels
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
@AndroidEntryPoint
class ConfirmGoogleAnalyticsDialog : DialogFragment() {
companion object {
const val FRAGMENT_TAG = "ConfirmGoogleAnalyticsDialog"
}
private val mainViewModel: MainViewModel by activityViewModels()
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.consent_to_collect_behavior_history)
.setMessage(R.string.consent_to_collect_behavior_history_message)
.setPositiveButton(R.string.agree) { _, _ ->
mainViewModel.setAnalyticsCollectionEnabled(true)
}
.setNegativeButton(R.string.disagree) { _, _ ->
mainViewModel.setAnalyticsCollectionEnabled(false)
}.show()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/FabClickHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import dagger.hilt.android.scopes.ActivityScoped
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common_android_ui.account.AccountSwitchingDialog
import net.pantasystem.milktea.common_viewmodel.CurrentPageType
import net.pantasystem.milktea.common_viewmodel.CurrentPageableTimelineViewModel
import net.pantasystem.milktea.common_viewmodel.SuitableType
import net.pantasystem.milktea.common_viewmodel.suitableType
import net.pantasystem.milktea.gallery.GalleryPostsActivity
import net.pantasystem.milktea.model.account.page.Pageable
import net.pantasystem.milktea.model.channel.Channel
import net.pantasystem.milktea.note.NoteEditorActivity
import javax.inject.Inject
internal class FabClickHandler(
private val currentPageableTimelineViewModel: CurrentPageableTimelineViewModel,
private val activity: AppCompatActivity,
private val accountStore: AccountStore,
) {
@ActivityScoped
internal class Factory @Inject constructor(
private val accountStore: AccountStore,
) {
fun create(
currentPageableTimelineViewModel: CurrentPageableTimelineViewModel,
activity: AppCompatActivity,
): FabClickHandler {
return FabClickHandler(
currentPageableTimelineViewModel,
activity,
accountStore
)
}
}
fun onClicked() {
activity.apply {
when (val type = currentPageableTimelineViewModel.currentType.value) {
CurrentPageType.Account -> {
AccountSwitchingDialog().show(
activity.supportFragmentManager,
AccountSwitchingDialog.FRAGMENT_TAG
)
}
is CurrentPageType.Page -> {
when (val suitableType = type.pageable.suitableType()) {
is SuitableType.Other -> {
val text = when (val pageable = type.pageable) {
is Pageable.SearchByTag -> "#${pageable.tag}"
is Pageable.Mastodon.HashTagTimeline -> "#${pageable.hashtag}"
else -> ""
}
startActivity(
NoteEditorActivity.newBundle(
this,
accountId = type.accountId,
text = text
)
)
}
is SuitableType.Gallery -> {
val intent = Intent(this, GalleryPostsActivity::class.java)
intent.action = Intent.ACTION_EDIT
startActivity(intent)
}
is SuitableType.Channel -> {
val accountId = type.accountId ?: accountStore.currentAccountId!!
startActivity(
NoteEditorActivity.newBundle(
this,
channelId = Channel.Id(accountId, suitableType.channelId),
)
)
}
}
}
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/IntentToAddAccountHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.content.Intent
import jp.panta.misskeyandroidclient.BuildConfig
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.account.AccountRepository
import javax.inject.Inject
/**
* 起動時にIntentを受け取り、その中に認証情報が含まれていれば、
* DBに認証情報を追加するための処理。
* 脆弱性につながる可能性があるため、デバッグモード時とベンチマーク時には動作しないように実装してある。
*/
internal class IntentToAddAccountHandler(
private val coroutineScope: CoroutineScope,
private val mainViewModel: MainViewModel,
private val accountRepository: AccountRepository,
) {
class Factory @Inject constructor(
private val accountRepository: AccountRepository,
) {
fun create(
coroutineScope: CoroutineScope,
mainViewModel: MainViewModel,
): IntentToAddAccountHandler {
return IntentToAddAccountHandler(
coroutineScope,
mainViewModel,
accountRepository,
)
}
}
@Suppress("KotlinConstantConditions")
operator fun invoke(intent: Intent) {
if (BuildConfig.BUILD_TYPE == "benchmark" || BuildConfig.BUILD_TYPE == "debug") {
mainViewModel.setShouldWaitForAuthentication(true)
coroutineScope.launch {
try {
val username = intent.getStringExtra("username") ?: return@launch
val host = intent.getStringExtra("host") ?: return@launch
val token = intent.getStringExtra("token") ?: return@launch
val remoteId = intent.getStringExtra("remoteId") ?: return@launch
val state = mainViewModel.accountState.first()
if (state.state.accounts.any {
it.userName == username && it.instanceDomain == host
}) {
return@launch
}
mainViewModel.accountStore.addAccount(
Account(
remoteId = remoteId,
instanceDomain = host,
userName = username,
token = token,
instanceType = Account.InstanceType.MISSKEY,
)
)
} finally {
mainViewModel.setShouldWaitForAuthentication(false)
}
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/MainActivityEventHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.Manifest
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.media.AudioManager
import android.media.Ringtone
import android.media.RingtoneManager
import android.os.Build
import android.util.Log
import androidx.activity.result.ActivityResultLauncher
import androidx.core.content.ContextCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import androidx.work.WorkInfo
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.crashlytics.FirebaseCrashlytics
import jp.panta.misskeyandroidclient.MainActivity
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.databinding.ActivityMainBinding
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.distinctUntilChangedBy
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.app_store.setting.SettingStore
import net.pantasystem.milktea.auth.JoinMilkteaActivity
import net.pantasystem.milktea.common_android_ui.report.ReportViewModel
import net.pantasystem.milktea.common_viewmodel.CurrentPageType
import net.pantasystem.milktea.common_viewmodel.CurrentPageableTimelineViewModel
import net.pantasystem.milktea.model.instance.FeatureEnables
import net.pantasystem.milktea.model.note.draft.DraftNoteService
import net.pantasystem.milktea.model.notification.Notification
import net.pantasystem.milktea.model.user.report.ReportState
import net.pantasystem.milktea.notification.notificationMessageScope
import net.pantasystem.milktea.user.ReportStateHandler
import net.pantasystem.milktea.worker.note.CreateNoteWorkerExecutor
import javax.inject.Inject
internal class MainActivityEventHandler(
val activity: MainActivity,
val binding: ActivityMainBinding,
private val lifecycleScope: CoroutineScope,
private val lifecycleOwner: LifecycleOwner,
private val mainViewModel: MainViewModel,
val reportViewModel: ReportViewModel,
private val createNoteWorkerExecutor: CreateNoteWorkerExecutor,
val accountStore: AccountStore,
private val requestPostNotificationsPermissionLauncher: ActivityResultLauncher,
val changeNavMenuVisibilityFromAPIVersion: ChangeNavMenuVisibilityFromAPIVersion,
private val configStore: SettingStore,
private val draftNoteService: DraftNoteService,
private val currentPageableTimelineViewModel: CurrentPageableTimelineViewModel,
) {
class Factory @Inject constructor(
private val createNoteWorkerExecutor: CreateNoteWorkerExecutor,
val accountStore: AccountStore,
private val configStore: SettingStore,
private val draftNoteService: DraftNoteService,
private val featureEnables: FeatureEnables,
) {
fun create(
activity: MainActivity,
binding: ActivityMainBinding,
mainViewModel: MainViewModel,
reportViewModel: ReportViewModel,
requestPostNotificationsPermissionLauncher: ActivityResultLauncher,
currentPageableTimelineViewModel: CurrentPageableTimelineViewModel,
): MainActivityEventHandler {
return MainActivityEventHandler(
activity,
binding,
activity.lifecycleScope,
activity,
mainViewModel,
reportViewModel,
createNoteWorkerExecutor,
accountStore,
requestPostNotificationsPermissionLauncher,
ChangeNavMenuVisibilityFromAPIVersion(binding.navView, featureEnables),
configStore,
draftNoteService,
currentPageableTimelineViewModel
)
}
}
fun setup() {
// NOTE: 各バージョンに合わせMenuを制御している
accountStore.observeCurrentAccount.filterNotNull().onEach {
changeNavMenuVisibilityFromAPIVersion(it)
}.catch {
Log.e("MainActivity", "check version error", it)
}.launchIn(lifecycleScope)
mainViewModel.state.onEach { uiState ->
ShowBottomNavigationBadgeDelegate(binding.appBarMain.bottomNavigation)(uiState)
}.launchIn(lifecycleScope)
collectLatestNotifications()
collectCrashlyticsCollectionState()
collectReportSendingState()
collectCreateNoteState()
collectUnauthorizedState()
collectConfirmGoogleAnalyticsState()
collectRequestPostNotificationState()
collectDraftNoteSavedEvent()
collectCurrentPageableState()
collectEnableSafeSearchDescriptionState()
}
private fun collectCrashlyticsCollectionState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mainViewModel.isShowFirebaseCrashlytics.collect {
if (it && activity.supportFragmentManager.findFragmentByTag(
ConfirmCrashlyticsDialog.FRAGMENT_TAG
) == null
) {
ConfirmCrashlyticsDialog().show(
activity.supportFragmentManager,
ConfirmCrashlyticsDialog.FRAGMENT_TAG
)
}
}
}
}
}
private fun collectEnableSafeSearchDescriptionState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mainViewModel.isShowEnableSafeSearchDescription.collect {
if (it && activity.supportFragmentManager.findFragmentByTag(
SafeSearchDescriptionDialog.TAG
) == null
) {
SafeSearchDescriptionDialog().show(
activity.supportFragmentManager,
SafeSearchDescriptionDialog.TAG
)
}
}
}
}
}
private fun collectConfirmGoogleAnalyticsState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mainViewModel.isShowGoogleAnalyticsDialog.collect {
if (it && activity.supportFragmentManager.findFragmentByTag(
ConfirmGoogleAnalyticsDialog.FRAGMENT_TAG
) == null
) {
ConfirmGoogleAnalyticsDialog().show(
activity.supportFragmentManager,
ConfirmGoogleAnalyticsDialog.FRAGMENT_TAG
)
}
}
}
}
}
private fun collectReportSendingState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.CREATED) {
reportViewModel.successOrFailureEvent.distinctUntilChangedBy {
it is ReportState.Sending.Success
|| it is ReportState.Sending.Failed
}.collect { state ->
showSendReportStateFrom(state)
}
}
}
}
private fun collectCreateNoteState() {
// NOTE: ノート作成処理の状態をSnackBarで表示する
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
createNoteWorkerExecutor.getCreateNoteWorkInfosInAppActives()
.collect { workInfoList ->
Log.d("collectCreateNoteState", "workInfoList:$workInfoList")
workInfoList.forEach {
showCreateNoteTaskStatusSnackBar(it)
}
}
}
}
}
private fun collectLatestNotifications() {
// NOTE: 最新の通知をSnackBar等に表示する
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mainViewModel.newNotifications.collect { notificationRelation ->
activity.apply {
notificationMessageScope {
notificationRelation.showSnackBarMessage(binding.appBarMain.simpleNotification)
}
}
}
}
}
val audioManager = activity.getSystemService(Context.AUDIO_SERVICE) as AudioManager
var replayedNotifyId: Notification.Id? = null
var ringtone: Ringtone? = null
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
withContext(Dispatchers.Default) {
if (ringtone == null) {
val uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
ringtone = RingtoneManager.getRingtone(activity, uri)
}
}
mainViewModel.newNotifications.collect {
if (replayedNotifyId == it.notification.id) {
return@collect
}
replayedNotifyId = it.notification.id
if (ringtone?.isPlaying == true) {
ringtone?.stop()
}
if (
configStore.configState.value.isEnableNotificationSound
&& audioManager.ringerMode == AudioManager.RINGER_MODE_NORMAL
) {
ringtone?.play()
}
}
}
}
}
private fun collectUnauthorizedState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
mainViewModel.accountState.collect { state ->
FirebaseCrashlytics.getInstance().setCustomKey(
"CURRENT_ACCOUNT_USER_ID",
state.state.currentAccount?.remoteId ?: ""
)
FirebaseCrashlytics.getInstance().setCustomKey(
"CURRENT_INSTANCE_DOMAIN",
state.state.currentAccount?.instanceDomain ?: ""
)
FirebaseCrashlytics.getInstance().setCustomKey(
"CURRENT_USERNAME",
state.state.currentAccount?.userName ?: ""
)
FirebaseAnalytics.getInstance(activity).setUserProperty(
"CURRENT_ACCOUNT_USER_ID",
state.state.currentAccount?.let {
it.remoteId.substring(0, 36.coerceAtMost(it.remoteId.length))
}
)
FirebaseAnalytics.getInstance(activity).setUserProperty(
"CURRENT_INSTANCE_DOMAIN",
state.state.currentAccount?.let {
it.instanceDomain.substring(
0,
36.coerceAtMost(it.instanceDomain.length)
)
}
)
FirebaseAnalytics.getInstance(activity).setUserProperty(
"CURRENT_USERNAME",
state.state.currentAccount?.let {
it.userName.substring(0, 36.coerceAtMost(it.userName.length))
}
)
// NOTE: shouldWaitForAuthenticationは任意の処理が終わるまで認証画面への遷移をブロックするための処理で、
// NOTE: 未認証かつ待ち受ける必要性がない場合に認証画面に遷移するようにしている。
if (state.state.isUnauthorized && !state.shouldWaitForAuthentication) {
activity.startActivity(
Intent(activity, JoinMilkteaActivity::class.java)
)
activity.finish()
}
}
}
}
}
private fun collectRequestPostNotificationState() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.CREATED) {
mainViewModel.isRequestPushNotificationPermission.collect { requestPermission ->
if (requestPermission &&
ContextCompat.checkSelfPermission(
activity,
Manifest.permission.POST_NOTIFICATIONS
) == PackageManager.PERMISSION_DENIED
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
) {
requestPostNotificationsPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS)
}
}
}
}
}
@OptIn(ExperimentalCoroutinesApi::class)
private fun collectDraftNoteSavedEvent() {
lifecycleScope.launch {
lifecycleOwner.repeatOnLifecycle(Lifecycle.State.CREATED) {
accountStore.observeCurrentAccount.filterNotNull().flatMapLatest {
draftNoteService.getDraftNoteSavedEventBy(it.accountId)
}.collect(
ShowRequestSchedulePostResultSnackBar(
activity,
binding.appBarMain.simpleNotification
)::invoke
)
}
}
}
private fun showSendReportStateFrom(state: ReportState) {
ReportStateHandler().invoke(binding.appBarMain.simpleNotification, state)
}
private fun showCreateNoteTaskStatusSnackBar(state: WorkInfo) {
NoteCreateResultHandler(
activity,
binding.appBarMain.simpleNotification,
createNoteWorkerExecutor,
)(state)
}
private fun collectCurrentPageableState() {
currentPageableTimelineViewModel.currentType.onEach {
binding.appBarMain.fab.setImageResource(
when (it) {
CurrentPageType.Account -> {
R.drawable.ic_person_add_black_24dp
}
is CurrentPageType.Page -> {
R.drawable.ic_edit_black_24dp
}
}
)
}.flowWithLifecycle(activity.lifecycle, Lifecycle.State.RESUMED).launchIn(lifecycleScope)
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/MainActivityInitialIntentHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.lifecycleScope
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.scopes.ActivityScoped
import jp.panta.misskeyandroidclient.R
import kotlinx.coroutines.launch
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common.mapCancellableCatching
import net.pantasystem.milktea.common.runCancellableCatching
import net.pantasystem.milktea.common_navigation.UserDetailNavigation
import net.pantasystem.milktea.common_navigation.UserDetailNavigationArgs
import net.pantasystem.milktea.model.account.AccountRepository
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.notification.PushNotification
import net.pantasystem.milktea.model.notification.toPushNotification
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.note.NoteDetailActivity
import net.pantasystem.milktea.note.NoteEditorActivity
import javax.inject.Inject
/**
* MainActivity起動時にIntentを処理するクラス
* 例えばバックグラウンドからのFCMのプッシュ通知を開かれた時は
* Intentに通知情報が入っているので、その情報を処理して通知に対応した画面に遷移するようにする。
*/
class MainActivityInitialIntentHandler(
private val bottomNavigationView: BottomNavigationView,
private val activity: AppCompatActivity,
private val userDetailNavigation: UserDetailNavigation,
private val accountRepository: AccountRepository,
private val accountStore: AccountStore,
) {
@ActivityScoped
class Factory @Inject constructor(
private val userDetailNavigation: UserDetailNavigation,
private val accountRepository: AccountRepository,
private val accountStore: AccountStore,
) {
fun create(
bottomNavigationView: BottomNavigationView,
activity: AppCompatActivity,
): MainActivityInitialIntentHandler {
return MainActivityInitialIntentHandler(
bottomNavigationView,
activity,
userDetailNavigation,
accountRepository,
accountStore,
)
}
}
operator fun invoke(intent: Intent) {
// NOTE: バックグラウンドから通知を開いた場合、通知のデータがintentに入っている
val pushNotification = intent.extras?.toPushNotification()?.getOrNull()
if (pushNotification != null) {
activity.lifecycleScope.launch {
accountRepository.get(pushNotification.accountId).mapCancellableCatching {
accountStore.setCurrent(it)
}.onSuccess {
navigateBy(pushNotification)
}.onFailure {
FirebaseCrashlytics.getInstance().recordException(it)
}
}
return
}
val shortcutType = runCancellableCatching {
intent.getStringExtra("SHORTCUT_TYPE")
?.let { AppShortcutType.valueOf(it) }
}.getOrNull()
when (
shortcutType
) {
AppShortcutType.TYPE_OPEN_MESSAGING -> {
bottomNavigationView.selectedItemId = R.id.navigation_message_list
}
AppShortcutType.TYPE_OPEN_NOTIFICATION -> {
bottomNavigationView.selectedItemId = R.id.navigation_notification
}
AppShortcutType.TYPE_EDIT_NOTE -> {
activity.startActivity(NoteEditorActivity.newBundle(activity))
}
null -> {
}
}
}
private fun navigateBy(pushNotification: PushNotification) {
bottomNavigationView.selectedItemId = R.id.navigation_notification
when {
pushNotification.isNearUserNotification() -> {
activity.startActivity(
userDetailNavigation.newIntent(
UserDetailNavigationArgs.UserId(
userId = User.Id(
pushNotification.accountId,
pushNotification.userId!!
)
)
)
)
}
pushNotification.isNearNoteNotification() -> {
activity.startActivity(
NoteDetailActivity.newIntent(
activity, Note.Id(
pushNotification.accountId,
pushNotification.noteId!!,
)
)
)
}
}
}
}
enum class AppShortcutType {
TYPE_OPEN_MESSAGING, TYPE_OPEN_NOTIFICATION, TYPE_EDIT_NOTE
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/MainActivityMenuProvider.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.content.Intent
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import androidx.core.view.MenuProvider
import jp.panta.misskeyandroidclient.MainActivity
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.setMenuTint
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.FlowPreview
import net.pantasystem.milktea.app_store.setting.SettingStore
import net.pantasystem.milktea.messaging.MessagingListActivity
import net.pantasystem.milktea.notification.NotificationsActivity
import net.pantasystem.milktea.search.SearchActivity
import net.pantasystem.milktea.setting.activities.PageSettingActivity
internal class MainActivityMenuProvider(
val activity: MainActivity,
val settingStore: SettingStore
) : MenuProvider {
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
activity.setMenuTint(menu)
menuInflater.inflate(R.menu.main, menu)
listOf(
menu.findItem(R.id.action_messaging),
menu.findItem(R.id.action_notification),
menu.findItem(R.id.action_search)
).forEach {
it.isVisible = settingStore.isClassicUI
}
}
@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class)
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
val idAndActivityMap = mapOf(
R.id.action_tab_setting to PageSettingActivity::class.java,
R.id.action_notification to NotificationsActivity::class.java,
R.id.action_messaging to MessagingListActivity::class.java,
R.id.action_search to SearchActivity::class.java
)
val targetActivity = idAndActivityMap[menuItem.itemId]
?: return false
activity.startActivity(Intent(activity, targetActivity))
return true
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/MainActivityNavigationDrawerMenuItemClickListener.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.content.Intent
import android.view.MenuItem
import jp.panta.misskeyandroidclient.MainActivity
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.antenna.AntennaListActivity
import net.pantasystem.milktea.channel.ChannelActivity
import net.pantasystem.milktea.clip.ClipListActivity
import net.pantasystem.milktea.common_android_ui.account.viewmodel.AccountViewModel
import net.pantasystem.milktea.drive.DriveActivity
import net.pantasystem.milktea.favorite.FavoriteActivity
import net.pantasystem.milktea.gallery.GalleryPostsActivity
import net.pantasystem.milktea.group.GroupActivity
import net.pantasystem.milktea.note.DraftNotesActivity
import net.pantasystem.milktea.setting.activities.SettingsActivity
import net.pantasystem.milktea.userlist.ListListActivity
internal class MainActivityNavigationDrawerMenuItemClickListener(
val mainActivity: MainActivity,
val accountViewModel: AccountViewModel,
) {
fun onSelect(item: MenuItem) {
val activity = when (item.itemId) {
R.id.nav_setting -> SettingsActivity::class.java
R.id.nav_drive -> DriveActivity::class.java
R.id.nav_favorite -> FavoriteActivity::class.java
R.id.nav_list -> ListListActivity::class.java
R.id.nav_antenna -> AntennaListActivity::class.java
R.id.nav_draft -> DraftNotesActivity::class.java
R.id.nav_gallery -> GalleryPostsActivity::class.java
R.id.nav_channel -> ChannelActivity::class.java
R.id.nav_group -> GroupActivity::class.java
R.id.nav_clip -> ClipListActivity::class.java
R.id.nav_switch_account -> {
accountViewModel.showSwitchDialog()
return
}
else -> throw IllegalStateException("未定義なNavigation Itemです")
}
mainActivity.startActivity(Intent(mainActivity, activity))
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/NoteCreateResultHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.work.WorkInfo
import com.google.android.material.snackbar.Snackbar
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.note.NoteDetailActivity
import net.pantasystem.milktea.worker.note.CreateNoteWorker
import net.pantasystem.milktea.worker.note.CreateNoteWorkerExecutor
internal class NoteCreateResultHandler(
private val activity: AppCompatActivity,
private val view: View,
private val createNoteWorkerExecutor: CreateNoteWorkerExecutor,
) {
operator fun invoke(workInfo: WorkInfo) {
when (workInfo.state) {
WorkInfo.State.ENQUEUED -> Unit
WorkInfo.State.RUNNING -> Unit
WorkInfo.State.SUCCEEDED -> {
val noteId =
workInfo.outputData.getLong(CreateNoteWorker.EXTRA_ACCOUNT_ID, -1).takeIf {
it != -1L
}?.let {
Note.Id(
it,
workInfo.outputData.getString(CreateNoteWorker.EXTRA_NOTE_ID) ?: ""
)
} ?: return
activity.getString(R.string.successfully_created_note).showSnackBar(
activity.getString(R.string.show) to ({
activity.startActivity(
NoteDetailActivity.newIntent(activity, noteId)
)
})
)
createNoteWorkerExecutor.onHandled(workInfo.id)
}
WorkInfo.State.FAILED -> {
val draftNoteId =
workInfo.outputData.getLong(CreateNoteWorker.EXTRA_DRAFT_NOTE_ID, -1).takeIf {
it != -1L
} ?: return
if (activity.supportFragmentManager.findFragmentByTag("NotePostFailedDialogFragment") == null) {
val reasonType =
workInfo.outputData.getString(CreateNoteWorker.EXTRA_FAILED_REASON)
NotePostFailedDialogFragment.newInstance(
draftNoteId,
reasonType?.let {
CreateNoteWorker.ErrorReasonType.values().find {
it.name == reasonType
}
} ?: CreateNoteWorker.ErrorReasonType.UnknownError,
workInfo.outputData.getString(CreateNoteWorker.EXTRA_FAILED_STACKTRACE),
).show(activity.supportFragmentManager, "NotePostFailedDialogFragment")
}
createNoteWorkerExecutor.onHandled(workInfo.id)
}
WorkInfo.State.BLOCKED -> Unit
WorkInfo.State.CANCELLED -> Unit
}
}
private fun String.showSnackBar(action: Pair Unit>? = null) {
val snackBar =
Snackbar.make(view, this, Snackbar.LENGTH_LONG)
if (action != null) {
snackBar.setAction(action.first, action.second)
}
snackBar.show()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/NotePostFailedDialogFragment.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Dialog
import android.os.Bundle
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material.TextField
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.google.android.material.composethemeadapter.MdcTheme
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import dagger.hilt.android.AndroidEntryPoint
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.worker.note.CreateNoteWorker
import net.pantasystem.milktea.worker.note.CreateNoteWorkerExecutor
import javax.inject.Inject
@AndroidEntryPoint
class NotePostFailedDialogFragment : AppCompatDialogFragment() {
companion object {
private const val DRAFT_NOTE_ID = "DRAFT_NOTE_ID"
private const val ERROR_REASON_TYPE = "ERROR_REASON_TYPE"
private const val STACKTRACE = "STACKTRACE"
fun newInstance(
draftNoteId: Long,
errorReasonType: CreateNoteWorker.ErrorReasonType,
stackTrace: String?,
): NotePostFailedDialogFragment {
return NotePostFailedDialogFragment().apply {
arguments = Bundle().apply {
putLong(DRAFT_NOTE_ID, draftNoteId)
putString(ERROR_REASON_TYPE, errorReasonType.name)
putString(STACKTRACE, stackTrace)
}
}
}
}
@Inject
internal lateinit var createNoteWorkerExecutor: CreateNoteWorkerExecutor
private val draftNoteId: Long by lazy {
requireArguments().getLong(DRAFT_NOTE_ID)
}
private val errorReasonType: CreateNoteWorker.ErrorReasonType by lazy {
requireArguments().getString(ERROR_REASON_TYPE)?.let { type ->
CreateNoteWorker.ErrorReasonType.values().find {
it.name == type
}
} ?: CreateNoteWorker.ErrorReasonType.UnknownError
}
private val stackTrace: String? by lazy {
requireArguments().getString(STACKTRACE)
}
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.note_creation_failure)
.setPositiveButton(R.string.retry){ _, _ ->
createNoteWorkerExecutor.enqueue(draftNoteId)
}
.setView(
ComposeView(requireContext()).apply {
setContent {
MdcTheme {
var isVisibleDetailMessage by remember { mutableStateOf(false) }
Column(Modifier.padding(horizontal = 16.dp)) {
Text(
getReasonText(
errorReasonType = errorReasonType,
stackTrace = stackTrace
),
Modifier.padding(horizontal = 8.dp, vertical = 8.dp),
fontWeight = FontWeight.Bold,
)
TextButton(onClick = { isVisibleDetailMessage = !isVisibleDetailMessage }) {
Text(stringResource(id = R.string.show_error))
}
AnimatedVisibility(
visible = isVisibleDetailMessage,
) {
TextField(
stackTrace ?: "Unknown Error",
onValueChange = {},
modifier = Modifier.heightIn(
min = 100.dp,
max = 300.dp
).verticalScroll(rememberScrollState()),
)
}
}
}
}
}
)
.setNegativeButton(R.string.cancel) { _, _ ->
dismiss()
}
.create()
}
}
@Composable
fun getReasonText(errorReasonType: CreateNoteWorker.ErrorReasonType, stackTrace: String?): String {
val context = LocalContext.current
return when(errorReasonType) {
CreateNoteWorker.ErrorReasonType.NetworkError -> context.getString(R.string.network_error)
CreateNoteWorker.ErrorReasonType.FileUploadDeviceSecurityError -> "Device File Security Error"
CreateNoteWorker.ErrorReasonType.FileUploadDriveNoFreeSpaceError -> context.getString(R.string.misskey_role_drive_no_free_space_error_message)
CreateNoteWorker.ErrorReasonType.ServerError -> context.getString(R.string.server_error)
CreateNoteWorker.ErrorReasonType.ClientError -> context.getString(R.string.parameter_error)
CreateNoteWorker.ErrorReasonType.UnauthorizedError -> context.getString(R.string.unauthorized_error)
CreateNoteWorker.ErrorReasonType.IAmAiError -> context.getString(R.string.bot_error)
CreateNoteWorker.ErrorReasonType.ToManyRequestError -> context.getString(R.string.rate_limit_error)
CreateNoteWorker.ErrorReasonType.NotFoundError -> context.getString(R.string.not_found_error)
CreateNoteWorker.ErrorReasonType.UnknownError -> stackTrace ?: "Unknown Error"
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/SafeSearchDescriptionDialog.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Dialog
import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.activityViewModels
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainViewModel
import net.pantasystem.milktea.common_resource.R
import net.pantasystem.milktea.setting.activities.SettingMovementActivity
class SafeSearchDescriptionDialog : DialogFragment() {
companion object {
const val TAG = "SafeSearchDescriptionDialog"
}
private val preferences by lazy {
requireContext().getSharedPreferences("safe_search_description_dialog", Context.MODE_PRIVATE)
}
private val mainViewModel by activityViewModels()
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.safe_search_description_dialog_title)
.setMessage(R.string.safe_search_description_dialog_message)
.setPositiveButton(R.string.safe_search_description_dialog_positive_button) { _, _ ->
mainViewModel.onGoToSettingSafeSearchButtonClicked()
val intent = Intent(requireContext(), SettingMovementActivity::class.java)
intent.putExtra(SettingMovementActivity.EXTRA_HIGHLIGHT_SAFE_SEARCH, true)
startActivity(intent)
dismiss()
}
.setNegativeButton(R.string.safe_search_description_dialog_negative_button) { _, _ ->
if (preferences.getInt("counter", 0) >= 1) {
mainViewModel.onDoNotShowSafeSearchDescription()
}
preferences.edit().putInt("counter", preferences.getInt("counter", 0) + 1).apply()
// 何もしない
dismiss()
}
.setCancelable(false)
.create()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/SetSimpleEditor.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.view.View
import androidx.fragment.app.FragmentManager
import com.google.android.material.floatingactionbutton.FloatingActionButton
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.app_store.setting.SettingStore
import net.pantasystem.milktea.note.editor.SimpleEditorFragment
internal class SetSimpleEditor(
private val fragmentManager: FragmentManager,
private val settingStore: SettingStore,
private val fab: FloatingActionButton,
) {
operator fun invoke() {
val ft = fragmentManager.beginTransaction()
val editor = fragmentManager.findFragmentByTag("simpleEditor")
if (settingStore.isSimpleEditorEnabled) {
fab.visibility = View.GONE
if (editor == null) {
ft.replace(R.id.simpleEditorBase, SimpleEditorFragment(), "simpleEditor")
}
} else {
fab.visibility = View.VISIBLE
editor?.let {
ft.remove(it)
}
}
ft.commit()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/SetUpNavHeader.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.LifecycleOwner
import com.google.android.material.navigation.NavigationView
import jp.panta.misskeyandroidclient.databinding.NavHeaderMainBinding
import net.pantasystem.milktea.common_android_ui.account.viewmodel.AccountViewModel
internal class SetUpNavHeader(
private val navView: NavigationView,
private val lifecycleOwner: LifecycleOwner,
private val accountViewModel: AccountViewModel
) {
operator fun invoke() {
DataBindingUtil.bind(this.navView.getHeaderView(0))
val headerBinding =
DataBindingUtil.getBinding(this.navView.getHeaderView(0))
headerBinding?.lifecycleOwner = lifecycleOwner
headerBinding?.accountViewModel = accountViewModel
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/SetupOnBackPressedDispatcherHandler.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import androidx.activity.addCallback
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.navigation.findNavController
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.databinding.ActivityMainBinding
class SetupOnBackPressedDispatcherHandler(
private val activity: AppCompatActivity,
private val binding: ActivityMainBinding,
) {
@Suppress("RestrictedApi")
fun setup() {
activity.onBackPressedDispatcher.addCallback {
val drawerLayout: DrawerLayout = binding.drawerLayout
val navController = binding.appBarMain.contentMain.contentMain.findNavController()
when {
drawerLayout.isDrawerOpen(GravityCompat.START) -> {
drawerLayout.closeDrawer(GravityCompat.START)
}
// NOTE: そのままpopBackStackしてしまうとcurrentDestinationがNullになってしまいクラッシュしてしまう。
// NOTE: backQueue == 2の時は初めのDestinationを表示している状態になっている
// NOTE: backQueueには初期状態の時点で2つ以上入っている
// destinations stack
// | fragment |
// | navigation |
// |------------|
// 参考: https://qiita.com/kaleidot725/items/a6010dc4e67c944f44f1
navController.currentBackStack.value.filterNot { it.destination.id == R.id.main_nav }.size > 1 -> {
navController.popBackStack()
}
else -> {
remove()
activity.onBackPressedDispatcher.onBackPressed()
}
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ShowBottomNavigationBadgeDelegate.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import com.google.android.material.bottomnavigation.BottomNavigationView
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.ui.main.viewmodel.MainUiState
internal class ShowBottomNavigationBadgeDelegate(
private val bottomNavigationView: BottomNavigationView
) {
operator fun invoke(state: MainUiState) {
if (state.unreadNotificationCount <= 0) {
bottomNavigationView.getBadge(R.id.navigation_notification)
?.clearNumber()
}
if (state.unreadMessagesCount <= 0) {
bottomNavigationView.getBadge(R.id.navigation_message_list)?.clearNumber()
}
bottomNavigationView.getOrCreateBadge(R.id.navigation_notification)
.apply {
isVisible = state.unreadNotificationCount > 0
number = state.unreadNotificationCount
}
bottomNavigationView.getOrCreateBadge(R.id.navigation_message_list).apply {
isVisible = state.unreadMessagesCount > 0
number = state.unreadMessagesCount
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ShowRequestSchedulePostResultSnackBar.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Activity
import android.view.View
import com.google.android.material.snackbar.Snackbar
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.model.note.draft.DraftNoteSavedEvent
class ShowRequestSchedulePostResultSnackBar(
private val activity: Activity,
private val view: View
) {
operator fun invoke(event: DraftNoteSavedEvent) {
when (event) {
is DraftNoteSavedEvent.Failed -> Unit
is DraftNoteSavedEvent.Success -> {
if (event.draftNote.reservationPostingAt != null) {
Snackbar.make(
view,
activity.getString(R.string.successfully_created_schedule_note),
Snackbar.LENGTH_LONG
).show()
}
}
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/ToggleNavigationDrawerDelegate.kt
================================================
package jp.panta.misskeyandroidclient.ui.main
import android.app.Activity
import androidx.annotation.MainThread
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.widget.Toolbar
import androidx.drawerlayout.widget.DrawerLayout
import jp.panta.misskeyandroidclient.R
class ToggleNavigationDrawerDelegate(
private val activity: Activity,
private val drawerLayout: DrawerLayout
) {
private var toggle: ActionBarDrawerToggle? = null
@MainThread
fun updateToolbar(toolbar: Toolbar) {
if (toggle != null) {
drawerLayout.removeDrawerListener(toggle!!)
}
toggle = ActionBarDrawerToggle(
activity,
drawerLayout,
toolbar,
R.string.navigation_drawer_open,
R.string.navigation_drawer_close
)
toggle!!.syncState()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/main/viewmodel/MainViewModel.kt
================================================
package jp.panta.misskeyandroidclient.ui.main.viewmodel
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.google.firebase.crashlytics.FirebaseCrashlytics
import dagger.hilt.android.lifecycle.HiltViewModel
import jp.panta.misskeyandroidclient.BuildConfig
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.shareIn
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
import net.pantasystem.milktea.app_store.account.AccountState
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.app_store.setting.SettingStore
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.common.flatMapCancellableCatching
import net.pantasystem.milktea.common.mapCancellableCatching
import net.pantasystem.milktea.common.runCancellableCatching
import net.pantasystem.milktea.model.emoji.EmojiEventHandler
import net.pantasystem.milktea.model.messaging.UnReadMessages
import net.pantasystem.milktea.model.notification.NotificationRepository
import net.pantasystem.milktea.model.notification.NotificationStreaming
import net.pantasystem.milktea.model.setting.LocalConfigRepository
import javax.inject.Inject
@HiltViewModel
class MainViewModel @Inject constructor(
val accountStore: AccountStore,
unreadMessages: UnReadMessages,
loggerFactory: Logger.Factory,
private val notificationRepository: NotificationRepository,
private val configRepository: LocalConfigRepository,
private val emojiEventHandler: EmojiEventHandler,
private val notificationStreaming: NotificationStreaming,
settingStore: SettingStore
) : ViewModel() {
val logger by lazy {
loggerFactory.create("MainViewModel")
}
@OptIn(ExperimentalCoroutinesApi::class)
val unreadMessageCount = accountStore.observeCurrentAccount.filterNotNull().flatMapLatest {
unreadMessages.findByAccountId(it.accountId)
}.map {
it.size
}.flowOn(Dispatchers.IO).catch { e ->
logger.error("メッセージ既読数取得エラー", e = e)
}.stateIn(viewModelScope, SharingStarted.Lazily, 0)
@OptIn(ExperimentalCoroutinesApi::class)
val unreadNotificationCount = accountStore.observeCurrentAccount.filterNotNull().flatMapLatest {
notificationRepository.countUnreadNotification(it.accountId)
}.flowOn(Dispatchers.IO).catch { e ->
logger.error("通知既読数取得エラー", e = e)
}.stateIn(viewModelScope, SharingStarted.Lazily, 0)
@OptIn(ExperimentalCoroutinesApi::class)
val newNotifications = accountStore.observeCurrentAccount.filterNotNull().flatMapLatest { ac ->
notificationStreaming.connect { ac }
}.flowOn(Dispatchers.IO).catch { e ->
logger.error("通知取得エラー", e = e)
}.shareIn(viewModelScope, SharingStarted.WhileSubscribed())
val isShowFirebaseCrashlytics = settingStore.configState.map {
it.isCrashlyticsCollectionEnabled
}.map {
!(it.isEnable || it.isConfirmed)
}.distinctUntilChanged().shareIn(viewModelScope, SharingStarted.Lazily)
val isShowEnableSafeSearchDescription = settingStore.configState.map {
it.isEnableSafeSearch
}.map {
!it.isConfirmed && !it.isEnabled
}.distinctUntilChanged().shareIn(viewModelScope, SharingStarted.Lazily)
val isShowGoogleAnalyticsDialog = settingStore.configState.map { config ->
!(config.isAnalyticsCollectionEnabled.isEnabled
|| config.isAnalyticsCollectionEnabled.isConfirmed)
&& config.isCrashlyticsCollectionEnabled.isConfirmed
}.distinctUntilChanged().shareIn(viewModelScope, SharingStarted.Lazily)
val isRequestPushNotificationPermission = settingStore.configState.map { config ->
!config.isConfirmedPostNotification
}.distinctUntilChanged().shareIn(viewModelScope, SharingStarted.WhileSubscribed())
val state: StateFlow = combine(
unreadNotificationCount,
unreadMessageCount,
) { unc, umc->
MainUiState(unc, umc)
}.stateIn(viewModelScope, SharingStarted.Lazily, MainUiState())
private val shouldWaitForAuthentication = MutableStateFlow(false)
val accountState = combine(accountStore.state, shouldWaitForAuthentication) { state, waitAuth ->
MainAccountState(state, waitAuth)
}
init {
viewModelScope.launch {
accountStore.observeCurrentAccount.collect(emojiEventHandler::observe)
}
}
fun setCrashlyticsCollectionEnabled(enabled: Boolean) {
viewModelScope.launch {
configRepository.save(
configRepository.get().getOrThrow().setCrashlyticsCollectionEnabled(enabled)
).getOrThrow()
}
}
fun setAnalyticsCollectionEnabled(enabled: Boolean) {
viewModelScope.launch {
runCancellableCatching {
configRepository.save(
configRepository.get().getOrThrow().setAnalyticsCollectionEnabled(enabled)
).getOrThrow()
}.onFailure {
FirebaseCrashlytics.getInstance().recordException(it)
}
}
}
fun onPushNotificationConfirmed() {
viewModelScope.launch {
configRepository.get().flatMapCancellableCatching{
configRepository.save(it.copy(isConfirmedPostNotification = true))
}.onFailure {
logger.error("設定状態の保存に失敗", it)
}
}
}
fun onDoNotShowSafeSearchDescription() {
viewModelScope.launch {
configRepository.get().mapCancellableCatching {
configRepository.save(it.copy(isEnableSafeSearch = it.isEnableSafeSearch.copy(isConfirmed = true)))
}.onFailure {
logger.error("設定状態の保存に失敗", it)
}
}
}
fun onGoToSettingSafeSearchButtonClicked() {
viewModelScope.launch {
configRepository.get().mapCancellableCatching {
configRepository.save(it.copy(isEnableSafeSearch = it.isEnableSafeSearch.copy(isConfirmed = true)))
}.onFailure {
logger.error("設定状態の保存に失敗", it)
}
}
}
fun setShouldWaitForAuthentication(value: Boolean) {
shouldWaitForAuthentication.value = value
}
}
data class MainUiState (
val unreadNotificationCount: Int = 0,
val unreadMessagesCount: Int = 0,
)
/**
* @param shouldWaitForAuthentication 任意の処理が終わるまで、認証画面に遷移するのを待つためのフラグ。
*/
data class MainAccountState(
val state: AccountState,
val shouldWaitForAuthentication: Boolean = false,
) {
// shouldWaitForAuthenticationはデバッグ時・ベンチマーク時の裏技機能なので本番環境では有効化できない
init {
require(!shouldWaitForAuthentication || BuildConfig.BUILD_TYPE == "benchmark" || BuildConfig.BUILD_TYPE == "debug") {
"shouldWaitForAuthenticationはデバッグ・ベンチマークモード以外の時は有効にすることができません"
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/strings_helper/web_socket_error.kt
================================================
package jp.panta.misskeyandroidclient.ui.strings_helper
import android.content.Context
import android.widget.Toast
import jp.panta.misskeyandroidclient.R
import net.pantasystem.milktea.api_streaming.Socket
fun Context.webSocketStateMessageScope(block: WebSocketStateMessageScope.()->Unit) {
block.invoke(WebSocketStateMessageScope(this))
}
class WebSocketStateMessageScope(val context: Context) {
fun Socket.State.showToastMessage() {
val message = getStateMessage()
Toast.makeText(context, message, Toast.LENGTH_SHORT).show()
}
private fun Socket.State.getStateMessage(): String {
return when(this){
is Socket.State.Connected -> context.getString(R.string.connected)
is Socket.State.Connecting -> if (this.isReconnect) {
context.getString(R.string.connecting)
} else {
context.getString(R.string.connecting)
}
is Socket.State.Closing -> context.getString(R.string.closing)
is Socket.State.Failure -> context.getString(R.string.websocket_error) + this.throwable
is Socket.State.Closed -> context.getString(R.string.closed)
is Socket.State.NeverConnected -> ""
}
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/tab/TabFragment.kt
================================================
package jp.panta.misskeyandroidclient.ui.tab
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.core.view.MenuHost
import androidx.core.view.MenuProvider
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.repeatOnLifecycle
import com.google.android.material.tabs.TabLayout
import com.wada811.databinding.dataBinding
import dagger.hilt.android.AndroidEntryPoint
import jp.panta.misskeyandroidclient.R
import jp.panta.misskeyandroidclient.databinding.FragmentTabBinding
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.common.ui.ApplyMenuTint
import net.pantasystem.milktea.common.ui.AvatarIconView.Companion.setShape
import net.pantasystem.milktea.common.ui.ToolbarSetter
import net.pantasystem.milktea.common_android_ui.PageableFragmentFactory
import net.pantasystem.milktea.common_viewmodel.CurrentPageType
import net.pantasystem.milktea.common_viewmodel.CurrentPageableTimelineViewModel
import net.pantasystem.milktea.model.account.page.Page
import net.pantasystem.milktea.setting.activities.PageSettingActivity
import javax.inject.Inject
@AndroidEntryPoint
class TabFragment : Fragment(R.layout.fragment_tab) {
companion object {
private const val PAGES = "pages"
}
private lateinit var mPagerAdapter: TimelinePagerAdapter
private val binding: FragmentTabBinding by dataBinding()
@Inject
lateinit var accountStore: AccountStore
@Inject
lateinit var pageableFragmentFactory: PageableFragmentFactory
@Inject
lateinit var loggerFactory: Logger.Factory
@Inject
lateinit var applyMenuTint: ApplyMenuTint
private val currentPageViewModel by activityViewModels()
private val mTabViewModel by viewModels()
private var mPages: List? = null
@Suppress("DEPRECATION")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (savedInstanceState != null) {
mPages = savedInstanceState.getParcelableArrayList(PAGES)
}
}
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
mPagerAdapter = TimelinePagerAdapter(
this.childFragmentManager,
pageableFragmentFactory,
mPages ?: emptyList(),
loggerFactory,
)
return super.onCreateView(inflater, container, savedInstanceState)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.viewPager.adapter = mPagerAdapter
binding.tabLayout.setupWithViewPager(binding.viewPager)
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mTabViewModel.pages.collect { pages ->
requireActivity().reportFullyDrawn()
mPages = pages
mPagerAdapter.setList(
pages.sortedBy {
it.weight
})
if (pages.size <= 1) {
binding.tabLayout.visibility = View.GONE
binding.elevationView.visibility = View.VISIBLE
} else {
binding.tabLayout.visibility = View.VISIBLE
binding.elevationView.visibility = View.GONE
binding.tabLayout.tabMode = if (pages.size > 5) {
TabLayout.MODE_SCROLLABLE
} else {
TabLayout.MODE_FIXED
}
}
}
}
}
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
mTabViewModel.currentUser.filterNotNull().collect {
binding.currentAccountView.setImageUrl(it.avatarUrl)
}
}
}
mTabViewModel.visibleInstanceInfo.onEach {
when(it) {
CurrentAccountInstanceInfoUrl.Invisible -> {
binding.currentInstanceHostView.visibility = View.GONE
}
is CurrentAccountInstanceInfoUrl.Visible -> {
binding.currentInstanceHostView.visibility = View.VISIBLE
binding.currentInstanceHostView.text = it.host
}
}
}.flowWithLifecycle(
viewLifecycleOwner.lifecycle,
Lifecycle.State.RESUMED
).launchIn(viewLifecycleOwner.lifecycleScope)
mTabViewModel.avatarIconShapeType.onEach {
binding.currentAccountView.setShape(it.value)
}.flowWithLifecycle(
viewLifecycleOwner.lifecycle,
Lifecycle.State.RESUMED
).launchIn(viewLifecycleOwner.lifecycleScope)
currentPageViewModel.currentType.onEach {
(requireActivity() as MenuHost).invalidateMenu()
}.flowWithLifecycle(
viewLifecycleOwner.lifecycle,
Lifecycle.State.RESUMED
).launchIn(viewLifecycleOwner.lifecycleScope)
(requireActivity() as MenuHost).addMenuProvider(object : MenuProvider {
override fun onCreateMenu(menu: Menu, menuInflater: MenuInflater) {
menuInflater.inflate(R.menu.tab_pager_menu, menu)
val currentPageId = when(val type = currentPageViewModel.currentType.value) {
CurrentPageType.Account -> null
is CurrentPageType.Page -> type.pageId
}
menu.findItem(R.id.edit_tab).isVisible = currentPageId != null
applyMenuTint(requireActivity(), menu)
}
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
return when (menuItem.itemId) {
R.id.edit_tab -> {
when(val type = currentPageViewModel.currentType.value) {
CurrentPageType.Account -> return false
is CurrentPageType.Page -> {
val intent = Intent(requireContext(), PageSettingActivity::class.java).apply {
putExtra(PageSettingActivity.EXTRA_EDIT_TAB_ID, type.pageId)
}
startActivity(intent)
}
}
true
}
else -> false
}
}
}, viewLifecycleOwner, Lifecycle.State.RESUMED)
}
override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState)
if (mPages != null) {
outState.putParcelableArrayList(PAGES, ArrayList(mPages!!))
}
}
override fun onResume() {
super.onResume()
(requireActivity() as? ToolbarSetter?)?.apply {
setToolbar(binding.toolbar)
setTitle(R.string.menu_home)
}
}
override fun onDestroyView() {
super.onDestroyView()
mPagerAdapter.onDestroy()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/tab/TabViewModel.kt
================================================
package jp.panta.misskeyandroidclient.ui.tab
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import net.pantasystem.milktea.app_store.account.AccountStore
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.model.setting.DefaultConfig
import net.pantasystem.milktea.model.setting.LocalConfigRepository
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.model.user.UserRepository
import javax.inject.Inject
@HiltViewModel
class TabViewModel @Inject constructor(
val accountStore: AccountStore,
private val userRepository: UserRepository,
private val configRepository: LocalConfigRepository,
loggerFactory: Logger.Factory,
): ViewModel() {
private val logger by lazy {
loggerFactory.create("TabViewModel")
}
val pages = accountStore.observeCurrentAccount.map {
it?.pages ?: emptyList()
}.stateIn(viewModelScope, SharingStarted.Lazily, emptyList())
@OptIn(ExperimentalCoroutinesApi::class)
val currentUser = accountStore.observeCurrentAccount.filterNotNull().flatMapLatest {
userRepository.observe(User.Id(it.accountId, it.remoteId))
}.flowOn(Dispatchers.IO).stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), null)
@OptIn(ExperimentalCoroutinesApi::class)
val visibleInstanceInfo = accountStore.observeCurrentAccount.filterNotNull().flatMapLatest { account ->
configRepository.observe().map {
if (it.isVisibleInstanceUrlInToolbar) {
CurrentAccountInstanceInfoUrl.Visible(account.getHost())
} else {
CurrentAccountInstanceInfoUrl.Invisible
}
}
}.catch {
logger.error("observe account, config error", it)
}.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), CurrentAccountInstanceInfoUrl.Visible(""))
val avatarIconShapeType = configRepository.observe().map {
it.avatarIconShapeType
}.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5_000), DefaultConfig.config.avatarIconShapeType)
}
sealed interface CurrentAccountInstanceInfoUrl {
data object Invisible : CurrentAccountInstanceInfoUrl
data class Visible(val host: String) : CurrentAccountInstanceInfoUrl
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/ui/tab/TimelinePagerAdapter.kt
================================================
@file:Suppress("DEPRECATION")
package jp.panta.misskeyandroidclient.ui.tab
import android.os.Bundle
import android.os.Parcelable
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.PagerAdapter
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.common_android_ui.PageableFragmentFactory
import net.pantasystem.milktea.model.account.page.Page
import java.util.UUID
internal class TimelinePagerAdapter(
fragmentManager: FragmentManager,
private val pageableFragmentFactory: PageableFragmentFactory,
list: List,
loggerFactory: Logger.Factory
) : FragmentStatePagerAdapter(fragmentManager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
private val logger by lazy {
loggerFactory.create("TimelinePagerAdapter")
}
companion object {
const val FRAGMENT_TAG = "TimelinePagerAdapter.FRAGMENT_TAG"
}
private var requestBaseList: List = list
private var oldRequestBaseSetting = requestBaseList
private val fragmentIds = mutableSetOf()
override fun getCount(): Int {
return requestBaseList.size
}
override fun getItem(position: Int): Fragment {
val item = requestBaseList[position]
val fragment = pageableFragmentFactory.create(item)
val fragmentId = UUID.randomUUID().toString()
when(val args = fragment.arguments) {
null -> {
val bundle = Bundle()
bundle.putString(FRAGMENT_TAG, fragmentId)
fragment.arguments = bundle
}
else -> {
args.putString(FRAGMENT_TAG, fragmentId)
}
}
fragmentIds.add(fragmentId)
// mFragments.add(fragment)
return fragment
}
override fun getPageTitle(position: Int): String {
val page = requestBaseList[position]
return page.title
}
override fun getItemPosition(any: Any): Int {
val target = any as Fragment
val fragmentId = target.arguments?.getString(FRAGMENT_TAG)
if (fragmentId != null && fragmentIds.contains(fragmentId)) {
return PagerAdapter.POSITION_UNCHANGED
}
return PagerAdapter.POSITION_NONE
}
override fun restoreState(state: Parcelable?, loader: ClassLoader?) {
logger.log("restoreState")
try {
super.restoreState(state, loader)
} catch (e: Exception) {
logger.error("restoreState error", e)
e.printStackTrace()
}
}
fun setList(list: List) {
oldRequestBaseSetting = requestBaseList
requestBaseList = list
fragmentIds.clear()
if (requestBaseList != oldRequestBaseSetting) {
notifyDataSetChanged()
}
}
fun onDestroy() {
fragmentIds.clear()
}
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/util/DebuggerSetupManager.kt
================================================
package jp.panta.misskeyandroidclient.util
import android.content.Context
interface DebuggerSetupManager {
fun setup(context: Context)
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/util/DoubleBackPressedFinishDelegate.kt
================================================
package jp.panta.misskeyandroidclient.util
import android.os.Handler
import android.os.Looper
import java.util.concurrent.atomic.AtomicInteger
class DoubleBackPressedFinishDelegate {
private val mHandler = Handler(Looper.getMainLooper())
private var mCounter = 0
fun back(): Boolean{
return if(++mCounter >= 2){
true
}else{
mHandler.removeCallbacks(mCounterTimeReset)
mHandler.postDelayed(mCounterTimeReset, 2000)
false
}
}
private val mCounterTimeReset = Runnable { mCounter = 0 }
}
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/util/task/task_coroutines_util.kt
================================================
package jp.panta.misskeyandroidclient.util.task
import com.google.android.gms.tasks.Task
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
================================================
FILE: app/src/main/java/jp/panta/misskeyandroidclient/worker/WorkerJobInitializer.kt
================================================
package jp.panta.misskeyandroidclient.worker
import android.content.Context
import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.WorkManager
import dagger.hilt.android.qualifiers.ApplicationContext
import net.pantasystem.milktea.worker.SyncAccountInfoWorker
import net.pantasystem.milktea.worker.SyncNodeInfoCacheWorker
import net.pantasystem.milktea.worker.drive.CleanupUnusedCacheWorker
import net.pantasystem.milktea.worker.emoji.cache.CacheCustomEmojiImageWorker
import net.pantasystem.milktea.worker.filter.SyncMastodonFilterWorker
import net.pantasystem.milktea.worker.meta.SyncMetaWorker
import net.pantasystem.milktea.worker.note.BackgroundSyncTimelineWorker
import net.pantasystem.milktea.worker.note.SyncTimelineWorker
import net.pantasystem.milktea.worker.sw.RegisterAllSubscriptionRegistration
import net.pantasystem.milktea.worker.user.SyncLoggedInUserInfoWorker
import net.pantasystem.milktea.worker.user.renote.mute.SyncRenoteMutesWorker
import javax.inject.Inject
class WorkerJobInitializer @Inject constructor(
@ApplicationContext private val context: Context
) {
operator fun invoke() {
WorkManager.getInstance(context).apply {
enqueue(RegisterAllSubscriptionRegistration.createWorkRequest())
enqueue(CleanupUnusedCacheWorker.createOneTimeRequest())
enqueueUniquePeriodicWork(
"syncMeta",
ExistingPeriodicWorkPolicy.CANCEL_AND_REENQUEUE,
SyncMetaWorker.createPeriodicWorkRequest()
)
enqueueUniquePeriodicWork(
"syncNodeInfos",
ExistingPeriodicWorkPolicy.UPDATE,
SyncNodeInfoCacheWorker.createPeriodicWorkRequest()
)
enqueueUniquePeriodicWork(
"syncLoggedInUsers",
ExistingPeriodicWorkPolicy.UPDATE,
SyncLoggedInUserInfoWorker.createPeriodicWorkRequest(),
)
enqueueUniquePeriodicWork(
"syncAccountInfo",
ExistingPeriodicWorkPolicy.UPDATE,
SyncAccountInfoWorker.createPeriodicWorkRequest(),
)
enqueueUniquePeriodicWork(
"syncMastodonWordFilter",
ExistingPeriodicWorkPolicy.UPDATE,
SyncMastodonFilterWorker.createPeriodicWorkerRequest(),
)
enqueueUniquePeriodicWork(
CacheCustomEmojiImageWorker.WORKER_NAME,
ExistingPeriodicWorkPolicy.KEEP,
CacheCustomEmojiImageWorker.createPeriodicWorkRequest(),
)
enqueue(
SyncTimelineWorker.createOneTimeWorkRequest()
)
enqueue(
SyncRenoteMutesWorker.createOneTimeWorkRequest()
)
enqueueUniquePeriodicWork(
BackgroundSyncTimelineWorker.WORKER_NAME,
ExistingPeriodicWorkPolicy.UPDATE,
BackgroundSyncTimelineWorker.createPeriodicWorkRequest(),
)
}
}
}
================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
================================================
FILE: app/src/main/res/layout/app_bar_main.xml
================================================
================================================
FILE: app/src/main/res/layout/content_main.xml
================================================
================================================
FILE: app/src/main/res/layout/fragment_tab.xml
================================================
================================================
FILE: app/src/main/res/layout/nav_header_main.xml
================================================
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
================================================
FILE: app/src/main/res/navigation/main_nav.xml
================================================
================================================
FILE: app/src/main/res/values/values.xml
================================================
6
================================================
FILE: app/src/main/res/values-v21/styles.xml
================================================
================================================
FILE: app/src/main/res/values-v23/styles.xml
================================================
================================================
FILE: app/src/main/res/values-v23/themes.xml
================================================
================================================
FILE: app/src/main/res/values-v27/themes.xml
================================================
================================================
FILE: app/src/main/res/values-w320dp/values.xml
================================================
6
================================================
FILE: app/src/main/res/values-w480dp/values.xml
================================================
8
================================================
FILE: app/src/main/res/values-w600dp/values.xml
================================================
10
================================================
FILE: app/src/main/res/values-w720dp/values.xml
================================================
14
================================================
FILE: app/src/main/res/xml/shortcuts.xml
================================================
================================================
FILE: app/src/release/java/jp/panta/misskeyandroidclient/di/module/EmptyDebuggerSetupManagerImpl.kt
================================================
package jp.panta.misskeyandroidclient.util
import android.content.Context
import javax.inject.Inject
class EmptyDebuggerSetupManagerImpl @Inject constructor() : DebuggerSetupManager {
override fun setup(context: Context) {
}
}
================================================
FILE: app/src/release/java/jp/panta/misskeyandroidclient/di/module/ReleaseAPIModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.impl.OkHttpClientProviderImpl
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
@InstallIn(SingletonComponent::class)
@Module
abstract class ReleaseAPIModule {
@Binds
abstract fun bindOkHttpClientProvider(
impl: OkHttpClientProviderImpl
): OkHttpClientProvider
}
================================================
FILE: app/src/release/java/jp/panta/misskeyandroidclient/di/module/ReleaseAppModule.kt
================================================
package jp.panta.misskeyandroidclient.di.module
import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import jp.panta.misskeyandroidclient.util.DebuggerSetupManager
import jp.panta.misskeyandroidclient.util.EmptyDebuggerSetupManagerImpl
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
abstract class ReleaseAppModule {
@Binds
@Singleton
abstract fun provideFlipperSetupManager(manager: EmptyDebuggerSetupManagerImpl): DebuggerSetupManager
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/GsonNullInstantTest.kt
================================================
package jp.panta.misskeyandroidclient
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.notes.NoteDTO
import org.junit.jupiter.api.Test
class GsonNullInstantTest {
@Test
fun testNullDateParse() {
val decoder = Json {
ignoreUnknownKeys = true
}
val json = """{"id":"8nt24ow8o5","createdAt":"2021-07-04T17:53:23.720Z","userId":"8lep49hc9a","user":{"id":"8lep49hc9a","name":"sh","username":"sfx_as","host":null,"avatarUrl":"https://s3.arkjp.net/misskey/thumbnail-b95de81d-c1cd-46ed-acd0-27ae4cd47182.png","avatarBlurhash":"yEF=K*Nu00E2yB~VIA009a~pogDj=xt+Iaspx=NG%2xt9G?Y-V4;Ip-nNFxb0L${'$'}*odR*-pMxxuEQxa%KxZE2NbnPNYRjRRxat5WCoz","avatarColor":null,"emojis":[],"onlineStatus":"unknown"},"text":null,"cw":null,"visibility":"public","viaMobile":true,"renoteCount":0,"repliesCount":0,"reactions":{},"emojis":[],"fileIds":[],"files":[],"replyId":null,"renoteId":null,"poll":{"multiple":false,"expiresAt":null,"choices":[{"text":" ","votes":1,"isVoted":false},{"text":" ","votes":1,"isVoted":false},{"text":" ","votes":1,"isVoted":false},{"text":" ","votes":0,"isVoted":false},{"text":" ","votes":0,"isVoted":false},{"text":" ","votes":0,"isVoted":false},{"text":" ","votes":0,"isVoted":false},{"text":" ","votes":0,"isVoted":false},{"text":" ","votes":1,"isVoted":false},{"text":" ","votes":0,"isVoted":false}]}}"""
val note: NoteDTO = decoder.decodeFromString(json)
println(note)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/api/APIErrorTest.kt
================================================
package jp.panta.misskeyandroidclient.api
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.api.misskey.DefaultOkHttpClientProvider
import net.pantasystem.milktea.api.misskey.I
import net.pantasystem.milktea.api.misskey.MisskeyAPIServiceBuilder
import net.pantasystem.milktea.api.misskey.notes.CreateNote
import net.pantasystem.milktea.common.APIError
import net.pantasystem.milktea.common.throwIfHasError
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class APIErrorTest {
private val misskeyAPI = MisskeyAPIServiceBuilder(DefaultOkHttpClientProvider()).build("https://misskey.io")
@Test
fun testClientError() {
Assertions.assertThrows(APIError.AuthenticationException::class.java) {
runBlocking {
misskeyAPI.create(CreateNote("", text = null)).throwIfHasError()
}
}
}
//@Test(expected = APIError.AuthenticationException::class)
@Test
fun testAuthenticationError() {
Assertions.assertThrows(APIError.AuthenticationException::class.java) {
runBlocking {
val res = misskeyAPI.i(I(null))
res.throwIfHasError()
}
}
Assertions.assertTrue(true)
}
@Test
fun testHasErrorBody(): Unit = runBlocking {
val res = misskeyAPI.i(I(null))
try {
res.throwIfHasError()
} catch (e: APIError) {
Assertions.assertNotNull(e.error)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/api/mastodon/emojis/TootEmojiDTOTest.kt
================================================
package jp.panta.misskeyandroidclient.api.mastodon.emojis
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.mastodon.emojis.TootEmojiDTO
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class TootEmojiDTOTest {
@Test
fun parse() {
val json = """[{"shortcode":"aaaa","url":"https://files.mastodon.social/custom_emojis/images/000/007/118/original/aaaa.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/007/118/static/aaaa.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"AAAAAA","url":"https://files.mastodon.social/custom_emojis/images/000/071/387/original/AAAAAA.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/071/387/static/AAAAAA.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"amogus","url":"https://files.mastodon.social/custom_emojis/images/000/296/215/original/94971c0455e329bb.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/296/215/static/94971c0455e329bb.png","visible_in_picker":true},{"shortcode":"angery","url":"https://files.mastodon.social/custom_emojis/images/000/000/006/original/angery.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/006/static/angery.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"AngeryCat","url":"https://files.mastodon.social/custom_emojis/images/000/158/746/original/8aec95cc046b5772.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/158/746/static/8aec95cc046b5772.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"badabing","url":"https://files.mastodon.social/custom_emojis/images/000/161/848/original/3715091b44bc9580.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/161/848/static/3715091b44bc9580.png","visible_in_picker":true},{"shortcode":"batman","url":"https://files.mastodon.social/custom_emojis/images/000/005/163/original/8iGbkB7aT.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/005/163/static/8iGbkB7aT.png","visible_in_picker":true},{"shortcode":"BigBlobhajHug","url":"https://files.mastodon.social/custom_emojis/images/000/362/237/original/607b8e399832fc37.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/237/static/607b8e399832fc37.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"birdsite","url":"https://files.mastodon.social/custom_emojis/images/000/010/316/original/birdsite.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/010/316/static/birdsite.png","visible_in_picker":true},{"shortcode":"blobaww","url":"https://files.mastodon.social/custom_emojis/images/000/011/739/original/blobaww.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/011/739/static/blobaww.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobcat","url":"https://files.mastodon.social/custom_emojis/images/000/023/743/original/f31b4b0111ad8b08.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/023/743/static/f31b4b0111ad8b08.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobcatcoffee","url":"https://files.mastodon.social/custom_emojis/images/000/064/080/original/64eaacfe393b80d0.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/064/080/static/64eaacfe393b80d0.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"Blobhaj","url":"https://files.mastodon.social/custom_emojis/images/000/362/246/original/b7bc8932cf8dcdf1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/246/static/b7bc8932cf8dcdf1.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajBlanketBlue","url":"https://files.mastodon.social/custom_emojis/images/000/362/238/original/490d2d377f163b7e.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/238/static/490d2d377f163b7e.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajBlanketSlate","url":"https://files.mastodon.social/custom_emojis/images/000/362/239/original/381db553b7da1cdc.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/239/static/381db553b7da1cdc.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajfBlobbyHug","url":"https://files.mastodon.social/custom_emojis/images/000/362/240/original/210f81597e6ccb0c.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/240/static/210f81597e6ccb0c.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajHeart","url":"https://files.mastodon.social/custom_emojis/images/000/362/241/original/a851df5a8ccde75c.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/241/static/a851df5a8ccde75c.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajHoldAsp","url":"https://files.mastodon.social/custom_emojis/images/000/362/242/original/74217d8046e8d0ec.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/242/static/74217d8046e8d0ec.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajHoldSassage","url":"https://files.mastodon.social/custom_emojis/images/000/362/243/original/0af8ef6b3659b07b.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/243/static/0af8ef6b3659b07b.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajHugFullBody","url":"https://files.mastodon.social/custom_emojis/images/000/362/244/original/8f1859fcc0f3d3a4.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/244/static/8f1859fcc0f3d3a4.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobHajMlem","url":"https://files.mastodon.social/custom_emojis/images/000/362/245/original/ec0b0a00e35e30b6.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/245/static/ec0b0a00e35e30b6.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajPrideHeart","url":"https://files.mastodon.social/custom_emojis/images/000/362/247/original/8414756e1802abe5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/247/static/8414756e1802abe5.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajReach","url":"https://files.mastodon.social/custom_emojis/images/000/362/248/original/c64ec1381a498ee9.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/248/static/c64ec1381a498ee9.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajSadReach","url":"https://files.mastodon.social/custom_emojis/images/000/362/249/original/8a954de17a8dcb07.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/249/static/8a954de17a8dcb07.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajShock","url":"https://files.mastodon.social/custom_emojis/images/000/362/250/original/8d74e30a465b5c13.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/250/static/8d74e30a465b5c13.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajTinyHeart","url":"https://files.mastodon.social/custom_emojis/images/000/362/251/original/869c8971545683ac.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/251/static/869c8971545683ac.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"BlobhajTransPrideHeart","url":"https://files.mastodon.social/custom_emojis/images/000/362/252/original/456d1fea46817af8.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/362/252/static/456d1fea46817af8.png","visible_in_picker":true,"category":"Blahaj"},{"shortcode":"blobmiou","url":"https://files.mastodon.social/custom_emojis/images/000/023/745/original/80d582c929d43058.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/023/745/static/80d582c929d43058.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobnom","url":"https://files.mastodon.social/custom_emojis/images/000/007/122/original/76cf62cd8240f16b.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/007/122/static/76cf62cd8240f16b.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobpats","url":"https://files.mastodon.social/custom_emojis/images/000/003/679/original/80d1ba80bf06950e.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/003/679/static/80d1ba80bf06950e.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobpeek","url":"https://files.mastodon.social/custom_emojis/images/000/011/885/original/ad46663e221f1762.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/011/885/static/ad46663e221f1762.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobsweats","url":"https://files.mastodon.social/custom_emojis/images/000/134/689/original/721b8947c5fa62d5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/134/689/static/721b8947c5fa62d5.png","visible_in_picker":true},{"shortcode":"blobugh","url":"https://files.mastodon.social/custom_emojis/images/000/007/669/original/f62fb5663bbbfb99.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/007/669/static/f62fb5663bbbfb99.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"blobwizard","url":"https://files.mastodon.social/custom_emojis/images/000/111/809/original/6ec8d985ff31d304.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/111/809/static/6ec8d985ff31d304.png","visible_in_picker":true,"category":"Blobs"},{"shortcode":"bongoCat","url":"https://files.mastodon.social/custom_emojis/images/000/067/715/original/fdba57dff7576d53.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/067/715/static/fdba57dff7576d53.png","visible_in_picker":true},{"shortcode":"breathe","url":"https://files.mastodon.social/custom_emojis/images/000/000/782/original/breathe.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/782/static/breathe.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"calculator","url":"https://files.mastodon.social/custom_emojis/images/000/013/352/original/6b5bd68e80c5882d.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/013/352/static/6b5bd68e80c5882d.png","visible_in_picker":true},{"shortcode":"cate","url":"https://files.mastodon.social/custom_emojis/images/000/169/410/original/7e446099eaf20ddf.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/169/410/static/7e446099eaf20ddf.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"catjam","url":"https://files.mastodon.social/custom_emojis/images/000/224/097/original/d9c5e447581399a9.gif","static_url":"https://files.mastodon.social/custom_emojis/images/000/224/097/static/d9c5e447581399a9.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"catPOWER","url":"https://files.mastodon.social/custom_emojis/images/000/274/869/original/850d69ab6fa687a4.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/274/869/static/850d69ab6fa687a4.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"cdrr","url":"https://files.mastodon.social/custom_emojis/images/000/012/880/original/cdrr.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/012/880/static/cdrr.png","visible_in_picker":true},{"shortcode":"clippy","url":"https://files.mastodon.social/custom_emojis/images/000/361/360/original/1e6837de9d441a3e.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/361/360/static/1e6837de9d441a3e.png","visible_in_picker":true},{"shortcode":"computerfairies","url":"https://files.mastodon.social/custom_emojis/images/000/000/954/original/abd0669604e01d4d.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/954/static/abd0669604e01d4d.png","visible_in_picker":true},{"shortcode":"coolcat","url":"https://files.mastodon.social/custom_emojis/images/000/000/005/original/354315741937270794.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/005/static/354315741937270794.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"cwy","url":"https://files.mastodon.social/custom_emojis/images/000/134/895/original/e9759b363f8a7b12.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/134/895/static/e9759b363f8a7b12.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"dab","url":"https://files.mastodon.social/custom_emojis/images/000/098/666/original/727fbb887c5d10d5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/098/666/static/727fbb887c5d10d5.png","visible_in_picker":true},{"shortcode":"dnd","url":"https://files.mastodon.social/custom_emojis/images/000/004/590/original/b12ce74fe2b86ab8.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/004/590/static/b12ce74fe2b86ab8.png","visible_in_picker":true},{"shortcode":"erogun","url":"https://files.mastodon.social/custom_emojis/images/000/103/721/original/4c9038e745f790b5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/103/721/static/4c9038e745f790b5.png","visible_in_picker":true},{"shortcode":"eve","url":"https://files.mastodon.social/custom_emojis/images/000/082/229/original/e551c6a762ca3503.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/082/229/static/e551c6a762ca3503.png","visible_in_picker":true},{"shortcode":"fatpikachu","url":"https://files.mastodon.social/custom_emojis/images/000/150/717/original/2080c3c4892d24c6.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/150/717/static/2080c3c4892d24c6.png","visible_in_picker":true},{"shortcode":"fatyoshi","url":"https://files.mastodon.social/custom_emojis/images/000/023/920/original/e57ecb623faa0dc9.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/023/920/static/e57ecb623faa0dc9.png","visible_in_picker":true},{"shortcode":"firedoge","url":"https://files.mastodon.social/custom_emojis/images/000/279/345/original/e3f6296637377ac0.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/279/345/static/e3f6296637377ac0.png","visible_in_picker":true},{"shortcode":"Fortnite","url":"https://files.mastodon.social/custom_emojis/images/000/045/833/original/32bab51bd98a3f5a.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/045/833/static/32bab51bd98a3f5a.png","visible_in_picker":true},{"shortcode":"fsfe","url":"https://files.mastodon.social/custom_emojis/images/000/266/015/original/40cafccf23c39c18.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/266/015/static/40cafccf23c39c18.png","visible_in_picker":true},{"shortcode":"gargamel","url":"https://files.mastodon.social/custom_emojis/images/000/003/677/original/d3af6f81b96e082d.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/003/677/static/d3af6f81b96e082d.png","visible_in_picker":true},{"shortcode":"gnoblin","url":"https://files.mastodon.social/custom_emojis/images/000/060/276/original/gnomedGnoblin.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/060/276/static/gnomedGnoblin.png","visible_in_picker":true},{"shortcode":"gnome","url":"https://files.mastodon.social/custom_emojis/images/000/060/277/original/gnomedGnome.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/060/277/static/gnomedGnome.png","visible_in_picker":true},{"shortcode":"gnomed","url":"https://files.mastodon.social/custom_emojis/images/000/059/920/original/gnomed.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/059/920/static/gnomed.png","visible_in_picker":true},{"shortcode":"gnomeHey","url":"https://files.mastodon.social/custom_emojis/images/000/060/278/original/gnomedHey.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/060/278/static/gnomedHey.png","visible_in_picker":true},{"shortcode":"hanny","url":"https://files.mastodon.social/custom_emojis/images/000/081/025/original/ab2e53fcbdc91548.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/081/025/static/ab2e53fcbdc91548.png","visible_in_picker":true},{"shortcode":"heart_fire","url":"https://files.mastodon.social/custom_emojis/images/000/043/926/original/heart_fire.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/043/926/static/heart_fire.png","visible_in_picker":true},{"shortcode":"hotboi","url":"https://files.mastodon.social/custom_emojis/images/000/000/783/original/hotboi.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/783/static/hotboi.png","visible_in_picker":true},{"shortcode":"hurb","url":"https://files.mastodon.social/custom_emojis/images/000/345/074/original/a7b8419d23bfa6a2.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/345/074/static/a7b8419d23bfa6a2.png","visible_in_picker":true},{"shortcode":"janiawoo","url":"https://files.mastodon.social/custom_emojis/images/000/011/237/original/96ae120a83734967.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/011/237/static/96ae120a83734967.png","visible_in_picker":true},{"shortcode":"jeb","url":"https://files.mastodon.social/custom_emojis/images/000/276/958/original/19120b1ac993eac0.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/276/958/static/19120b1ac993eac0.png","visible_in_picker":true},{"shortcode":"jennpls","url":"https://files.mastodon.social/custom_emojis/images/000/033/119/original/jennpls.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/033/119/static/jennpls.png","visible_in_picker":true},{"shortcode":"KEKW","url":"https://files.mastodon.social/custom_emojis/images/000/275/356/original/bc4b4fc774be017c.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/275/356/static/bc4b4fc774be017c.png","visible_in_picker":true},{"shortcode":"kerbal","url":"https://files.mastodon.social/custom_emojis/images/000/003/317/original/9614b39f11d19bcf.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/003/317/static/9614b39f11d19bcf.png","visible_in_picker":true},{"shortcode":"kirby","url":"https://files.mastodon.social/custom_emojis/images/000/067/741/original/ffd3a3fdff45d0e3.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/067/741/static/ffd3a3fdff45d0e3.png","visible_in_picker":true},{"shortcode":"knitting","url":"https://files.mastodon.social/custom_emojis/images/000/020/414/original/knitting.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/020/414/static/knitting.png","visible_in_picker":true},{"shortcode":"knzk","url":"https://files.mastodon.social/custom_emojis/images/000/105/638/original/c0380e7a33a947a6.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/105/638/static/c0380e7a33a947a6.png","visible_in_picker":true},{"shortcode":"lattentacle","url":"https://files.mastodon.social/custom_emojis/images/000/006/874/original/941f123686bd39b2.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/006/874/static/941f123686bd39b2.png","visible_in_picker":true},{"shortcode":"maple","url":"https://files.mastodon.social/custom_emojis/images/000/000/953/original/1b22dacadcf0e224.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/953/static/1b22dacadcf0e224.png","visible_in_picker":true},{"shortcode":"mastodon","url":"https://files.mastodon.social/custom_emojis/images/000/003/675/original/089aaae26a2abcc1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/003/675/static/089aaae26a2abcc1.png","visible_in_picker":true},{"shortcode":"michaelwazowski","url":"https://files.mastodon.social/custom_emojis/images/000/191/148/original/44c7ff38144cfde9.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/191/148/static/44c7ff38144cfde9.png","visible_in_picker":true},{"shortcode":"microblog","url":"https://files.mastodon.social/custom_emojis/images/000/208/199/original/2d9a5114d0b38186.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/208/199/static/2d9a5114d0b38186.png","visible_in_picker":true},{"shortcode":"nigmaGrin","url":"https://files.mastodon.social/custom_emojis/images/000/000/121/original/294208830299176960.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/121/static/294208830299176960.png","visible_in_picker":true},{"shortcode":"nigmathink","url":"https://files.mastodon.social/custom_emojis/images/000/016/596/original/nigmathink.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/016/596/static/nigmathink.png","visible_in_picker":true},{"shortcode":"noelle","url":"https://files.mastodon.social/custom_emojis/images/000/000/956/original/peridot-santa-transparent.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/956/static/peridot-santa-transparent.png","visible_in_picker":true},{"shortcode":"OMEGALUL","url":"https://files.mastodon.social/custom_emojis/images/000/084/730/original/1f09c207dfb2b4b1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/084/730/static/1f09c207dfb2b4b1.png","visible_in_picker":true},{"shortcode":"omgdotlol","url":"https://files.mastodon.social/custom_emojis/images/000/342/022/original/217ecbd0f198b748.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/342/022/static/217ecbd0f198b748.png","visible_in_picker":true},{"shortcode":"OttGun","url":"https://files.mastodon.social/custom_emojis/images/000/027/718/original/LilypadGun3_V2_112x112.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/027/718/static/LilypadGun3_V2_112x112.png","visible_in_picker":true,"category":"Sheepsticked"},{"shortcode":"overwatch","url":"https://files.mastodon.social/custom_emojis/images/000/004/594/original/6d181fa79a38e644.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/004/594/static/6d181fa79a38e644.png","visible_in_picker":true},{"shortcode":"owi","url":"https://files.mastodon.social/custom_emojis/images/000/011/738/original/blobaww.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/011/738/static/blobaww.png","visible_in_picker":true},{"shortcode":"patcat","url":"https://files.mastodon.social/custom_emojis/images/000/023/744/original/ac93ef9524eb7eb4.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/023/744/static/ac93ef9524eb7eb4.png","visible_in_picker":true},{"shortcode":"pensive_party_blob","url":"https://files.mastodon.social/custom_emojis/images/000/086/980/original/31fd04ff8be27277.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/086/980/static/31fd04ff8be27277.png","visible_in_picker":true},{"shortcode":"perfect","url":"https://files.mastodon.social/custom_emojis/images/000/021/040/original/9a1f57bbca692009.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/021/040/static/9a1f57bbca692009.png","visible_in_picker":true},{"shortcode":"pika","url":"https://files.mastodon.social/custom_emojis/images/000/063/710/original/pika.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/063/710/static/pika.png","visible_in_picker":true},{"shortcode":"pixelfed","url":"https://files.mastodon.social/custom_emojis/images/000/068/773/original/pixelfed-icon-color.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/068/773/static/pixelfed-icon-color.png","visible_in_picker":true},{"shortcode":"pizza_pineapple","url":"https://files.mastodon.social/custom_emojis/images/000/007/410/original/339d511b2e6846ee.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/007/410/static/339d511b2e6846ee.png","visible_in_picker":true},{"shortcode":"polarbear","url":"https://files.mastodon.social/custom_emojis/images/000/010/443/original/a3981421a04d4f47.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/010/443/static/a3981421a04d4f47.png","visible_in_picker":true},{"shortcode":"psyduck","url":"https://files.mastodon.social/custom_emojis/images/000/012/919/original/c2c7cf7b86087cf4.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/012/919/static/c2c7cf7b86087cf4.png","visible_in_picker":true},{"shortcode":"red_candle","url":"https://files.mastodon.social/custom_emojis/images/000/006/870/original/ccc69dfeacb2d0a1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/006/870/static/ccc69dfeacb2d0a1.png","visible_in_picker":true},{"shortcode":"rocinante","url":"https://files.mastodon.social/custom_emojis/images/000/165/472/original/52b934c7812b0f4c.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/165/472/static/52b934c7812b0f4c.png","visible_in_picker":true},{"shortcode":"roundboi","url":"https://files.mastodon.social/custom_emojis/images/000/010/441/original/Milde.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/010/441/static/Milde.png","visible_in_picker":true},{"shortcode":"sabakan","url":"https://files.mastodon.social/custom_emojis/images/000/003/676/original/77c4094eacccac9e.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/003/676/static/77c4094eacccac9e.png","visible_in_picker":true},{"shortcode":"sadness","url":"https://files.mastodon.social/custom_emojis/images/000/158/747/original/2345f0283e1323f2.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/158/747/static/2345f0283e1323f2.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"scremcat","url":"https://files.mastodon.social/custom_emojis/images/000/192/492/original/7c2c07178601fe71.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/192/492/static/7c2c07178601fe71.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"screwattack","url":"https://files.mastodon.social/custom_emojis/images/000/001/889/original/6f11873e8ac5dd20.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/001/889/static/6f11873e8ac5dd20.png","visible_in_picker":true},{"shortcode":"sheepoSleepo","url":"https://files.mastodon.social/custom_emojis/images/000/214/157/original/db4a6a7999b0a4c5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/214/157/static/db4a6a7999b0a4c5.png","visible_in_picker":true,"category":"Sheepsticked"},{"shortcode":"sickmeme","url":"https://files.mastodon.social/custom_emojis/images/000/000/778/original/sickmeme.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/778/static/sickmeme.png","visible_in_picker":true},{"shortcode":"sidekiq","url":"https://files.mastodon.social/custom_emojis/images/000/037/182/original/7efd7097c1d613e9.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/037/182/static/7efd7097c1d613e9.png","visible_in_picker":true},{"shortcode":"SMOrc","url":"https://files.mastodon.social/custom_emojis/images/000/134/194/original/118d7b6293628abd.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/134/194/static/118d7b6293628abd.png","visible_in_picker":true},{"shortcode":"smug","url":"https://files.mastodon.social/custom_emojis/images/000/078/035/original/smug.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/078/035/static/smug.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"splatoon","url":"https://files.mastodon.social/custom_emojis/images/000/004/592/original/632e04f8f0f4ca62.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/004/592/static/632e04f8f0f4ca62.png","visible_in_picker":true},{"shortcode":"stardewvalley","url":"https://files.mastodon.social/custom_emojis/images/000/004/591/original/f9a94b8af8dd1c72.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/004/591/static/f9a94b8af8dd1c72.png","visible_in_picker":true},{"shortcode":"thaenkin","url":"https://files.mastodon.social/custom_emojis/images/000/000/012/original/334845559435296768.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/012/static/334845559435296768.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"thinkerguns","url":"https://files.mastodon.social/custom_emojis/images/000/010/444/original/ad0f730111fcec86.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/010/444/static/ad0f730111fcec86.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"thinkhappy","url":"https://files.mastodon.social/custom_emojis/images/000/000/011/original/328081997266288640.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/000/011/static/328081997266288640.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"ThisTBH","url":"https://files.mastodon.social/custom_emojis/images/000/017/890/original/thistbh.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/017/890/static/thistbh.png","visible_in_picker":true},{"shortcode":"thonking","url":"https://files.mastodon.social/custom_emojis/images/000/098/690/original/a8d36edc4a7032e8.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/098/690/static/a8d36edc4a7032e8.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"thounking","url":"https://files.mastodon.social/custom_emojis/images/000/015/243/original/thounking.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/015/243/static/thounking.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"tinking","url":"https://files.mastodon.social/custom_emojis/images/000/098/689/original/4cee17450e73c1d1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/098/689/static/4cee17450e73c1d1.png","visible_in_picker":true,"category":"Thinking"},{"shortcode":"tiredcat","url":"https://files.mastodon.social/custom_emojis/images/000/208/133/original/3fc349614f1da0b1.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/208/133/static/3fc349614f1da0b1.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"toot","url":"https://files.mastodon.social/custom_emojis/images/000/007/123/original/emot-toot.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/007/123/static/emot-toot.png","visible_in_picker":true},{"shortcode":"toucan","url":"https://files.mastodon.social/custom_emojis/images/000/046/747/original/toucan.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/046/747/static/toucan.png","visible_in_picker":true,"category":"Sheepsticked"},{"shortcode":"transgender","url":"https://files.mastodon.social/custom_emojis/images/000/109/578/original/5fa14063388db534.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/109/578/static/5fa14063388db534.png","visible_in_picker":true},{"shortcode":"trebuchet","url":"https://files.mastodon.social/custom_emojis/images/000/034/644/original/abfbab57084022df.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/034/644/static/abfbab57084022df.png","visible_in_picker":true},{"shortcode":"unarist","url":"https://files.mastodon.social/custom_emojis/images/000/001/091/original/b6816ca3542e9fc0.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/001/091/static/b6816ca3542e9fc0.png","visible_in_picker":true},{"shortcode":"underheart","url":"https://files.mastodon.social/custom_emojis/images/000/033/302/original/underheart.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/033/302/static/underheart.png","visible_in_picker":true},{"shortcode":"warcraft","url":"https://files.mastodon.social/custom_emojis/images/000/004/593/original/7ca494c09fae0384.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/004/593/static/7ca494c09fae0384.png","visible_in_picker":true},{"shortcode":"weirdfish","url":"https://files.mastodon.social/custom_emojis/images/000/001/489/original/8a2fdcf42b344cd9.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/001/489/static/8a2fdcf42b344cd9.png","visible_in_picker":true},{"shortcode":"welp","url":"https://files.mastodon.social/custom_emojis/images/000/046/994/original/welp.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/046/994/static/welp.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"wily_ufo","url":"https://files.mastodon.social/custom_emojis/images/000/002/321/original/dc7da5987f1e07b0.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/002/321/static/dc7da5987f1e07b0.png","visible_in_picker":true},{"shortcode":"wyd","url":"https://files.mastodon.social/custom_emojis/images/000/001/069/original/wyd.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/001/069/static/wyd.png","visible_in_picker":true,"category":"Cats"},{"shortcode":"yell","url":"https://files.mastodon.social/custom_emojis/images/000/017/111/original/d7804d8bc27cc5d5.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/017/111/static/d7804d8bc27cc5d5.png","visible_in_picker":true},{"shortcode":"yikes","url":"https://files.mastodon.social/custom_emojis/images/000/031/275/original/yikes.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/031/275/static/yikes.png","visible_in_picker":true},{"shortcode":"ziltoid","url":"https://files.mastodon.social/custom_emojis/images/000/017/094/original/05252745eb087806.png","static_url":"https://files.mastodon.social/custom_emojis/images/000/017/094/static/05252745eb087806.png","visible_in_picker":true}]"""
val emojis: List = Json.decodeFromString(json)
Assertions.assertNotEquals(0, emojis.size)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/api/mastodon/instance/InstanceTest.kt
================================================
package jp.panta.misskeyandroidclient.api.mastodon.instance
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.mastodon.instance.Instance
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class InstanceTest {
@Test
fun decode() {
val str = """{"uri":"mastodon.social","title":"Mastodon","short_description":"Server run by the main developers of the project \u003cimg draggable=\"false\" alt=\"🐘\" class=\"emojione\" src=\"https://mastodon.social/emoji/1f418.svg\" /\u003e It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!","description":"Server run by the main developers of the project \u003cimg draggable=\"false\" alt=\"🐘\" class=\"emojione\" src=\"https://mastodon.social/emoji/1f418.svg\" /\u003e It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!","email":"staff@mastodon.social","version":"3.4.6","urls":{"streaming_api":"wss://mastodon.social"},"stats":{"user_count":630511,"status_count":34497004,"domain_count":21882},"thumbnail":"https://files.mastodon.social/site_uploads/files/000/000/001/original/vlcsnap-2018-08-27-16h43m11s127.png","languages":["en"],"registrations":true,"approval_required":false,"invites_enabled":true,"configuration":{"statuses":{"max_characters":500,"max_media_attachments":4,"characters_reserved_per_url":23},"media_attachments":{"supported_mime_types":["image/jpeg","image/png","image/gif","video/webm","video/mp4","video/quicktime","video/ogg","audio/wave","audio/wav","audio/x-wav","audio/x-pn-wave","audio/ogg","audio/vorbis","audio/mpeg","audio/mp3","audio/webm","audio/flac","audio/aac","audio/m4a","audio/x-m4a","audio/mp4","audio/3gpp","video/x-ms-asf"],"image_size_limit":10485760,"image_matrix_limit":16777216,"video_size_limit":41943040,"video_frame_rate_limit":60,"video_matrix_limit":2304000},"polls":{"max_options":4,"max_characters_per_option":50,"min_expiration":300,"max_expiration":2629746}},"contact_account":{"id":"1","username":"Gargron","acct":"Gargron","display_name":"Eugen","locked":false,"bot":false,"discoverable":true,"group":false,"created_at":"2016-03-16T00:00:00.000Z","note":"\u003cp\u003eFounder, CEO and lead developer \u003cspan class=\"h-card\"\u003e\u003ca href=\"https://mastodon.social/@Mastodon\" class=\"u-url mention\"\u003e@\u003cspan\u003eMastodon\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e, Germany.\u003c/p\u003e","url":"https://mastodon.social/@Gargron","avatar":"https://files.mastodon.social/accounts/avatars/000/000/001/original/ccb05a778962e171.png","avatar_static":"https://files.mastodon.social/accounts/avatars/000/000/001/original/ccb05a778962e171.png","header":"https://files.mastodon.social/accounts/headers/000/000/001/original/3b91c9965d00888b.jpeg","header_static":"https://files.mastodon.social/accounts/headers/000/000/001/original/3b91c9965d00888b.jpeg","followers_count":99507,"following_count":272,"statuses_count":71557,"last_status_at":"2022-03-05","emojis":[],"fields":[{"name":"Patreon","value":"\u003ca href=\"https://www.patreon.com/mastodon\" rel=\"me nofollow noopener noreferrer\" target=\"_blank\"\u003e\u003cspan class=\"invisible\"\u003ehttps://www.\u003c/span\u003e\u003cspan class=\"\"\u003epatreon.com/mastodon\u003c/span\u003e\u003cspan class=\"invisible\"\u003e\u003c/span\u003e\u003c/a\u003e","verified_at":null}]},"rules":[{"id":"1","text":"Sexually explicit or violent media must be marked as sensitive when posting"},{"id":"2","text":"No racism, sexism, homophobia, transphobia, xenophobia, or casteism"},{"id":"3","text":"No incitement of violence or promotion of violent ideologies"},{"id":"4","text":"No harassment, dogpiling or doxxing of other users"},{"id":"5","text":"No content illegal in Germany"},{"id":"7","text":"Do not share intentionally false or misleading information"}]}"""
val json = Json {
ignoreUnknownKeys = true
}
val instance: Instance = json.decodeFromString(str)
Assertions.assertEquals("mastodon.social", instance.uri)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/api/misskey/v12/channel/ChannelDTOTest.kt
================================================
package jp.panta.misskeyandroidclient.api.misskey.v12.channel
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.v12.channel.ChannelDTO
import net.pantasystem.milktea.model.account.Account
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
class ChannelDTOTest {
@Test
fun toModel() {
val jsonStr = """{
"id": "8rfhsu910l",
"createdAt": "2021-10-04T00:42:07.525Z",
"lastNotedAt": "2022-03-20T18:41:43.817Z",
"name": "はるのんしすてむどっとこむ",
"description": "消えたので作った",
"userId": "7rla9gie6j",
"bannerUrl": null,
"usersCount": 13,
"notesCount": 375,
"isFollowing": true,
"hasUnreadNote": true
}"""
val parser = Json {
ignoreUnknownKeys = true
}
val channelDTO: ChannelDTO = parser.decodeFromString(jsonStr)
assertEquals(true, channelDTO.isFollowing)
assertEquals(true, channelDTO.hasUnreadNote)
assertEquals(13, channelDTO.usersCount)
assertNull(channelDTO.bannerUrl)
assertEquals("8rfhsu910l", channelDTO.id)
val channel = channelDTO.toModel(
Account(
"id",
"misskey.io",
"Panta",
Account.InstanceType.MISSKEY,
""
)
)
assertEquals(channelDTO.id, channel.id.channelId)
assertEquals(channelDTO.isFollowing, channel.isFollowing)
assertEquals(channelDTO.hasUnreadNote, channel.hasUnreadNote)
assertEquals(channelDTO.name, channel.name)
assertEquals(channelDTO.allowRenoteToExternal, channel.allowRenoteToExternal)
}
@Test
fun decodeJsonUnAuthData() {
val jsonStr = """{
"id": "8rfhsu910l",
"createdAt": "2021-10-04T00:42:07.525Z",
"lastNotedAt": "2022-03-20T18:41:43.817Z",
"name": "はるのんしすてむどっとこむ",
"description": "消えたので作った",
"userId": "7rla9gie6j",
"bannerUrl": null,
"usersCount": 13,
"notesCount": 375
}"""
val parser = Json {
ignoreUnknownKeys = true
}
val channelDTO: ChannelDTO = parser.decodeFromString(jsonStr)
assertNull(channelDTO.isFollowing)
assertNull(channelDTO.hasUnreadNote)
}
@Test
fun decodeJsonAuthorizedData() {
val jsonStr = """{
"id": "8rfhsu910l",
"createdAt": "2021-10-04T00:42:07.525Z",
"lastNotedAt": "2022-03-20T18:41:43.817Z",
"name": "はるのんしすてむどっとこむ",
"description": "消えたので作った",
"userId": "7rla9gie6j",
"bannerUrl": null,
"usersCount": 13,
"notesCount": 375,
"isFollowing": true,
"hasUnreadNote": true
}"""
val parser = Json {
ignoreUnknownKeys = true
}
val channelDTO: ChannelDTO = parser.decodeFromString(jsonStr)
assertEquals(true, channelDTO.isFollowing)
assertEquals(true, channelDTO.hasUnreadNote)
assertEquals(13, channelDTO.usersCount)
assertNull(channelDTO.bannerUrl)
assertEquals("8rfhsu910l", channelDTO.id)
assertEquals("はるのんしすてむどっとこむ", channelDTO.name)
assertEquals("消えたので作った", channelDTO.description)
assertEquals(375, channelDTO.notesCount)
}
@Test
fun decodeJsonDescriptionIsNull() {
val jsonStr = """{
"id": "8rfhsu910l",
"createdAt": "2021-10-04T00:42:07.525Z",
"lastNotedAt": "2022-03-20T18:41:43.817Z",
"name": "はるのんしすてむどっとこむ",
"description": null,
"userId": "7rla9gie6j",
"bannerUrl": null,
"usersCount": 13,
"notesCount": 375,
"isFollowing": true,
"hasUnreadNote": true
}"""
val parser = Json {
ignoreUnknownKeys = true
}
val channelDTO: ChannelDTO = parser.decodeFromString(jsonStr)
assertNull(channelDTO.description)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/api/notes/NoteDTOTest.kt
================================================
package jp.panta.misskeyandroidclient.api.notes
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.emoji.CustomEmojiNetworkDTO
import net.pantasystem.milktea.api.misskey.emoji.EmojisType
import net.pantasystem.milktea.api.misskey.emoji.TestNoteObject
import net.pantasystem.milktea.api.misskey.notes.NoteDTO
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class NoteDTOTest {
@Test
fun jsonDecodeTest() {
val builder = Json {
ignoreUnknownKeys = true
}
val jsonStr =
"""{"id":"8lp2oiif5t","createdAt":"2021-05-12T13:38:19.191Z","userId":"8bku1pzti4","user":{"id":"8bku1pzti4","name":"Thor 🇳🇴","username":"thor","host":"pl.thj.no","avatarUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fpl.thj.no%2Fmedia%2Fbf68fb5dbe1ca0151a262f5f7c1a99f89c487e2da5c3f1fd6adbb1b871ca31be.jpeg&thumbnail=1","avatarBlurhash":"yNIYC0pyyYt-%#o}J8TK%#.7NytlS5tQIUV?nhxsjEWBV?x]bHbcozM|Rjt6WBkCbHR-R-xuxuIURjxZoeofofNGoyWCt7M{bHofR*","avatarColor":null,"instance":{"name":"Pleroma","softwareName":"pleroma","softwareVersion":"2.3.0-1-gb221d77a","iconUrl":"https://pl.thj.no/favicon.png","faviconUrl":"https://pl.thj.no/favicon.png","themeColor":null},"emojis":[],"onlineStatus":"unknown"},"text":null,"cw":null,"visibility":"public","renoteCount":0,"repliesCount":0,"reactions":{},"emojis":[],"fileIds":[],"files":[],"replyId":null,"renoteId":"8loy77x2cp","uri":"https://pl.thj.no/activities/498b3caf-e819-457b-b5fa-934bf5cd91a9","renote":{"id":"8loy77x2cp","createdAt":"2021-05-12T11:32:53.846Z","userId":"7y4q3ytt21","user":{"id":"7y4q3ytt21","name":"Solid Cанëк :sabakan: ","username":"solidsanek","host":"outerheaven.club","avatarUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fouterheaven.club%2Fmedia%2F2b7478fa57151ffde725c6f41b18f215b1b4e6d4769805a89ff6244e0f9ceba3.blob&thumbnail=1","avatarBlurhash":"yiKwR.~Vk=Mxo#xtoz-;IBtQsVkBf7of%gRPxuxas:ofae_3xuM{M|RQW;Rjb^kCn%oyV@f+ofxuoyaeWqV@s:ofWWRjV@j[f6WBWB","avatarColor":null,"instance":{"name":"Outer Heaven","softwareName":"pleroma","softwareVersion":"2.3.0-1-gb221d77a","iconUrl":"https://outerheaven.club/favicon.png","faviconUrl":"https://outerheaven.club/favicon.png","themeColor":null},"emojis":[{"name":"sabakan","url":"https://outerheaven.club/emoji/mess/sabakan.png"}],"onlineStatus":"unknown"},"text":"Lunch time","cw":null,"visibility":"public","renoteCount":6,"repliesCount":1,"reactions":{"👍":7},"emojis":[],"fileIds":["8loy7diyco"],"files":[{"id":"8loy7diyco","createdAt":"2021-05-12T11:33:01.114Z","name":"ff0fb3a916107d7ae0adb95298a9cfd170a70b5265a7204f06bddfd40ab3f3b1.mp4","type":"video/mp4","md5":"2b00b47cd3dce6a0f1da04e6103db676","size":0,"isSensitive":false,"blurhash":null,"properties":{},"url":"https://nos3.arkjp.net/?url=https%3A%2F%2Fouterheaven.club%2Fmedia%2Fff0fb3a916107d7ae0adb95298a9cfd170a70b5265a7204f06bddfd40ab3f3b1.mp4","thumbnailUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fouterheaven.club%2Fmedia%2Fff0fb3a916107d7ae0adb95298a9cfd170a70b5265a7204f06bddfd40ab3f3b1.mp4&thumbnail=1","comment":null,"folderId":null,"folder":null,"userId":null,"user":null}],"replyId":null,"renoteId":null,"uri":"https://outerheaven.club/objects/b6f14bd2-8ad1-4e4e-a5c4-ac318a3d61f0"}}"""
val noteDTO: NoteDTO = builder.decodeFromString(jsonStr)
Assertions.assertNotNull(noteDTO)
}
@Test
fun jsonDecodeTest2() {
val jsonStr = """[
{
"id": "8wx5r4lrqg",
"createdAt": "2022-02-19T08:43:15.087Z",
"userId": "8fu0rxwrdm",
"user": {
"id": "8fu0rxwrdm",
"name": ":_ze::_ro::_za::_su::_ki::wave:",
"username": "zero_zaki_ghost",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-5d26d748-398f-4a68-a876-23e1852f22b1.jpg",
"avatarBlurhash": "yGL|lz-p4njb-=s+aTRyog?Wa{D:WUWJ~lRjSIofN2j?jM^}M{Wmj@jLogIYI-Ri?GWBV|t7IZ?Zt6S0WVRqWD%3%Joyt6s:n.M{Iq",
"avatarColor": null,
"isCat": true,
"emojis": [
{
"name": "_ze",
"url": "https://s3.arkjp.net/misskey/webpublic-fcf3f781-4225-43d5-a5df-53b8936fad4d.png"
},
{
"name": "_ro",
"url": "https://s3.arkjp.net/misskey/webpublic-9b45480c-fa64-4cea-be52-a71c4e67d15a.png"
},
{
"name": "_za",
"url": "https://s3.arkjp.net/misskey/webpublic-d7fc9cef-60eb-4301-91e0-8c74bc41be2a.png"
},
{
"name": "_su",
"url": "https://s3.arkjp.net/misskey/webpublic-91ec1ee3-23d2-42c7-890c-0ef9eed65620.png"
},
{
"name": "_ki",
"url": "https://s3.arkjp.net/misskey/webpublic-ae353d86-489e-4178-b568-89b37ab0c16c.png"
},
{
"name": "wave",
"url": "https://s3.arkjp.net/misskey/webpublic-127746e0-08fe-4e86-be39-1d71a9d35eeb.png"
}
],
"onlineStatus": "online"
},
"text": "いい感じのカレーが来た!🍛",
"cw": null,
"visibility": "public",
"renoteCount": 3,
"repliesCount": 0,
"reactions": {
"🍛": 17,
"👍": 4,
"😋": 1,
":blobcatdroolreach@.:": 1
},
"emojis": [
{
"name": "blobcatdroolreach@.",
"url": "https://s3.arkjp.net/misskey/webpublic-075124a1-5f71-4768-ba9f-8f5e1f5e485a.png"
}
],
"fileIds": [
"8wx5qr4in0"
],
"files": [
{
"id": "8wx5qr4in0",
"createdAt": "2022-02-19T08:42:57.618Z",
"name": "DDB5D7BF-F9AE-4414-980C-22F850477AC4.jpeg",
"type": "image/jpeg",
"md5": "6d2a19a2fe519717dcb1bf786a527486",
"size": 3283785,
"isSensitive": false,
"blurhash": "yZHB0R}sRQNGs:xtxasCV@ofxaxGRjWUe=bYt6Rjs:WXNat6s.ofV[a}ofooKa}oJbHfjoLf5aeRkaxofofbHayWV",
"properties": {
"width": 3024,
"height": 4032
},
"url": "https://s3.arkjp.net/misskey/webpublic-51254b60-edd9-40c5-8c35-e8d6979be41a.jpg",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-d3b5f1f8-93fa-43aa-9e4a-5ea80e259fe9.jpg",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wx4sqjbld",
"createdAt": "2022-02-19T08:16:30.551Z",
"userId": "8fu0rxwrdm",
"user": {
"id": "8fu0rxwrdm",
"name": ":_ze::_ro::_za::_su::_ki::wave:",
"username": "zero_zaki_ghost",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-5d26d748-398f-4a68-a876-23e1852f22b1.jpg",
"avatarBlurhash": "yGL|lz-p4njb-=s+aTRyog?Wa{D:WUWJ~lRjSIofN2j?jM^}M{Wmj@jLogIYI-Ri?GWBV|t7IZ?Zt6S0WVRqWD%3%Joyt6s:n.M{Iq",
"avatarColor": null,
"isCat": true,
"emojis": [
{
"name": "_ze",
"url": "https://s3.arkjp.net/misskey/webpublic-fcf3f781-4225-43d5-a5df-53b8936fad4d.png"
},
{
"name": "_ro",
"url": "https://s3.arkjp.net/misskey/webpublic-9b45480c-fa64-4cea-be52-a71c4e67d15a.png"
},
{
"name": "_za",
"url": "https://s3.arkjp.net/misskey/webpublic-d7fc9cef-60eb-4301-91e0-8c74bc41be2a.png"
},
{
"name": "_su",
"url": "https://s3.arkjp.net/misskey/webpublic-91ec1ee3-23d2-42c7-890c-0ef9eed65620.png"
},
{
"name": "_ki",
"url": "https://s3.arkjp.net/misskey/webpublic-ae353d86-489e-4178-b568-89b37ab0c16c.png"
},
{
"name": "wave",
"url": "https://s3.arkjp.net/misskey/webpublic-127746e0-08fe-4e86-be39-1d71a9d35eeb.png"
}
],
"onlineStatus": "online"
},
"text": "「毒親だけど距離置いてしばらくしたら和解した」って人がちょいちょいおるけど、そーゆう人尊敬する。俺には無理。",
"cw": null,
"visibility": "public",
"renoteCount": 7,
"repliesCount": 0,
"reactions": {
"❤": 1,
"👍": 7
},
"emojis": [],
"fileIds": [],
"files": [],
"replyId": null,
"renoteId": null
},
{
"id": "8wx4j1g676",
"createdAt": "2022-02-19T08:08:58.134Z",
"userId": "7rkrg1wo1a",
"user": {
"id": "7rkrg1wo1a",
"name": "村上さん",
"username": "AureoleArk",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-80626a47-0654-4863-98e1-a7ecfb1c7131.jpg",
"avatarBlurhash": "yHM8pYx]0n-TJCt89vLNEk+sadNK=vxYIUf+o*EQAJWqT0%1RjDjI[%LS5NeRkNIt.i_NGbbv|SixujERkWYXTa#r;jY",
"avatarColor": null,
"isModerator": true,
"emojis": [],
"onlineStatus": "unknown"
},
"text": null,
"cw": null,
"visibility": "public",
"renoteCount": 4,
"repliesCount": 0,
"reactions": {
"👍": 1,
"😇": 4,
"🥴": 4,
":bap@.:": 2
},
"emojis": [
{
"name": "bap@.",
"url": "https://s3.arkjp.net/misskey/1a8e89a6-10fd-4315-85ad-491bd1144058.gif"
}
],
"fileIds": [
"8wx4j0frcs"
],
"files": [
{
"id": "8wx4j0frcs",
"createdAt": "2022-02-19T08:08:56.823Z",
"name": "2022-02-19 17-08-56 1.png",
"type": "image/png",
"md5": "f04366a251295387280bc0788293f0b4",
"size": 384761,
"isSensitive": false,
"blurhash": "yLAB6UaI9GnMnes8rByGjFRjjEjDnjD00tS?GkEj_bJXoL}oz%2kEbeX9XU^%WAE3j]kWW=nNxvocNKodt5oIngD*ofxtaejEslbc",
"properties": {
"width": 615,
"height": 737
},
"url": "https://s3.arkjp.net/misskey/webpublic-574ad5eb-66d6-42b7-b59f-e99a744dc140.png",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-b8ec2fd3-3b55-4c0e-bb2c-2a38e966a190.jpg",
"comment": null,
"folderId": "7v9lb3aif9",
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wx4at7wy5",
"createdAt": "2022-02-19T08:02:34.220Z",
"userId": "8g0j5lv00n",
"user": {
"id": "8g0j5lv00n",
"name": "t_w 79.9kg",
"username": "t_w",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-bfc014aa-76d8-45eb-87a5-8db3e5c1baa1.png",
"avatarBlurhash": "yUO9t7${'$'}+xaD~SO9ZxuxaVtV[%MoyWBbbIVIUsp%LxtofNGX7ozRjI:W=oc-pxtNGf+t7WBxas.oybFRjxtoKWCj]WAoLWV",
"avatarColor": null,
"emojis": [],
"onlineStatus": "online"
},
"text": "Rustで一家離散させて遊んでる",
"cw": null,
"visibility": "public",
"renoteCount": 7,
"repliesCount": 2,
"reactions": {
"🎉": 1,
"👍": 4,
":shikei@.:": 4
},
"emojis": [
{
"name": "shikei@.",
"url": "https://s3.arkjp.net/misskey/webpublic-01d065e5-a99e-455b-b449-f96b4a79fb52.png"
}
],
"fileIds": [
"8wx4altv55"
],
"files": [
{
"id": "8wx4altv55",
"createdAt": "2022-02-19T08:02:24.643Z",
"name": "2022-02-19 17-02-24 1.png",
"type": "image/png",
"md5": "ce5b2ed518a903daae3ff57736c2ba91",
"size": 37629,
"isSensitive": false,
"blurhash": "y05OQl_$'}#ICWtE7IXNfI=I;00${'$'}*s;Vu%1j=j?~qNYI.NFM{ayV[%MM|t8t7R*R*ba00xvxbs;s:RkRj_3tPR%t6R%RjR+",
"properties": {
"width": 462,
"height": 542
},
"url": "https://s3.arkjp.net/misskey/webpublic-50ae16b4-b466-4b67-ad52-5fb712dcae17.png",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-129337e4-7233-4c5e-8a0c-fb425208b3a5.jpg",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wx3kz489a",
"createdAt": "2022-02-19T07:42:28.808Z",
"userId": "7rkrg1wo1a",
"user": {
"id": "7rkrg1wo1a",
"name": "村上さん",
"username": "AureoleArk",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-80626a47-0654-4863-98e1-a7ecfb1c7131.jpg",
"avatarBlurhash": "yHM8pYx]0n-TJCt89vLNEk+sadNK=vxYIUf+QAJWqT0%1RjDjI[%LS5NeRkNIt.i_NGbbv|SixujERkWYXTa#r;jY",
"avatarColor": null,
"isModerator": true,
"emojis": [],
"onlineStatus": "unknown"
},
"text": "Misskeyの完全なSVGロゴなかったので作った\n(公式のSVGはPNGがbase64に変換されたものが埋め込まれている)\n\nhttps://s3.arkjp.net/misskey/3219e602-a0fe-42c7-aa35-f39ddcf90fc2",
"cw": null,
"visibility": "public",
"renoteCount": 10,
"repliesCount": 0,
"reactions": {
"🎉": 1,
"😊": 1,
"🥰": 1,
":igyo@.:": 1,
":misskey@.:": 4,
":nacho_hi@.:": 1,
":arigatofes@.:": 1,
":kami@nca10.net:": 1,
":misskey@fedibird.com:": 1,
":iihanashi@umaskey.net:": 1,
":blob_hearteyes@sushi.ski:": 1,
":igyou@misky.rikunagiweb.jp:": 1
},
"emojis": [
{
"name": "igyo@.",
"url": "https://s3.arkjp.net/misskey/webpublic-d50d9d65-8413-4236-9762-393e4f3585ce.png"
},
{
"name": "misskey@.",
"url": "https://s3.arkjp.net/misskey/webpublic-f3ca12a3-0254-4326-aac8-b79915fc34d6.png"
},
{
"name": "nacho_hi@.",
"url": "https://s3.arkjp.net/misskey/webpublic-105da421-b3af-48fa-af6f-d616f9510823.png"
},
{
"name": "arigatofes@.",
"url": "https://s3.arkjp.net/misskey/webpublic-ddbfee9d-91ab-419a-9247-64dd90b62fac.png"
},
{
"name": "kami@nca10.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.nca10.net%2Fmisskey%2Fwebpublic-1e162464-dbd5-48ce-bd01-39d12e5082ed.png"
},
{
"name": "hosii@nca10.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.nca10.net%2Fmisskey%2Fwebpublic-ef879915-4a38-43f1-8d64-84c763bbbeae.png"
},
{
"name": "misskey@fedibird.com",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.fedibird.com%2Fcustom_emojis%2Fimages%2F000%2F008%2F417%2Foriginal%2Fb081a4cecfbf0750.png"
},
{
"name": "iihanashi@umaskey.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fumaskey.net%2Ffiles%2F9249dae6-22f8-4536-9723-3ef10a1e6b66"
},
{
"name": "blob_hearteyes@sushi.ski",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia.sushi.ski%2Ffiles%2Fd013b1a9-8c40-48d3-827f-53422814419d.gif"
},
{
"name": "igyou@misky.rikunagiweb.jp",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia-misky.rikunagiweb.jp%2Fmedia%2Fwebpublic-9244077e-df15-4c9f-a02f-5ad4d25fe3bd.png"
}
],
"fileIds": [
"8wx3hl69v7"
],
"files": [
{
"id": "8wx3hl69v7",
"createdAt": "2022-02-19T07:39:50.769Z",
"name": "mi.svg",
"type": "image/svg+xml",
"md5": "2167b6ce26cd2c1d78530562f0a4188a",
"size": 5837,
"isSensitive": false,
"blurhash": "yHE;,e%r.g%sy8MkM#yAWCWYoJj[V_af8,M*th%bkBM%RTtNV^t5oej@j@WCRBV]oxf7kAj@ayagayovovkAazk9RSoxRSRTagkAow",
"properties": {
"width": 1345.9,
"height": 985.05
},
"url": "https://s3.arkjp.net/misskey/webpublic-597033c8-49aa-4adb-bbc6-d025e85c2df4.png",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-b34d0613-c969-40f7-a529-39725519e736.png",
"comment": null,
"folderId": "7v9lb3aif9",
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wx3dgiiss",
"createdAt": "2022-02-19T07:36:38.106Z",
"userId": "8fu0rxwrdm",
"user": {
"id": "8fu0rxwrdm",
"name": ":_ze::_ro::_za::_su::_ki::wave:",
"username": "zero_zaki_ghost",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-5d26d748-398f-4a68-a876-23e1852f22b1.jpg",
"avatarBlurhash": "yGL|lz-p4njb-=s+aTRyog?Wa{D:WUWJ~lRjSIofN2j?jM^}M{Wmj@jLogIYI-Ri?GWBV|t7IZ?Zt6S0WVRqWD%3%Joyt6s:n.M{Iq",
"avatarColor": null,
"isCat": true,
"emojis": [
{
"name": "_ze",
"url": "https://s3.arkjp.net/misskey/webpublic-fcf3f781-4225-43d5-a5df-53b8936fad4d.png"
},
{
"name": "_ro",
"url": "https://s3.arkjp.net/misskey/webpublic-9b45480c-fa64-4cea-be52-a71c4e67d15a.png"
},
{
"name": "_za",
"url": "https://s3.arkjp.net/misskey/webpublic-d7fc9cef-60eb-4301-91e0-8c74bc41be2a.png"
},
{
"name": "_su",
"url": "https://s3.arkjp.net/misskey/webpublic-91ec1ee3-23d2-42c7-890c-0ef9eed65620.png"
},
{
"name": "_ki",
"url": "https://s3.arkjp.net/misskey/webpublic-ae353d86-489e-4178-b568-89b37ab0c16c.png"
},
{
"name": "wave",
"url": "https://s3.arkjp.net/misskey/webpublic-127746e0-08fe-4e86-be39-1d71a9d35eeb.png"
}
],
"onlineStatus": "online"
},
"text": "それでは〜?ぺーい!🍻",
"cw": null,
"visibility": "public",
"renoteCount": 1,
"repliesCount": 1,
"reactions": {
"🍻": 14,
"👍": 3
},
"emojis": [],
"fileIds": [
"8wx3dbuk47"
],
"files": [
{
"id": "8wx3dbuk47",
"createdAt": "2022-02-19T07:36:32.060Z",
"name": "D1D2514D-8FF8-4524-ABB4-2CF8235E60A7.jpeg",
"type": "image/jpeg",
"md5": "ddefed5454d0288f234799d700f69d9f",
"size": 3300034,
"isSensitive": false,
"blurhash": "y9I4CDD+?a57-U-VIp~BE3Sj%1M|IqR*IWE2WBRjWBRkbGNdt7%1t6ofs:t6%1R+I;xss:R+X7xDWBR+NGWBNIofoft6f*xss:s:WU",
"properties": {
"width": 3024,
"height": 4032
},
"url": "https://s3.arkjp.net/misskey/webpublic-71a17c67-a2ea-41e3-9102-4c2040528864.jpg",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-8d5611f8-36d2-402c-8cc6-7e10f8e9d3f6.jpg",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wwwqjdrhi",
"createdAt": "2022-02-19T04:30:51.039Z",
"userId": "7rkrarq81i",
"user": {
"id": "7rkrarq81i",
"name": "しゅいろ",
"username": "syuilo",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-c7721442-e698-4635-a662-57d78856bbc0.jpg",
"avatarBlurhash": "yFF5Kq0L00?a^*IBNG01^j-pV@D*o|xt58WB}@9at7s.Ip~AWB57%Laes:xaOEoLnis:ofIpoJr?NHtRV@oLoeNHNI%1M{kCWCjuxZ",
"avatarColor": null,
"isModerator": true,
"isCat": true,
"emojis": [],
"onlineStatus": "online"
},
"text": "コロニャの影響でコンビニ閉まってた:sonnakotoarunda:",
"cw": null,
"visibility": "public",
"renoteCount": 5,
"repliesCount": 0,
"reactions": {
"⭐": 4,
"👍": 6,
"😥": 4,
"😮": 2,
"🤔": 1,
":murishite@.:": 1,
":maanantekoto@.:": 1,
":omae_ga_tsukure@.:": 1,
":sonnakotoarunda@.:": 5,
":nacho_cry@nya.one:": 1,
":ablobcatblinkhyper@.:": 1,
":ablobcatcryingcute@.:": 2,
":crying_cat@nca10.net:": 1,
":blob_sleepy@sushi.ski:": 1,
":blobsleepless@k.lapy.link:": 1,
":cyber_hacking@mk.f72u.net:": 1,
":blobcatcry@misskey.m544.net:": 1,
":sonnakotoarunda@friendsyu.me:": 1,
":sonnakotoarunda@mk.lei202.com:": 1
},
"emojis": [
{
"name": "sonnakotoarunda",
"url": "https://s3.arkjp.net/misskey/webpublic-52ee9700-7114-4690-88cf-8633b2ad962a.png"
},
{
"name": "murishite@.",
"url": "https://s3.arkjp.net/misskey/webpublic-1f9050ad-bdc8-4c86-8c07-68f70f55f887.png"
},
{
"name": "maanantekoto@.",
"url": "https://s3.arkjp.net/misskey/webpublic-15ec5fe4-42ec-41f8-8cd8-fdfafefea93c.png"
},
{
"name": "omae_ga_tsukure@.",
"url": "https://s3.arkjp.net/misskey/webpublic-0c0c7db8-359b-4caf-ae95-5e9a47312f42.png"
},
{
"name": "sonnakotoarunda@.",
"url": "https://s3.arkjp.net/misskey/webpublic-52ee9700-7114-4690-88cf-8633b2ad962a.png"
},
{
"name": "nacho_cry@nya.one",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Ffile.nya.one%2Fmisskey%2Fwebpublic-494cfc89-a3c7-46a5-95d8-fb362bacd3ba.png"
},
{
"name": "ablobcatblinkhyper@.",
"url": "https://s3.arkjp.net/misskey/c1d1be32-f3c3-4c60-9509-cb690b7935a8"
},
{
"name": "ablobcatcryingcute@.",
"url": "https://s3.arkjp.net/misskey/b90b23ac-432d-4bd2-9e58-8ee6980f5595.apng"
},
{
"name": "crying_cat@nca10.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.nca10.net%2Fmisskey%2Fc5f30fa7-2459-47eb-a9ce-060bf6c617d6.apng"
},
{
"name": "blob_sleepy@sushi.ski",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia.sushi.ski%2Ffiles%2F3f6f4034-f527-4e3a-bbb6-406dbcefb9b1.gif"
},
{
"name": "blobsleepless@k.lapy.link",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmisskeylapy.s3.amazonaws.com%2Fnull%2F6fe193f7-a30e-48ad-abba-04f7e92c597e.png"
},
{
"name": "cyber_hacking@mk.f72u.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmk.f72u.net%2Fmedia%2Fmisskey%2F88c357e5-0c30-43c9-9cf5-adb009e0a916.gif"
},
{
"name": "blobcatcry@misskey.m544.net",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmisskey-drive2.m544.net%2Fm544%2Fzcj6iwsig8iw4c9r29cegarn.png"
},
{
"name": "sonnakotoarunda@friendsyu.me",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Ffriendsyu.me%2Ffiles%2F602edca04d88a20c3708cd38%2F602edca04d88a20c3708cd38.png%3Fweb"
},
{
"name": "sonnakotoarunda@mk.lei202.com",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmk.lei202.com%2Ffiles%2F6136515418e61a041d63583e%2F6136515418e61a041d63583e.png%3Fweb"
}
],
"fileIds": [
"8wwwpv6ex6"
],
"files": [
{
"id": "8wwwpv6ex6",
"createdAt": "2022-02-19T04:30:19.670Z",
"name": "D556EB85-FF92-4592-B5F4-909F221C98D4.jpeg",
"type": "image/jpeg",
"md5": "f20b1343b469a36ac0e7c5736926a406",
"size": 4090988,
"isSensitive": false,
"blurhash": "yRG+UNM{ads:E1ofM|_Nt5adIUjYRjRj?cIVM_aeM|Rjay.9M{V?M{WAocRj?bayRjaeoJRkjZ?bj[ofj?Rjofax%MWAfQayj@oeRj",
"properties": {
"width": 4032,
"height": 3024
},
"url": "https://s3.arkjp.net/misskey/webpublic-04603751-9ed4-44e9-81a8-462f31ce6cde.jpg",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-9ea18611-136c-4443-b782-293a627c7a97.jpg",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8wwscscb12",
"createdAt": "2022-02-19T02:28:11.003Z",
"userId": "86p1tmjaav",
"user": {
"id": "86p1tmjaav",
"name": "みれい (1,650km・5.9E+16t)",
"username": "Mi",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-6c009d3c-e7cd-4f55-96a4-2f1b99670f4c.jpg",
"avatarBlurhash": "yiKLUEof*0kW.8t7RjI;ay-pofIUWBoex^ayayM{bIadWBjZofjsV?bHbHWBtRxvfPoKbHWBayoft7f6RjbHt7ayjt",
"avatarColor": null,
"emojis": [],
"onlineStatus": "online"
},
"text": "1,650kmのみれいさん Vs. 日本列島",
"cw": null,
"visibility": "public",
"renoteCount": 8,
"repliesCount": 3,
"reactions": {
"👍": 4,
"🤔": 1,
":cyber_hacking@.:": 2,
":ablobdundundun@.:": 2,
":confusedparrot@fedibird.com:": 1,
":octothink@misky.rikunagiweb.jp:": 1
},
"emojis": [
{
"name": "cyber_hacking@.",
"url": "https://s3.arkjp.net/misskey/f4ace218-272f-49e7-8813-66f47db9efba"
},
{
"name": "ablobdundundun@.",
"url": "https://s3.arkjp.net/misskey/c62c5cef-b9c0-4d8f-b0ce-2e2a358abe9a.gif"
},
{
"name": "confusedparrot@fedibird.com",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.fedibird.com%2Fcustom_emojis%2Fimages%2F000%2F049%2F092%2Foriginal%2Fdbdc78a4a85a4b50.gif"
},
{
"name": "octothink@misky.rikunagiweb.jp",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia-misky.rikunagiweb.jp%2Fmedia%2Fwebpublic-9511a7bf-1cbd-46c5-a0f5-481f8617d1e1.png"
}
],
"fileIds": [
"8wwsccpzeq"
],
"files": [
{
"id": "8wwsccpzeq",
"createdAt": "2022-02-19T02:27:50.759Z",
"name": "みれいさん.png",
"type": "image/png",
"md5": "cfd22a363a7829a356f860499e636081",
"size": 2034258,
"isSensitive": true,
"blurhash": "y97K|^_LM{IoofWCaz-.xsoet7s:RjRjR%axs:oNoftQoxtQt7RkIVNFt7t7IVayxukCNGWBj[ayj?jZWBoft7f8xtofR%bFoyf8a#",
"properties": {
"width": 1658,
"height": 981
},
"url": "https://s3.arkjp.net/misskey/webpublic-fec77b5e-f322-47b8-b063-e1830c835f9f.png",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-0c309337-dcb1-44a5-bd78-8e4b625adacb.png",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8ww3dhb07s",
"createdAt": "2022-02-18T14:48:52.956Z",
"userId": "7rkrarq81i",
"user": {
"id": "7rkrarq81i",
"name": "しゅいろ",
"username": "syuilo",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-c7721442-e698-4635-a662-57d78856bbc0.jpg",
"avatarBlurhash": "yFF5Kq0L00?a^*IBNG01^j-pV@D*o|xt58WB}@9at7s.Ip~AWB57%Laes:xaOEoLnis:ofIpoJr?NHtRV@oLoeNHNI%1M{kCWCjuxZ",
"avatarColor": null,
"isModerator": true,
"isCat": true,
"emojis": [],
"onlineStatus": "online"
},
"text": "テストが3時間経っても終わらにゃいの:ijo:",
"cw": null,
"visibility": "public",
"renoteCount": 3,
"repliesCount": 0,
"reactions": {
"⭐": 6,
"👍": 5,
":ijo@.:": 3,
":yabaiwayo@.:": 1,
":senko_stop@.:": 1,
":ijo@sushi.ski:": 1,
":issue@msk.minetaro12.com:": 1
},
"emojis": [
{
"name": "ijo",
"url": "https://s3.arkjp.net/misskey/webpublic-085c1e56-1157-4c7a-9b93-b43be4f7d7ef.png"
},
{
"name": "ijo@.",
"url": "https://s3.arkjp.net/misskey/webpublic-085c1e56-1157-4c7a-9b93-b43be4f7d7ef.png"
},
{
"name": "yabaiwayo@.",
"url": "https://s3.arkjp.net/misskey/webpublic-4c3e962c-2b2a-48fa-845b-a0822eef733d.png"
},
{
"name": "senko_stop@.",
"url": "https://s3.arkjp.net/misskey/webpublic-d600ad33-561c-4f39-a103-9772529395a9.png"
},
{
"name": "ijo@sushi.ski",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia.sushi.ski%2Ffiles%2Fwebpublic-3678f3f9-727d-4d07-85b0-b9d46d9cd88f.png"
},
{
"name": "issue@msk.minetaro12.com",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmsk.minetaro12.com%2Ffiles%2Fwebpublic-ef33fbde-c155-44a4-a529-ff4515d01873"
}
],
"fileIds": [
"8ww3cxdn8i"
],
"files": [
{
"id": "8ww3cxdn8i",
"createdAt": "2022-02-18T14:48:27.131Z",
"name": "スクリーンショット 2022-02-18 23.47.40.png",
"type": "image/png",
"md5": "c6d0fec428c2a5cc0f8640a3b89b9660",
"size": 264526,
"isSensitive": false,
"blurhash": "y01.]T%NRiadV?ofofozt7%gt8xuWAM{ITt8x]j]WBWBfjV[bJM{ogWBWCt7M{t8RkRPofayj]xvaxt7ozWAaxRj%Noet7jYaef6ay",
"properties": {
"width": 2352,
"height": 1088
},
"url": "https://s3.arkjp.net/misskey/webpublic-25dea5e7-606c-40f8-af49-db39a39b3eda.png",
"thumbnailUrl": "https://s3.arkjp.net/misskey/thumbnail-59e4906d-c198-4cf3-92be-91925a629a1b.jpg",
"comment": null,
"folderId": null,
"folder": null,
"userId": null,
"user": null
}
],
"replyId": null,
"renoteId": null
},
{
"id": "8ww36oo3vw",
"createdAt": "2022-02-18T14:43:35.907Z",
"userId": "7rkrarq81i",
"user": {
"id": "7rkrarq81i",
"name": "しゅいろ",
"username": "syuilo",
"host": null,
"avatarUrl": "https://s3.arkjp.net/misskey/thumbnail-c7721442-e698-4635-a662-57d78856bbc0.jpg",
"avatarBlurhash": "yFF5Kq0L00?a^*IBNG01^j-pV@D*o|xt58WB}@9at7s.Ip~AWB57%Laes:xaOEoLnis:ofIpoJr?NHtRV@oLoeNHNI%1M{kCWCjuxZ",
"avatarColor": null,
"isModerator": true,
"isCat": true,
"emojis": [],
"onlineStatus": "online"
},
"text": "カーリング決勝進出:supertada:",
"cw": null,
"visibility": "public",
"renoteCount": 0,
"repliesCount": 0,
"reactions": {
"⭐": 3,
"🎉": 3,
"🏅": 3,
"👍": 4,
":blobhai@.:": 1,
":iihanashi@.:": 2,
":supertada@.:": 3,
":supertada@sushi.ski:": 1,
":supertada@friendsyu.me:": 1,
":supertada@kokonect.link:": 1,
":supertada@kr.akirin.xyz:": 1,
":supertada@mk.lei202.com:": 1
},
"emojis": [
{
"name": "supertada",
"url": "https://s3.arkjp.net/misskey/e9794209-1544-47ec-b510-e37bfdd46653"
},
{
"name": "blobhai@.",
"url": "https://s3.arkjp.net/misskey/b607fc20-fda7-445b-b13f-37f65c3088b0.gif"
},
{
"name": "iihanashi@.",
"url": "https://s3.arkjp.net/misskey/013cf04e-a057-4aed-ab40-4e0ea97b1aa2.gif"
},
{
"name": "supertada@.",
"url": "https://s3.arkjp.net/misskey/e9794209-1544-47ec-b510-e37bfdd46653"
},
{
"name": "supertada@sushi.ski",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmedia.sushi.ski%2Ffiles%2Fc9d25514-0441-451b-9767-f2d565813086.gif"
},
{
"name": "supertada@friendsyu.me",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Ffriendsyu.me%2Ffiles%2F603253784d88a20c37091e8a%2F603253784d88a20c37091e8a.gif%3Fweb"
},
{
"name": "supertada@kokonect.link",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fs3.kokonect.link%2Fkokonect%2Ffiles%2F5b58035a-7361-428c-9c07-b93c64a47ef7"
},
{
"name": "supertada@kr.akirin.xyz",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fkr.akirin.xyz%2Ffiles%2F06026776-ef40-47da-9072-cbd4d7095ec8%2F06026776-ef40-47da-9072-cbd4d7095ec8.gif"
},
{
"name": "supertada@mk.lei202.com",
"url": "https://misskey.io/proxy/image.png?url=https%3A%2F%2Fmk.lei202.com%2Ffiles%2F61a24f86acd966bdedae96e6%2F61a24f86acd966bdedae96e6%3Fweb"
}
],
"fileIds": [],
"files": [],
"replyId": null,
"renoteId": null
}
]"""
val builder = Json {
ignoreUnknownKeys = true
}
val noteDTO: List = builder.decodeFromString(jsonStr)
Assertions.assertNotNull(noteDTO)
}
@Test
fun decodeArrayTypeEmoji() {
val builder = Json {
ignoreUnknownKeys = true
}
val json1 = """
[{"name": "hoge", "url": "https://example.com"}]
""".trimIndent()
val result = builder.decodeFromString(json1)
Assertions.assertEquals(EmojisType.TypeArray(listOf(CustomEmojiNetworkDTO(name = "hoge", url = "https://example.com"))), result)
}
@Test
fun decodeObjectTypeEmoji() {
val builder = Json {
ignoreUnknownKeys = true
}
val json1 = """
{"hoge": "https://example.com", "piyo": "https://misskey.io"}
""".trimIndent()
val result = builder.decodeFromString(json1)
Assertions.assertEquals(EmojisType.TypeObject(mapOf("hoge" to "https://example.com", "piyo" to "https://misskey.io")), result)
}
@Test
fun decodeFunckingObject() {
val builder = Json {
ignoreUnknownKeys = true
}
val json1 = """
{"emojis": [{"name": "hoge", "url": "https://example.com"}]}
""".trimIndent()
val result = builder.decodeFromString(json1)
Assertions.assertEquals(TestNoteObject(EmojisType.TypeArray(
listOf(CustomEmojiNetworkDTO(name = "hoge", url = "https://example.com"))
)), result)
}
@Test
fun decodeEmptyObject() {
val builder = Json {
ignoreUnknownKeys = true
}
val json1 = """
{"emojis": {}}
""".trimIndent()
val result = builder.decodeFromString(json1)
Assertions.assertEquals(TestNoteObject(EmojisType.TypeObject(emptyMap())), result)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/logger/TestLogger.kt
================================================
package jp.panta.misskeyandroidclient.logger
import net.pantasystem.milktea.common.Logger
class TestLogger(
override val defaultTag: String
) : Logger {
override fun debug(msg: String, tag: String, e: Throwable?) {
println("debug:$tag:$msg, error:$e")
}
override fun debug(tag: String, e: Throwable?, message: () -> String) {
println("debug:$tag:${message()}, error:$e")
}
override fun error(msg: String, e: Throwable?, tag: String) {
println("error:$tag:$msg, error:$e")
}
override fun info(msg: String, tag: String, e: Throwable?) {
println("info:$tag:$msg, error:$e")
}
override fun warning(msg: String, tag: String, e: Throwable?) {
println("warning:$tag:$msg, error:$e")
}
class Factory : Logger.Factory{
override fun create(tag: String): Logger {
return TestLogger(tag)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/AccountInstanceTypeConverterTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account
import net.pantasystem.milktea.data.infrastructure.account.db.AccountInstanceTypeConverter
import net.pantasystem.milktea.model.account.Account
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class AccountInstanceTypeConverterTest {
@Test
fun convertFromEnum() {
val converter = AccountInstanceTypeConverter()
assertEquals("misskey", converter.convert(Account.InstanceType.MISSKEY))
assertEquals("mastodon", converter.convert(Account.InstanceType.MASTODON))
}
@Test
fun convertFromString() {
val converter = AccountInstanceTypeConverter()
assertEquals(Account.InstanceType.MASTODON, converter.convert("mastodon"))
assertEquals(Account.InstanceType.MISSKEY, converter.convert("misskey"))
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/AccountStateTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account
import net.pantasystem.milktea.app_store.account.AccountState
import net.pantasystem.milktea.model.account.Account
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
class AccountStateTest {
@Test
fun getCurrentAccount() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
assertEquals(1L, accountState.currentAccount?.accountId)
val changedAccountState = accountState.copy(currentAccountId = 2)
assertEquals(2L, changedAccountState.currentAccount?.accountId)
}
@Test
fun getAccountWhenInvalidCurrentAccountId() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1000L
)
assertEquals(accountState.accounts.first(), accountState.currentAccount)
}
@Test
fun isUnauthorized() {
var accountState = AccountState()
assertFalse(accountState.isUnauthorized)
accountState = accountState.copy(isLoading = false)
assertTrue(accountState.isUnauthorized)
}
@Test
fun isUnauthorizedWhenHasAccount() {
var accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
assertFalse(accountState.isUnauthorized)
accountState = accountState.copy(isLoading = false)
assertFalse(accountState.isUnauthorized)
}
@Test
fun hasAccount() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
assertTrue(accountState.hasAccount(accountState.accounts.first()))
assertFalse(
accountState.hasAccount(
Account(
"id:100",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = 1000L)
)
)
}
@Test
fun add() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
val addedState = accountState.add(
Account(
"id:10",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = 100L)
)
assertEquals(100L, addedState.accounts.last().accountId)
}
@Test
fun addWhenUnauthorized() {
val state = AccountState(isLoading = false)
assertTrue(state.isUnauthorized)
val added = state.add(
Account(
"id:10",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = 100L)
)
assertFalse(added.isUnauthorized)
assertEquals(100L, added.accounts.first().accountId)
assertEquals(100L, added.currentAccountId)
}
@Test
fun addWhenAdded() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
val updated = accountState.add(accountState.accounts.first())
assertEquals(accountState.accounts.size, updated.accounts.size)
assertEquals(accountState.accounts, updated.accounts)
}
@Test
fun delete() {
val accountState = AccountState(
isLoading = false,
accounts = (1..4).map {
Account(
"id:$it",
"host",
"name",
Account.InstanceType.MISSKEY,
""
).copy(accountId = it.toLong())
},
currentAccountId = 1L
)
val deleted = accountState.delete(accountState.accounts.first().accountId)
assertArrayEquals(
(2L..4L).toList().toLongArray(),
deleted.accounts.map { it.accountId }.toLongArray()
)
assertNotEquals(deleted.currentAccountId, 1L)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/AccountTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account
import net.pantasystem.milktea.model.account.Account
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class AccountTest {
@Test
fun testGetInstanceDomainWhenHttps() {
val account = Account(
instanceDomain = "https://example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("example.com", account.getHost())
}
@Test
fun testGetInstanceDomainWhenHttp() {
val account = Account(
instanceDomain = "http://example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("example.com", account.getHost())
}
@Test
fun testGetInstanceDomainWhenSchemaLess() {
val account = Account(
instanceDomain = "example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("example.com", account.getHost())
}
@Test
fun getNormalizedInstanceDomain_GiveNormal() {
val account = Account(
instanceDomain = "https://example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveHasBackSlash() {
val account = Account(
instanceDomain = "https://example.com/",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveHasPortNumber() {
val account = Account(
instanceDomain = "https://example.com:8080/",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://example.com:8080", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveSchemaLess() {
val account = Account(
instanceDomain = "example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveHasHyphen() {
val account = Account(
instanceDomain = "https://test-example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://test-example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveHasUnderScore() {
val account = Account(
instanceDomain = "https://test_example.com",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://test_example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_ManyBackSlash() {
val account = Account(
instanceDomain = "https://////////////////////test_example.com ",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://test_example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_HasWww() {
val account = Account(
instanceDomain = "https://www.example.com ",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://www.example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveSchemaLess2() {
val account = Account(
instanceDomain = "//www.example.com ",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://www.example.com", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveIllegalFormat() {
val account = Account(
instanceDomain = "http://",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("http://", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveIpAddress() {
val account = Account(
instanceDomain = "http://192.168.0.1",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("http://192.168.0.1", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveIpV6Address() {
val account = Account(
instanceDomain = "http://[2001:db8:85a3::8a2e:370:7334]",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals(
"http://[2001:db8:85a3::8a2e:370:7334]",
account.normalizedInstanceUri
)
}
@Test
fun getNormalizedInstanceDomain_OtherProtocol() {
val account = Account(
instanceDomain = "ftp://[2001:db8:85a3::8a2e:370:7334]",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals(
"ftp://[2001:db8:85a3::8a2e:370:7334]",
account.normalizedInstanceUri
)
}
@Test
fun getNormalizedInstanceDomain_GiveJapaneseUrl() {
val account = Account(
instanceDomain = "https:///みすきー.com:8080/",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://みすきー.com:8080", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveIllegalPattern() {
val account = Account(
instanceDomain = "https:::::::::///////みすきー.com:8080////////",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://みすきー.com:8080", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveAcct() {
val account = Account(
instanceDomain = "https://@Panta@misskey.io",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://misskey.io", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveAcctAndIllegalHost() {
val account = Account(
instanceDomain = "https://@Panta@MisSkey.io",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://misskey.io", account.normalizedInstanceUri)
}
@Test
fun getNormalizedInstanceDomain_GiveAcctCase2() {
val account = Account(
instanceDomain = "https://@artyom24@misskey.io",
userName = "",
token = "",
remoteId = "remoteId",
instanceType = Account.InstanceType.MISSKEY
)
Assertions.assertEquals("https://misskey.io", account.normalizedInstanceUri)
}
@Test
fun getGetHost_GiveSubdomainCase1() {
val account = Account(
remoteId = "",
instanceDomain = "https://mk.iaia.moe",
userName = "",
instanceType = Account.InstanceType.MISSKEY,
token = ""
)
Assertions.assertEquals("mk.iaia.moe", account.getHost())
}
@Test
fun getAcct() {
val account = Account(
remoteId = "",
instanceDomain = "https://calc.panta.systems",
userName = "Panta",
instanceType = Account.InstanceType.MISSKEY,
token = ""
)
val actual = account.getAcct()
Assertions.assertEquals("@Panta@calc.panta.systems", actual)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/MakeDefaultPagesUseCaseTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account
import kotlinx.coroutines.test.runTest
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.account.MakeDefaultPagesUseCase
import net.pantasystem.milktea.model.account.PageDefaultStringsJp
import net.pantasystem.milktea.model.account.page.PageType
import net.pantasystem.milktea.model.account.page.Pageable
import net.pantasystem.milktea.model.instance.Meta
import net.pantasystem.milktea.model.nodeinfo.NodeInfo
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
class MakeDefaultPagesUseCaseTest {
@Test
fun disableGlobalTimeline() = runTest {
val account = Account(
"remoteId",
"https://misskey.io",
"",
instanceType = Account.InstanceType.MISSKEY,
"",
)
val meta = Meta(
"",
disableGlobalTimeline = true,
disableLocalTimeline = false,
)
val nodeInfo = NodeInfo(
host = "", version = "", software = NodeInfo.Software(
name = "misskey",
version = ""
)
)
val makeDefaultPagesUseCase = MakeDefaultPagesUseCase(
PageDefaultStringsJp(),
mock() {
on {
get(any())
} doReturn nodeInfo
onBlocking {
find(any())
} doReturn Result.success(nodeInfo)
},
mock() {
onBlocking {
find(any())
} doReturn Result.success(meta)
},
)
val pages = makeDefaultPagesUseCase(account)
assertEquals(3, pages.size)
val types = pages.map {
it.pageParams.type
}.sorted()
assertEquals(listOf(PageType.SOCIAL, PageType.SOCIAL, PageType.HOME).sorted(), types)
assertEquals(
listOf(
Pageable.HomeTimeline(),
Pageable.HybridTimeline(),
Pageable.HybridTimeline(withFiles = true)
),
pages.map {
it.pageable()
}
)
}
@Test
fun disableLocalTimeline() = runTest {
val account = Account(
"remoteId",
"https://misskey.io",
"",
instanceType = Account.InstanceType.MISSKEY,
"",
)
val meta = Meta(
"",
disableGlobalTimeline = false,
disableLocalTimeline = true,
)
val nodeInfo = NodeInfo(
host = "", version = "", software = NodeInfo.Software(
name = "misskey",
version = ""
)
)
val makeDefaultPagesUseCase = MakeDefaultPagesUseCase(
PageDefaultStringsJp(),
mock() {
on {
get(any())
} doReturn nodeInfo
onBlocking {
find(any())
} doReturn Result.success(nodeInfo)
},
mock() {
onBlocking {
find(any())
} doReturn Result.success(meta)
},
)
val pages = makeDefaultPagesUseCase(account)
assertEquals(3, pages.size)
val types = pages.map {
it.pageParams.type
}.sorted()
assertEquals(listOf(PageType.GLOBAL, PageType.HOME, PageType.HOME).sorted(), types)
assertEquals(
listOf(
Pageable.HomeTimeline(),
Pageable.HomeTimeline(withFiles = true),
Pageable.GlobalTimeline()
),
pages.map {
it.pageable()
}
)
}
@Test
fun onlyEnableHomeTimeline() = runTest {
val account = Account(
"remoteId",
"https://misskey.io",
"",
instanceType = Account.InstanceType.MISSKEY,
"",
)
val meta = Meta(
"",
disableGlobalTimeline = true,
disableLocalTimeline = true,
)
val nodeInfo = NodeInfo(
host = "", version = "", software = NodeInfo.Software(
name = "misskey",
version = ""
)
)
val makeDefaultPagesUseCase = MakeDefaultPagesUseCase(
PageDefaultStringsJp(),
mock() {
on {
get(any())
} doReturn nodeInfo
onBlocking {
find(any())
} doReturn Result.success(nodeInfo)
},
mock() {
onBlocking {
find(any())
} doReturn Result.success(meta)
},
)
val pages = makeDefaultPagesUseCase(account)
assertEquals(2, pages.size)
val types = pages.map {
it.pageParams.type
}.sorted()
assertEquals(listOf(PageType.HOME, PageType.HOME), types)
assertEquals(
listOf(Pageable.HomeTimeline(), Pageable.HomeTimeline(withFiles = true)),
pages.map {
it.pageable()
}
)
}
@Test
fun enabledAll() = runTest {
val meta = Meta(
"",
disableGlobalTimeline = false,
disableLocalTimeline = false,
)
val account = Account(
"remoteId",
"https://misskey.io",
"",
instanceType = Account.InstanceType.MISSKEY,
"",
)
val nodeInfo = NodeInfo(
host = "", version = "", software = NodeInfo.Software(
name = "misskey",
version = ""
)
)
val makeDefaultPagesUseCase = MakeDefaultPagesUseCase(
PageDefaultStringsJp(),
mock() {
on {
get(any())
} doReturn nodeInfo
onBlocking {
find(any())
} doReturn Result.success(nodeInfo)
},
mock() {
onBlocking {
find(any())
} doReturn Result.success(meta)
},
)
val pages = makeDefaultPagesUseCase(account)
assertEquals(4, pages.size)
val types = pages.map {
it.pageParams.type
}.sorted()
assertEquals(
listOf(
PageType.HOME,
PageType.SOCIAL,
PageType.GLOBAL,
PageType.SOCIAL
).sorted(), types
)
assertEquals(
listOf(
Pageable.HomeTimeline(),
Pageable.HybridTimeline(),
Pageable.HybridTimeline(withFiles = true),
Pageable.GlobalTimeline()
),
pages.map {
it.pageable()
}
)
}
@Test
fun weightIncrementedByOrder() = runTest {
val meta = Meta(
"",
disableGlobalTimeline = false,
disableLocalTimeline = false,
)
val account = Account(
"remoteId",
"https://misskey.io",
"",
instanceType = Account.InstanceType.MISSKEY,
"",
)
val nodeInfo = NodeInfo(
host = "", version = "", software = NodeInfo.Software(
name = "misskey",
version = ""
)
)
val makeDefaultPagesUseCase = MakeDefaultPagesUseCase(
PageDefaultStringsJp(),
mock() {
on {
get(any())
} doReturn nodeInfo
onBlocking {
find(any())
} doReturn Result.success(nodeInfo)
},
mock() {
onBlocking {
find(any())
} doReturn Result.success(meta)
},
)
val pages = makeDefaultPagesUseCase(account)
pages.forEachIndexed { index, page ->
assertEquals(index, page.weight)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/TestAccountRepository.kt
================================================
package jp.panta.misskeyandroidclient.model.account
import net.pantasystem.milktea.common.runCancellableCatching
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.account.AccountNotFoundException
import net.pantasystem.milktea.model.account.AccountRepository
class TestAccountRepository : AccountRepository {
val accounts = mutableMapOf(
1L to Account(
"remote1",
"test.misskey.jp",
"test1",
"token",
emptyList(),
Account.InstanceType.MISSKEY,
1
),
2L to Account(
"remote2",
"test.misskey.jp",
"test2",
"token",
emptyList(),
Account.InstanceType.MISSKEY,
2
),
3L to Account(
"remote3",
"test.misskey.jp",
"test1",
"token",
emptyList(),
Account.InstanceType.MISSKEY,
3
)
)
private var currentAccountId = 1L
override suspend fun add(account: Account, isUpdatePages: Boolean): Result {
val ac = account.copy(
accountId = accounts.size.toLong()
)
accounts[accounts.size.toLong()] = ac
return Result.success(ac)
}
override fun addEventListener(listener: AccountRepository.Listener) {
}
override fun removeEventListener(listener: AccountRepository.Listener) {
}
override suspend fun delete(account: Account) {
accounts.remove(account.accountId)
}
override suspend fun findAll(): Result> {
return runCancellableCatching {
accounts.values.toList()
}
}
override suspend fun get(accountId: Long): Result {
return runCancellableCatching {
accounts[accountId]?: throw AccountNotFoundException()
}
}
override suspend fun getCurrentAccount(): Result {
return get(currentAccountId)
}
override suspend fun setCurrentAccount(account: Account): Result {
currentAccountId = account.accountId
return Result.success(account)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/account/page/PageableChannelTimelineTest.kt
================================================
package jp.panta.misskeyandroidclient.model.account.page
import net.pantasystem.milktea.data.infrastructure.note.toNoteRequest
import net.pantasystem.milktea.model.account.page.PageType
import net.pantasystem.milktea.model.account.page.Pageable
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
class PageableChannelTimelineTest {
@Test
fun toParams() {
val pageable = Pageable.ChannelTimeline(channelId = "channelId")
assertNotNull(pageable.toParams().channelId)
assertEquals("channelId", pageable.toParams().channelId)
assertEquals(PageType.CHANNEL_TIMELINE, pageable.toParams().type)
}
@Test
fun makeNoteRequest() {
val pageable = Pageable.ChannelTimeline(channelId = "channelId")
val request = pageable.toParams().toNoteRequest("test")
assertNotNull(request.channelId)
assertEquals("channelId", request.channelId)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/api/GetUsersTest.kt
================================================
package jp.panta.misskeyandroidclient.model.api
class GetUsersTest {
// private lateinit var misskeyAPI: MisskeyAPI
// @Before
// fun setup(){
// misskeyAPI = MisskeyAPIServiceBuilder.build("https://misskey.m544.net", Version("v10"))
// }
//
// @Test
// suspend fun ascFollower(){
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.LOCAL.origin,
// sort = RequestUser.Sort().follower().asc(),
// state = RequestUser.State.ALIVE.state
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
//
// })
// Assert.assertNotEquals(list, null)
// }
//
// @Test
// suspend fun ascUpdatedAt(){
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.LOCAL.origin,
// sort = RequestUser.Sort().updatedAt().asc()
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
//
// })
// Assert.assertNotEquals(list, null)
// }
//
// @Test
// suspend fun ascNewUser(){
//
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.LOCAL.origin,
// sort = RequestUser.Sort().createdAt().asc(),
// state = RequestUser.State.ALIVE.state
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
//
// })
// Assert.assertNotEquals(list, null)
// }
//
// @Test
// suspend fun remoteAscFollower(){
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.REMOTE.origin,
// sort = RequestUser.Sort().follower().asc(),
// state = RequestUser.State.ALIVE.state
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
//
// })
// Assert.assertNotEquals(list, null)
// }
//
// @Test
// suspend fun remoteAscUpdatedAt(){
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.COMBINED.origin,
// sort = RequestUser.Sort().updatedAt().asc(),
// state = RequestUser.State.ALIVE.state
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
//
// })
// Assert.assertNotEquals(list, null)
// }
//
// @Test
// suspend fun remoteNewUsers(){
// val res = misskeyAPI.getUsers(
// RequestUser(
// null,
// origin = RequestUser.Origin.COMBINED.origin,
// sort = RequestUser.Sort().createdAt().asc()
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
// val list = res.body()
// println(list?.map{
// it.displayName + "\n"
// })
// Assert.assertNotEquals(list, null)
// }
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/api/HashTagListTest.kt
================================================
package jp.panta.misskeyandroidclient.model.api
class HashTagListTest {
// @Test
// suspend fun testM544(){
// val api = MisskeyAPIServiceBuilder.build("https://misskey.m544.net", Version("v10"))
// val res = api.getHashTagList(
// RequestHashTagList(
// null,
// sort = RequestHashTagList.Sort().attachedLocalUsers().asc()
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
//
// val list = res.body()
// println(list)
// Assert.assertNotEquals(list, null)
//
//
// }
//
// @Test
// suspend fun testV11(){
// val api = MisskeyAPIServiceBuilder.build("https://misskey.dev", Version("v11"))
// val res = api.getHashTagList(
// RequestHashTagList(
// null,
// sort = RequestHashTagList.Sort().attachedLocalUsers().asc()
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
//
// val list = res.body()
// println(list)
// Assert.assertNotEquals(list, null)
//
// }
//
// @Test
// suspend fun testV12(){
// val api = MisskeyAPIServiceBuilder.build("https://misskey.io", Version("v12"))
// val res = api.getHashTagList(
// RequestHashTagList(
// null,
// sort = RequestHashTagList.Sort().attachedLocalUsers().asc()
// )
// )
//
// Assert.assertEquals(true, res.code() in 200 until 300)
//
// val list = res.body()
// println(list)
// Assert.assertNotEquals(list, null)
// }
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/api/VersionTest.kt
================================================
package jp.panta.misskeyandroidclient.model.api
import net.pantasystem.milktea.model.instance.Version
import org.junit.jupiter.api.Test
class VersionTest{
@Test
fun comparisonVersionTest(){
val asSmallVersion = Version("11.45.14.30")
val asLargeVersion = Version("11.46.18")
assert(asSmallVersion < asLargeVersion)
}
@Test
fun equalSizeVersionTest(){
val version1 = Version("11.45.14")
val version2 = Version("11.45.14")
assert(version1 == version2)
}
@Test
fun rangeTest(){
val version = Version("12.00.1")
assert(version > Version("12") && version < Version("13"))
assert(version.isUntilRange(Version("12"), Version("13")))
}
@Test
fun calendarVersionTest() {
val version = Version("2023.8.0")
assert(version > Version("13.14.2"))
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/channel/ChannelStateTest.kt
================================================
package jp.panta.misskeyandroidclient.model.channel
import kotlinx.datetime.Clock
import net.pantasystem.milktea.model.channel.Channel
import net.pantasystem.milktea.model.channel.ChannelState
import net.pantasystem.milktea.model.user.User
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
class ChannelStateTest {
@Test
fun add() {
var state = ChannelState(emptyMap())
val channel = generateChannel(Channel.Id(0, "id"), "name")
state = state.add(channel)
assertEquals(1, state.channels.size)
}
@Test
fun addAll() {
var state = ChannelState(
(0 until 10).associate {
Channel.Id(0, "id$it") to generateChannel(Channel.Id(0, "id$it"), it.toString())
}
)
val channels = (0 until 10).map {
generateChannel(Channel.Id(0, "id-$it"), it.toString())
}
state = state.addAll(channels)
assertEquals(20, state.channels.size)
}
@Test
fun remove() {
var state = ChannelState(
(0 until 10).associate {
Channel.Id(0, "id$it") to generateChannel(Channel.Id(0, "id$it"), it.toString())
}
)
assertNotNull(state.get(Channel.Id(0, "id0")))
state = state.remove(Channel.Id(0, "id0"))
assertNull(state.get(Channel.Id(0, "id0")))
}
@Test
fun get() {
var state = ChannelState(emptyMap())
val channel = generateChannel(Channel.Id(0, "id"), "name")
state = state.add(channel)
state = state.add(generateChannel(Channel.Id(0, "id2"), "name"))
assertEquals(channel, state.get(channel.id))
}
@Test
fun getIn() {
val state = ChannelState(
(0 until 10).associate {
Channel.Id(0, "id$it") to generateChannel(Channel.Id(0, "id$it"), it.toString())
}
)
val ids = listOf(
Channel.Id(0, "id0"),
Channel.Id(0, "id2")
)
val list = state.getIn(ids)
assertEquals(2, list.size)
assertTrue(list.any { it.id == ids[0] })
assertTrue(list.any { it.id == ids[1] })
}
private fun generateChannel(id: Channel.Id, name: String): Channel {
return Channel(
id = id,
name = name,
description = null,
bannerUrl = null,
createdAt = Clock.System.now(),
hasUnreadNote = null,
isFollowing = null,
lastNotedAt = null,
notesCount = 0,
usersCount = 0,
userId = User.Id(id.accountId, "userId"),
allowRenoteToExternal = true,
)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/file/AppFileTest.kt
================================================
package jp.panta.misskeyandroidclient.model.file
import net.pantasystem.milktea.model.file.AppFile
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
class AppFileTest {
@Test
fun isAttributeSame() {
val file1 = AppFile.Local("test", "/test/test3", "image/jpeg", null, false, null, 0, null)
val file2 = file1.copy()
assertTrue(file1.isAttributeSame(file2))
val file3 = file1.copy(name = "test1")
assertFalse(file3.isAttributeSame(file1))
assertFalse(file1.copy(path = "/test/test").isAttributeSame(file1))
assertFalse(file1.copy(type = "video/mp4").isAttributeSame(file1))
assertTrue(file1.copy(isSensitive = true).isAttributeSame(file1))
assertTrue(file1.copy(folderId = "hoge").isAttributeSame(file1))
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/instance/MetaCacheTest.kt
================================================
package jp.panta.misskeyandroidclient.model.instance
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.data.infrastructure.instance.MetaCache
import net.pantasystem.milktea.model.instance.Meta
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Assertions.assertNull
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class MetaCacheTest {
lateinit var metaCache: MetaCache
@BeforeEach
fun setup() {
metaCache = MetaCache()
}
@Test
fun put() {
runBlocking {
metaCache.put("https://misskey.io", Meta("https://misskey.io"))
assertNotNull(metaCache.get("https://misskey.io"))
}
}
@Test
fun get() {
assertNull(metaCache.get("https://misskey.io"))
runBlocking {
metaCache.put("https://misskey.io", Meta("https://misskey.io"))
}
assertNotNull(metaCache.get("https://misskey.io"))
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/notes/impl/InMemoryNoteDataSourceTest.kt
================================================
package jp.panta.misskeyandroidclient.model.notes.impl
import jp.panta.misskeyandroidclient.logger.TestLogger
import kotlinx.coroutines.delay
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.data.infrastructure.MemoryCacheCleaner
import net.pantasystem.milktea.data.infrastructure.note.impl.InMemoryNoteDataSource
import net.pantasystem.milktea.model.AddResult
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.note.make
import net.pantasystem.milktea.model.user.User
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class InMemoryNoteDataSourceTest {
private lateinit var loggerFactory: Logger.Factory
private lateinit var account: Account
@BeforeEach
fun setUp() {
loggerFactory = TestLogger.Factory()
account = Account(
remoteId = "piyo",
instanceDomain = "",
token = "",
userName = "piyoName",
instanceType = Account.InstanceType.MISSKEY
)
}
@Test
fun testAdd() {
val noteDataSource = InMemoryNoteDataSource(MemoryCacheCleaner())
val note = Note.make(
Note.Id(0L, ""),
userId = User.Id(0L, ""),
)
runBlocking {
val result = noteDataSource.add(
note
).getOrThrow()
delay(10)
assertEquals(AddResult.Created, result)
delay(10)
assertEquals(AddResult.Updated, noteDataSource.add(note).getOrThrow())
delay(10)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/notes/impl/NoteCaptureAPIAdapterTest.kt
================================================
package jp.panta.misskeyandroidclient.model.notes.impl
import jp.panta.misskeyandroidclient.logger.TestLogger
import jp.panta.misskeyandroidclient.model.account.TestAccountRepository
import jp.panta.misskeyandroidclient.streaming.TestSocketWithAccountProviderImpl
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.api_streaming.NoteCaptureAPIImpl
import net.pantasystem.milktea.api_streaming.NoteUpdated
import net.pantasystem.milktea.common.Logger
import net.pantasystem.milktea.data.infrastructure.MemoryCacheCleaner
import net.pantasystem.milktea.data.infrastructure.note.NoteCaptureAPIWithAccountProviderImpl
import net.pantasystem.milktea.data.infrastructure.note.impl.InMemoryNoteDataSource
import net.pantasystem.milktea.model.account.AccountRepository
import net.pantasystem.milktea.model.note.Note
import net.pantasystem.milktea.model.note.NoteDataSource
import net.pantasystem.milktea.model.note.make
import net.pantasystem.milktea.model.user.User
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class NoteCaptureAPIAdapterTest {
private lateinit var loggerFactory: Logger.Factory
private lateinit var accountRepository: AccountRepository
private lateinit var noteDataSource: NoteDataSource
@BeforeEach
fun setUp() {
loggerFactory = TestLogger.Factory()
accountRepository = TestAccountRepository()
noteDataSource = InMemoryNoteDataSource(MemoryCacheCleaner())
}
@ExperimentalCoroutinesApi
@Test
fun testCapture() {
val noteCaptureAPIWithAccountProvider =
NoteCaptureAPIWithAccountProviderImpl(
TestSocketWithAccountProviderImpl(),
loggerFactory
)
// val coroutineScope = CoroutineScope(Job())
// val noteCaptureAPIAdapter = NoteCaptureAPIAdapter(
// accountRepository = accountRepository,
// noteDataSource = noteDataSource,
// noteCaptureAPIWithAccountProvider = noteCaptureAPIWithAccountProvider,
// loggerFactory,
// coroutineScope
// )
runBlocking {
val account = accountRepository.getCurrentAccount().getOrThrow()
val noteCapture = noteCaptureAPIWithAccountProvider.get(account) as NoteCaptureAPIImpl
val note = Note.make(
id = Note.Id(account.accountId, "note-1"),
userId = User.Id(account.accountId, "hoge")
)
noteDataSource.add(
note
)
var counter = 1
noteDataSource.addEventListener {
if (it.noteId == note.id) {
assertEquals(
1,
(it as NoteDataSource.Event.Updated).note.reactionCounts[0].count
)
counter++
}
}
noteCapture.onMessage(
NoteUpdated(
NoteUpdated.Body.Reacted(
id = note.id.noteId,
body = NoteUpdated.Body.Reacted.Body(
reaction = "hoge",
account.remoteId
)
)
)
)
noteCapture.onMessage(
NoteUpdated(
NoteUpdated.Body.Reacted(
id = note.id.noteId,
body = NoteUpdated.Body.Reacted.Body(
reaction = "hoge",
account.remoteId
)
)
)
)
noteCapture.onMessage(
NoteUpdated(
NoteUpdated.Body.Reacted(
id = note.id.noteId,
body = NoteUpdated.Body.Reacted.Body(
reaction = "hoge",
account.remoteId
)
)
)
)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/notes/poll/PollTest.kt
================================================
package jp.panta.misskeyandroidclient.model.notes.poll
import kotlinx.datetime.Clock
import net.pantasystem.milktea.model.note.poll.Poll
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import kotlin.time.Duration.Companion.minutes
class PollTest {
@Test
fun totalVoteCount() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = null,
multiple = false
)
Assertions.assertEquals(53, poll.totalVoteCount)
}
@Test
fun canVoteMultiplePoll() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = true
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = true
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = null,
multiple = true
)
Assertions.assertTrue(poll.canVote)
}
@Test
fun canVote() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = null,
multiple = false
)
Assertions.assertTrue(poll.canVote)
}
@Test
fun canVoteWhenVoted() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = true
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = null,
multiple = false
)
Assertions.assertFalse(poll.canVote)
}
@Test
fun canVoteWithinExpiredAt() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = Clock.System.now() + 10.minutes,
multiple = false
)
Assertions.assertTrue(poll.canVote)
}
@Test
fun canVoteWhenExpired() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 15,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 8,
text = "aaa",
isVoted = false
),
),
expiresAt = Clock.System.now() - 1.minutes,
multiple = false
)
Assertions.assertFalse(poll.canVote)
}
@Test
fun canVoteVotedAndExpired() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = false
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = true
),
),
expiresAt = Clock.System.now() - 1.minutes,
multiple = false
)
Assertions.assertFalse(poll.canVote)
}
@Test
fun canVoteAllVotedAndMultiple() {
val poll = Poll(
choices = listOf(
Poll.Choice(
index = 0,
votes = 10,
text = "aaa",
isVoted = true
),
Poll.Choice(
index = 0,
votes = 20,
text = "aaa",
isVoted = true
),
),
multiple = true,
expiresAt = null
)
Assertions.assertFalse(poll.canVote)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/reaction/impl/ReactionHistoryPaginatorImplTest.kt
================================================
package jp.panta.misskeyandroidclient.model.reaction.impl
//import net.pantasystem.milktea.api.misskey.MisskeyAPIProvider
//import net.pantasystem.milktea.data.api.misskey.RequestReactionHistoryDTO
//import jp.panta.misskeyandroidclient.logger.TestLogger
//import jp.panta.misskeyandroidclient.model.account.Account
//import jp.panta.misskeyandroidclient.model.account.TestAccountRepository
//import jp.panta.misskeyandroidclient.model.notes.Note
//import jp.panta.misskeyandroidclient.model.notes.reaction.ReactionHistory
//import jp.panta.misskeyandroidclient.model.notes.reaction.ReactionHistoryDataSource
//import jp.panta.misskeyandroidclient.model.notes.reaction.ReactionHistoryPaginator
//import jp.panta.misskeyandroidclient.model.notes.reaction.ReactionHistoryRequest
//import jp.panta.misskeyandroidclient.model.notes.reaction.impl.ReactionHistoryPaginatorImpl
//import jp.panta.misskeyandroidclient.model.users.impl.InMemoryUserDataSource
//import jp.panta.misskeyandroidclient.util.EncryptionStub
//import kotlinx.coroutines.flow.Flow
//import kotlinx.coroutines.runBlocking
//import org.junit.Assert.*
//import org.junit.Before
//import org.junit.Test
//import org.junit.runner.RunWith
//import org.junit.runners.JUnit4
//
//@RunWith(JUnit4::class)
//class ReactionHistoryPaginatorImplTest {
// private lateinit var accountRepository: TestAccountRepository
// private val misskeyAPIProvider = MisskeyAPIProvider()
// private lateinit var reactionHistoryPaginatorFactory: ReactionHistoryPaginator.Factory
//
// private lateinit var dataSource: DataSource
//
//
// class DataSource(
// var addAllListener: (list: List)-> Unit = {}
// ) : ReactionHistoryDataSource {
// override fun findAll(): Flow> {
// TODO("Not yet implemented")
// }
//
//
//
// override suspend fun add(reactionHistory: ReactionHistory) {
// }
//
// override suspend fun addAll(reactionHistories: List) {
// addAllListener.invoke(reactionHistories)
// }
//
// override suspend fun clear(noteId: Note.Id) {
// }
//
// override fun filter(noteId: Note.Id, type: String?): Flow> {
// TODO("Not yet implemented")
// }
//
// }
// @Before
// fun setUp(): Unit = runBlocking {
// accountRepository = TestAccountRepository()
// accountRepository.accounts.clear()
// dataSource = DataSource()
// reactionHistoryPaginatorFactory = ReactionHistoryPaginatorImpl.Factory(
// dataSource,
// misskeyAPIProvider,
// accountRepository,
// EncryptionStub(),
// InMemoryUserDataSource(TestLogger.Factory())
// )
// // TODO テスト後必ずTokenを削除すること
// val account = Account(
// remoteId = "",
// instanceDomain = "https://misskey.io",
// userName = "Panta",
// encryptedToken = ""
// )
// accountRepository.setCurrentAccount(accountRepository.add(account))
//
// }
//
// @Test
// fun testLoad(): Unit = runBlocking{
//
// val account = accountRepository.getCurrentAccount().getOrThrow()
// val req = ReactionHistoryRequest(Note.Id(account.accountId, "7zzafqsm9a"), null)
// val paginator = reactionHistoryPaginatorFactory.create(req)
// dataSource.addAllListener = {
// assertTrue(it.isNotEmpty())
// }
//
// paginator.next()
//
// }
//
// @Test
// fun testPaginate(): Unit = runBlocking {
// val noteId = "7zzafqsm9a"
// val account = accountRepository.getCurrentAccount().getOrThrow()
// val req = ReactionHistoryRequest(Note.Id(account.accountId, noteId), null)
// val paginator = reactionHistoryPaginatorFactory.create(req)
//
// val histories = mutableListOf()
// dataSource.addAllListener = {
// assertTrue(it.isNotEmpty())
// histories.addAll(it)
// }
//
// for(n in 0 until 5) {
// assertTrue(paginator.next())
// }
// val api = misskeyAPIProvider.get(account.instanceDomain)
// val body = api.reactions(RequestReactionHistoryDTO(i = account.getI(EncryptionStub()), noteId = noteId, limit = 5 * 20, type = null)).body()
//
// assertNotNull(body)
// val except = body!!.map {
// it.id
// }
//
// val ids = histories.map {
// it.id.reactionId
// }
// assertEquals(except, ids)
// }
//}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/users/UserTest.kt
================================================
package jp.panta.misskeyandroidclient.model.users
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.user.User
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class UserTest {
@Test
fun testGetProfileUrl() {
val user = User.Simple(
id = User.Id(0, "id"),
avatarUrl = "",
emojis = emptyList(),
host = "",
isBot = false,
isCat = false,
name = "Panta",
userName = "Panta",
nickname = null,
isSameHost = true,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
val profileUrl = user.getProfileUrl(
Account(
instanceDomain = "https://example.com",
token = "",
remoteId = "",
userName = "",
instanceType = Account.InstanceType.MISSKEY
)
)
assertEquals("https://example.com/@Panta", profileUrl)
}
@Test
fun testGetProfileUrlWhenRemoteHost() {
val user = User.Simple(
id = User.Id(0, "id"),
avatarUrl = "",
emojis = emptyList(),
host = "misskey.io",
isBot = false,
isCat = false,
name = "Panta",
userName = "Panta",
nickname = null,
isSameHost = false,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
val profileUrl = user.getProfileUrl(
Account(
instanceDomain = "https://example.com",
token = "",
remoteId = "",
userName = "",
instanceType = Account.InstanceType.MISSKEY
)
)
assertEquals("https://example.com/@Panta@misskey.io", profileUrl)
}
@Test
fun displayUserName_GiveSameHost() {
val user = User.Simple(
id = User.Id(0, "id"),
avatarUrl = "",
emojis = emptyList(),
host = "misskey.io",
isBot = false,
isCat = false,
name = "Panta",
userName = "Panta",
nickname = null,
isSameHost = true,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
assertEquals("@Panta", user.displayUserName)
}
@Test
fun displayUserName_GiveDifferentHost() {
val user = User.Simple(
id = User.Id(0, "id"),
avatarUrl = "",
emojis = emptyList(),
host = "misskey.io",
isBot = false,
isCat = false,
name = "Panta",
userName = "Panta",
nickname = null,
isSameHost = false,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
assertEquals("@Panta@misskey.io", user.displayUserName)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/users/nickname/DeleteNicknameUseCaseTest.kt
================================================
package jp.panta.misskeyandroidclient.model.users.nickname
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.data.infrastructure.MemoryCacheCleaner
import net.pantasystem.milktea.data.infrastructure.user.InMemoryUserDataSource
import net.pantasystem.milktea.data.infrastructure.user.UserNicknameRepositoryOnMemoryImpl
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.model.user.UserDataSource
import net.pantasystem.milktea.model.user.nickname.DeleteNicknameUseCase
import net.pantasystem.milktea.model.user.nickname.UserNickname
import net.pantasystem.milktea.model.user.nickname.UserNicknameRepository
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
class DeleteNicknameUseCaseTest {
private lateinit var nicknameRepository: UserNicknameRepository
private lateinit var userDataSource: UserDataSource
private lateinit var user: User.Simple
private lateinit var deleteNicknameUseCase: DeleteNicknameUseCase
private lateinit var nicknameId: UserNickname.Id
@BeforeEach
fun setUp() {
val nicknameRepository = UserNicknameRepositoryOnMemoryImpl()
this.nicknameRepository = nicknameRepository
userDataSource = InMemoryUserDataSource(MemoryCacheCleaner())
user = User.Simple(
User.Id(1, "remoteId"),
"name",
"name1",
"",
emptyList(),
null,
null,
host = "misskey.io",
nickname = null,
isSameHost = true,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
deleteNicknameUseCase = DeleteNicknameUseCase(
userDataSource = userDataSource,
userNicknameRepository = nicknameRepository
)
nicknameId = UserNickname.Id(userName = user.userName, host = "misskey.io")
}
@Test
fun deleteNickname() {
runBlocking {
val nickname = UserNickname(nicknameId, "changed name")
userDataSource.add(user.copy(nickname = nickname))
nicknameRepository.save(nickname)
assertEquals("changed name", userDataSource.get(user.id).getOrThrow().displayName)
deleteNicknameUseCase.invoke(user)
assertEquals("name1", userDataSource.get(user.id).getOrThrow().displayName)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/model/users/nickname/UpdateNicknameUseCaseTest.kt
================================================
package jp.panta.misskeyandroidclient.model.users.nickname
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.data.infrastructure.MemoryCacheCleaner
import net.pantasystem.milktea.data.infrastructure.user.InMemoryUserDataSource
import net.pantasystem.milktea.data.infrastructure.user.UserNicknameRepositoryOnMemoryImpl
import net.pantasystem.milktea.model.user.User
import net.pantasystem.milktea.model.user.nickname.UpdateNicknameUseCase
import net.pantasystem.milktea.model.user.nickname.UserNickname
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class UpdateNicknameUseCaseTest {
@Test
fun testUpdate() {
runBlocking {
val nicknameRepository = UserNicknameRepositoryOnMemoryImpl()
val userDataSource = InMemoryUserDataSource(MemoryCacheCleaner())
val updateNicknameUseCase = UpdateNicknameUseCase(
userDataSource,
nicknameRepository
)
val targetId = UserNickname.Id("name", "misskey.io")
val user = User.Simple(
User.Id(1, "remoteId"),
"name",
"",
"",
emptyList(),
null,
null,
host = "misskey.io",
nickname = null,
isSameHost = true,
instance = null,
avatarBlurhash = null,
badgeRoles = emptyList(),
)
userDataSource.add(user)
nicknameRepository.save(
UserNickname(targetId, "nickname")
)
val result = updateNicknameUseCase.invoke(user, "updated nickname")
assertEquals("updated nickname", nicknameRepository.findOne(targetId).name)
assertEquals("updated nickname", result.displayName)
assertEquals("updated nickname", userDataSource.get(user.id).getOrThrow().displayName)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/SendBodyTest.kt
================================================
package jp.panta.misskeyandroidclient.streaming
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api_streaming.Send
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
class SendBodyTest {
@Test
fun testParseMain() {
val main: Send = Send.Connect(
Send.Connect.Body(channel = Send.Connect.Type.HOME_TIMELINE, id = "hoge"))
val h = Json.encodeToString(main)
println(h)
assertTrue(true)
}
@Test
fun testDecode() {
val json = """{"type":"connect","body":{"id":"hoge","channel":"homeTimeline"}}"""
val main: Send = Json.decodeFromString(json)
println(main)
assertTrue(true)
}
@Test
fun testParseSubNote() {
val obj: Send = Send.SubscribeNote(
Send.SubscribeNote.Body("hogepiyo"))
val h = Json.encodeToString(obj)
println(h)
assertTrue(true)
}
@Test
fun testDecodeSubNote() {
val json = """{"type":"subNote","body":{"id":"hogepiyo"}}"""
val h: Send = Json.decodeFromString(json)
println(h)
assertTrue(h is Send.SubscribeNote)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/StreamingEventTest.kt
================================================
package jp.panta.misskeyandroidclient.streaming
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api_streaming.ChannelBody
import net.pantasystem.milktea.api_streaming.ChannelEvent
import net.pantasystem.milktea.api_streaming.StreamingEvent
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
class StreamingEventTest {
@Test
fun testDecodeJson() {
val response = Json {
ignoreUnknownKeys = true
}
val json = """{"type":"channel","body":{"id":"1","type":"note","body":{"id":"8ikcfyi666","createdAt":"2021-02-22T16:13:38.286Z","userId":"8gs6brks69","user":{"id":"8gs6brks69","name":"輩原にする","username":"nisuru","host":"misskey.haibala.com","avatarUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fmisskey-oj.ewr1.vultrobjects.com%2Fm%2Fwebpublic-718e33cf-0822-477d-a801-54cdcef1327d.jpg&thumbnail=1","avatarBlurhash":"yGP@6Fxa%f?a^J?GM|xbkDaK%gWY-5W=RPM|kX_NIqVrt3WBR*RlR-oe%4Myt6xWt3t8M}Rij@n}WYbJj[R.","avatarColor":null,"isCat":true,"instance":{"name":"haibaland","softwareName":"misskey","softwareVersion":"12.71.0","iconUrl":"https://misskey.haibala.com/assets/icons/192.png","faviconUrl":"https://misskey-oj.ewr1.vultrobjects.com/m/902557d0-1ca6-4568-b92a-eb6e195d0228.png","themeColor":"#86b300"},"emojis":[]},"text":null,"cw":null,"visibility":"public","renoteCount":0,"repliesCount":0,"reactions":{},"emojis":[],"fileIds":[],"files":[],"replyId":null,"renoteId":"8ikcdkmw19","uri":"https://misskey.haibala.com/notes/8ikcfyi6np/activity","renote":{"id":"8ikcdkmw19","createdAt":"2021-02-22T16:11:47.000Z","userId":"7rqb0rlaxm","user":{"id":"7rqb0rlaxm","name":"直さらだ🔞","username":"nao_salad","host":"pawoo.net","avatarUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fimg.pawoo.net%2Faccounts%2Favatars%2F000%2F186%2F181%2Foriginal%2F8a4cc93a0db29a81.png&thumbnail=1","avatarBlurhash":null,"avatarColor":null,"instance":{"name":"Pawoo","softwareName":null,"softwareVersion":null,"iconUrl":"https://pawoo.net/android-chrome-192x192.png","faviconUrl":"https://pawoo.net/favicon.ico","themeColor":"#282c37"},"emojis":[]},"text":null,"cw":null,"visibility":"public","renoteCount":2,"repliesCount":0,"reactions":{"❤":1},"emojis":[],"fileIds":["8ikcdm3p18"],"files":[{"id":"8ikcdm3p18","createdAt":"2021-02-22T16:11:48.901Z","name":"5b9c4b3fee5a3326.mp4","type":"video/mp4","md5":"064fb67a2b9add60b9c8b76673b8df02","size":0,"isSensitive":true,"blurhash":null,"properties":{},"url":"https://nos3.arkjp.net/?url=https%3A%2F%2Fimg.pawoo.net%2Fmedia_attachments%2Ffiles%2F034%2F139%2F866%2Foriginal%2F5b9c4b3fee5a3326.mp4","thumbnailUrl":"https://nos3.arkjp.net/?url=https%3A%2F%2Fimg.pawoo.net%2Fmedia_attachments%2Ffiles%2F034%2F139%2F866%2Foriginal%2F5b9c4b3fee5a3326.mp4&thumbnail=1","comment":null,"folderId":null,"folder":null,"userId":null,"user":null}],"replyId":null,"renoteId":null,"uri":"https://pawoo.net/users/nao_salad/statuses/105775779506713178","url":"https://pawoo.net/@nao_salad/105775779506713178"}}}}"""
val s: StreamingEvent = response.decodeFromString(json)
println(s)
assertTrue(true)
}
@Test
fun testDecodeNoteUpdated() {
val json = """{"type":"noteUpdated","body":{"id":"8ikbe058jm","type":"reacted","body":{"reaction":"🙌","userId":"8g0o3hyk6r"}}}"""
val s: StreamingEvent = Json.decodeFromString(json)
println(s)
assertTrue(true)
}
@Test
fun testDecodeUnreacted() {
val json = """{"type":"noteUpdated","body":{"id":"8ikbs5qq5z","type":"unreacted","body":{"reaction":"😆","userId":"7roinhytrr"}}}"""
val s: StreamingEvent = Json.decodeFromString(json)
println(s)
assertTrue(true)
}
@Test
fun testNoteDeleted() {
val json ="""{"type":"noteUpdated","body":{"id":"8ikcaxibzs","type":"deleted","body":{"deletedAt":"2021-02-22T16:09:47.568Z"}}}"""
val s: StreamingEvent = Json.decodeFromString(json)
println(s)
assertTrue(true)
}
@Test
fun testDecodePollVoteNotification() {
val j = Json {
ignoreUnknownKeys = true
}
val json = """{"type":"channel","body":{"id":"1","type":"notification","body":{"id":"8ikt10uewe","createdAt":"2021-02-22T23:57:54.950Z","type":"pollVote","isRead":false,"userId":"88wqchigvf","user":{"id":"88wqchigvf","name":"Lily","username":"Lily","host":null,"avatarUrl":"https://s3.arkjp.net/misskey/thumbnail-e833da1c-c1ca-47cc-b845-05000621341d.jpg","avatarBlurhash":"yPNI{oIn?|aK:Rxa#U00X-~DXR=zMx${'$'}+5PIAO;ozo}%goL^,xGRPi{nPoLjF-B%MwLn*sCR5R*aKnixts:a{aykCM{aKs;ofo3ozni","avatarColor":null,"emojis":[]},"note":{"id":"8iksycgnyx","createdAt":"2021-02-22T23:55:50.039Z","userId":"7roinhytrr","user":{"id":"7roinhytrr","name":"パン太","username":"Panta","host":null,"avatarUrl":"https://s3.arkjp.net/misskey/thumbnail-76a33500-270f-4acb-8b59-a033bb9e9593.jpg","avatarBlurhash":"yROpPl00AKk?9Gx]E3?^M|IVNfTJW=tRo}xuV@t7x]ofoL%2M{ENX9ozS2R*bcjFnhV[WXays.xtaeWXnhs.aeWVRkjYfkWAR*ofj?","avatarColor":null,"emojis":[]},"text":"test","cw":null,"visibility":"public","renoteCount":0,"repliesCount":0,"reactions":{},"emojis":[],"fileIds":[],"files":[],"replyId":null,"renoteId":null,"poll":{"multiple":false,"expiresAt":null,"choices":[{"text":"t1","votes":0,"isVoted":false},{"text":"t2","votes":1,"isVoted":false},{"text":"t3","votes":1,"isVoted":false}]}},"choice":1}}}"""
val s: StreamingEvent = j.decodeFromString(json)
println(s)
assertTrue(s is ChannelEvent && s.body is ChannelBody.Main.Notification)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/TestSocketImpl.kt
================================================
package jp.panta.misskeyandroidclient.streaming
import net.pantasystem.milktea.api_streaming.Socket
import net.pantasystem.milktea.api_streaming.SocketMessageEventListener
import net.pantasystem.milktea.api_streaming.SocketStateEventListener
class TestSocketImpl : Socket {
private var state: Socket.State = Socket.State.NeverConnected
private val messageListeners = mutableSetOf()
private val stateEventListeners = mutableSetOf()
override fun connect(): Boolean {
state = Socket.State.Connected
return true
}
override fun disconnect(): Boolean {
state = Socket.State.Closed(1001, "")
return true
}
override fun send(msg: String, isAutoConnect: Boolean): Boolean {
println("send: $msg")
return true
}
override fun state(): Socket.State {
return state
}
override fun addMessageEventListener(autoConnect: Boolean, listener: SocketMessageEventListener) {
messageListeners.add(listener)
}
override fun addStateEventListener(listener: SocketStateEventListener) {
stateEventListeners.add(listener)
}
override suspend fun blockingConnect(): Boolean {
return connect()
}
override fun removeMessageEventListener(listener: SocketMessageEventListener) {
messageListeners.remove(listener)
}
override fun removeStateEventListener(listener: SocketStateEventListener) {
stateEventListeners.remove(listener)
}
override fun onNetworkActive() {
throw Exception("未実装")
}
override fun onNetworkInActive() {
throw Exception("未実装")
}
override fun reconnect() {
throw Exception("未実装")
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/TestSocketWithAccountProviderImpl.kt
================================================
package jp.panta.misskeyandroidclient.streaming
import net.pantasystem.milktea.api_streaming.Socket
import net.pantasystem.milktea.data.streaming.SocketWithAccountProvider
import net.pantasystem.milktea.model.account.Account
class TestSocketWithAccountProviderImpl : SocketWithAccountProvider {
override fun get(account: Account): Socket {
return TestSocketImpl()
}
override fun get(accountId: Long): Socket {
return TestSocketImpl()
}
override fun all(): List {
return listOf(TestSocketImpl())
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/channel/ChannelAPITest.kt
================================================
package jp.panta.misskeyandroidclient.streaming.channel
import jp.panta.misskeyandroidclient.logger.TestLogger
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.api.misskey.DefaultOkHttpClientProvider
import net.pantasystem.milktea.api_streaming.ChannelBody
import net.pantasystem.milktea.api_streaming.Socket
import net.pantasystem.milktea.api_streaming.channel.ChannelAPI
import net.pantasystem.milktea.api_streaming.network.SocketImpl
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine
class ChannelAPITest {
@ExperimentalCoroutinesApi
@Test
fun connect(): Unit = runBlocking {
val wssURL = "wss://misskey.io/streaming"
val logger = TestLogger.Factory()
val socket =
SocketImpl(wssURL, {false}, logger, DefaultOkHttpClientProvider())
socket.blockingConnect()
var count = 0
launch {
ChannelAPI(socket, logger)
.connect(ChannelAPI.Type.Global).collect {
println(it)
assertTrue(it is ChannelBody.ReceiveNote)
count ++
if(count > 5) {
cancel()
}
}
}.join()
}
@ExperimentalCoroutinesApi
@Test
fun testDisconnect() {
val wssURL = "wss://misskey.io/streaming"
val logger = TestLogger.Factory()
val socket =
SocketImpl(wssURL, {false}, logger, DefaultOkHttpClientProvider())
val channelAPI = ChannelAPI(socket, logger)
runBlocking {
val job1 = launch {
channelAPI.connect(ChannelAPI.Type.Main).collect ()
}
val job2 = launch {
channelAPI.connect(ChannelAPI.Type.Global).collect ()
}
val job3 = launch {
channelAPI.connect(ChannelAPI.Type.Global).collect ()
}
val closedRes: Socket.State = suspendCoroutine { continuation ->
var flag = true
socket.addStateEventListener { ev ->
if(flag) {
if(ev is Socket.State.Connected) {
assertEquals(2, channelAPI.count())
job1.cancel()
job2.cancel()
job3.cancel()
}
if(ev is Socket.State.Closed) {
flag = false
continuation.resume(ev)
}
}
}
}
assertTrue(closedRes is Socket.State.Closed)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/streaming/network/SocketImplTest.kt
================================================
package jp.panta.misskeyandroidclient.streaming.network
import jp.panta.misskeyandroidclient.logger.TestLogger
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import net.pantasystem.milktea.api.misskey.DefaultOkHttpClientProvider
import net.pantasystem.milktea.api_streaming.Socket
import net.pantasystem.milktea.api_streaming.StreamingEvent
import net.pantasystem.milktea.api_streaming.network.SocketImpl
import net.pantasystem.milktea.data.infrastructure.streaming.stateEvent
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
class SocketImplTest {
@Test
fun testBlockingConnect() {
val wssURL = "wss://misskey.io/streaming"
val logger = TestLogger.Factory()
val socket = SocketImpl(wssURL, {false} ,logger, DefaultOkHttpClientProvider())
socket.addMessageEventListener(false) {
false
}
runBlocking {
socket.blockingConnect()
assertEquals(socket.state(), Socket.State.Connected)
}
}
@ExperimentalCoroutinesApi
@Test
fun testAddMessageListener() {
val wssURL = "wss://misskey.io/streaming"
val logger = TestLogger.Factory()
val socket = SocketImpl(wssURL, {false}, logger, DefaultOkHttpClientProvider())
runBlocking {
socket.addMessageEventListener {
false
}
val res = socket.stateEvent().first {
it == Socket.State.Connected
}
assertEquals(Socket.State.Connected, res)
}
}
@ExperimentalCoroutinesApi
@Test
fun testRemoveMessageListener() {
val wssURL = "wss://misskey.io/streaming"
val logger = TestLogger.Factory()
val socket: Socket =
SocketImpl(wssURL, {false}, logger, DefaultOkHttpClientProvider())
runBlocking {
val listener: (StreamingEvent)-> Boolean = {
false
}
socket.addMessageEventListener(true, listener)
val res: Socket.State = socket.stateEvent().first {
it == Socket.State.Connected
}
assertTrue(res is Socket.State.Connected)
socket.removeMessageEventListener(listener)
val closedRes: Socket.State = socket.stateEvent().first {
it is Socket.State.Closed
}
assertTrue(closedRes is Socket.State.Closed)
}
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/ui/users/viewmodel/search/SearchUserTest.kt
================================================
package jp.panta.misskeyandroidclient.ui.users.viewmodel.search
import net.pantasystem.milktea.user.search.SearchUser
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class SearchUserTest {
@Test
fun isUserName() {
val searchUser = SearchUser("harunon", null)
Assertions.assertTrue(searchUser.isUserName)
Assertions.assertTrue(SearchUser("nocturne_db", null).isUserName)
}
@Test
fun isUserNameGiveNotUserNameCases() {
val searchUser = SearchUser("はるのん", null)
Assertions.assertFalse(searchUser.isUserName)
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/util/EncryptionStub.kt
================================================
package jp.panta.misskeyandroidclient.util
import net.pantasystem.milktea.common.Encryption
class EncryptionStub : Encryption {
override fun decrypt(alias: String, encryptedText: String): String {
return encryptedText
}
override fun encrypt(alias: String, plainText: String): String {
return plainText
}
}
================================================
FILE: app/src/test/java/jp/panta/misskeyandroidclient/util/StringIndexTest.kt
================================================
package jp.panta.misskeyandroidclient.util
import org.junit.jupiter.api.Test
class StringIndexTest {
@Test
fun substringTest(){
val text = "0123456789"
println(text.substring(0, 9))
println(text.substring(0, text.length))
}
@Test
fun whileText(){
var counter = 0
while(counter < 10){
println(counter)
counter++
}
println("終了後:$counter")
}
@Test
fun emojiCharTest(){
val text = "☺️"
println(text.length)
text.forEach{
println(it)
}
}
}
================================================
FILE: app/src/test/java/net/pantasystem/milktea/data/infrastructure/emoji/CustomEmojiInserterTest.kt
================================================
package net.pantasystem.milktea.data.infrastructure.emoji
import kotlinx.coroutines.test.runTest
import net.pantasystem.milktea.model.emoji.CustomEmoji
import net.pantasystem.milktea.model.emoji.EmojiWithAlias
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.verifyBlocking
class CustomEmojiInserterTest {
@Test
fun convertAndReplaceAll() = runTest {
val dao = mock() {
onBlocking {
insertAll(any())
} doReturn listOf(1L, 2L, 3L)
onBlocking {
deleteByHost(any())
} doReturn Unit
onBlocking {
insertAliases(
any(),
)
} doReturn listOf(1L, 2L, 3L)
}
val inserter = CustomEmojiInserter(
dao
)
val remoteEmojis = listOf(
EmojiWithAlias(
emoji = CustomEmoji(
name = "name",
),
aliases = listOf(
"alias1",
"alias2",
)
),
EmojiWithAlias(
emoji = CustomEmoji(
name = "name1",
),
aliases = listOf(
"alias3",
"alias4",
)
),
EmojiWithAlias(
emoji = CustomEmoji(
name = "name2",
),
aliases = listOf(
"alias5",
"alias6",
)
)
)
val result = inserter.convertAndReplaceAll("host", remoteEmojis)
verifyBlocking(dao) {
deleteByHost("host")
insertAll(
remoteEmojis.map {
CustomEmojiRecord.from(
it.emoji,
"host",
)
}
)
insertAliases(
listOf(
CustomEmojiAliasRecord(
"alias1",
1L,
),
CustomEmojiAliasRecord(
"alias2",
1L,
),
CustomEmojiAliasRecord(
"alias3",
2L,
),
CustomEmojiAliasRecord(
"alias4",
2L,
),
CustomEmojiAliasRecord(
"alias5",
3L,
),
CustomEmojiAliasRecord(
"alias6",
3L,
),
)
)
}
Assertions.assertEquals(
remoteEmojis.mapIndexed { index, it ->
CustomEmojiRecord.from(
it.emoji,
"host",
id = index + 1L,
)
},
result,
)
}
@Test
fun replaceAll() = runTest {
val dao = mock() {
onBlocking {
insertAll(any())
} doReturn listOf(1L, 2L, 3L)
onBlocking {
deleteByHost(any())
} doReturn Unit
}
val inserter = CustomEmojiInserter(
dao
)
val records = listOf(
CustomEmojiRecord(
name = "name",
emojiHost = "host",
url = "url",
uri = "uri",
type = "type",
serverId = "serverId",
category = "category",
id = 0L,
),
CustomEmojiRecord(
name = "name1",
emojiHost = "host",
url = "url",
uri = "uri",
type = "type",
serverId = "serverId",
category = "category",
id = 0L,
),
CustomEmojiRecord(
name = "name2",
emojiHost = "host",
url = "url",
uri = "uri",
type = "type",
serverId = "serverId",
category = "category",
id = 0L,
)
)
inserter.replaceAll(
"host",
records,
)
verifyBlocking(dao) {
deleteByHost("host")
insertAll(records)
}
}
}
================================================
FILE: app/src/test/java/net/pantasystem/milktea/data/infrastructure/note/draft/db/DraftNoteDTOTest.kt
================================================
import net.pantasystem.milktea.data.infrastructure.note.draft.db.DraftNoteDTO
import net.pantasystem.milktea.data.infrastructure.note.draft.db.DraftPollDTO
import net.pantasystem.milktea.model.channel.Channel
import net.pantasystem.milktea.model.note.draft.DraftNote
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class DraftNoteDTOTest {
@Test
fun makeChannelIdParamTest() {
val note = DraftNote(
accountId = 0,
text = null,
channelId = Channel.Id(0, "id")
)
val dto = DraftNoteDTO.make(note)
Assertions.assertNotNull(note.channelId)
Assertions.assertNotNull(dto.channelId)
Assertions.assertEquals(note.channelId?.channelId, dto.channelId)
}
@Test
fun toDraftNoteTest() {
val dto = DraftNoteDTO(
accountId = 1,
poll = DraftPollDTO(
multiple = true,
),
channelId = "channelId",
cw = "cw_test",
text = "text_test",
renoteId = "renote_id_test",
replyId = "reply_id_test",
visibility = "public",
)
val entity = dto.toDraftNote(1L, null, null, null)
Assertions.assertEquals(1L, entity.accountId)
Assertions.assertEquals(dto.channelId, entity.channelId?.channelId)
Assertions.assertEquals(dto.cw, entity.cw)
Assertions.assertEquals(dto.text, entity.text)
Assertions.assertEquals(dto.renoteId, entity.renoteId)
Assertions.assertEquals(dto.replyId, entity.replyId)
Assertions.assertEquals(dto.visibility, entity.visibility)
}
}
================================================
FILE: app/src/test/java/net/pantasystem/milktea/note/editor/viewmodel/NoteEditorUiStateKtTest.kt
================================================
package net.pantasystem.milktea.note.editor.viewmodel
import kotlinx.datetime.Clock
import net.pantasystem.milktea.model.note.draft.DraftNote
import net.pantasystem.milktea.model.note.draft.DraftPoll
import net.pantasystem.milktea.model.note.expiresAt
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
import kotlin.time.Duration.Companion.days
class NoteEditorUiStateKtTest {
@Test
fun draftNote_toNoteEditingState_GiveHasExpiredPoll() {
val expiresAt = Clock.System.now() + 2.days
val draftNote = DraftNote(
accountId = 0,
visibility = "public",
visibleUserIds = listOf(),
text = null,
cw = null,
draftFiles = listOf(),
viaMobile = null,
localOnly = null,
noExtractMentions = null,
noExtractHashtags = null,
noExtractEmojis = null,
replyId = null,
renoteId = null,
draftPoll = DraftPoll(
choices = listOf(
"A",
"B",
"C",
"D"
), multiple = false, expiresAt = expiresAt.toEpochMilliseconds()
),
reservationPostingAt = null,
channelId = null,
isSensitive = null,
draftNoteId = 0
)
val state = draftNote.toNoteEditingState()
Assertions.assertEquals(
expiresAt.toEpochMilliseconds(),
state.poll?.expiresAt?.expiresAt()?.toEpochMilliseconds()
)
Assertions.assertEquals(listOf(
"A",
"B",
"C",
"D"
), state.poll?.choices?.map {
it.text
})
}
}
================================================
FILE: app/src/test/java/net/pantasystem/milktea/note/media/viewmodel/MediaViewDataTest.kt
================================================
package net.pantasystem.milktea.note.media.viewmodel
import kotlinx.coroutines.test.runTest
import net.pantasystem.milktea.model.drive.FileProperty
import net.pantasystem.milktea.model.drive.make
import net.pantasystem.milktea.model.file.AppFile
import net.pantasystem.milktea.model.file.FilePreviewSource
import net.pantasystem.milktea.model.setting.DefaultConfig
import net.pantasystem.milktea.model.setting.MediaDisplayMode
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class MediaViewDataTest {
@Test
fun initialFiles_GiveAlwaysShow() {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.ALWAYS_SHOW
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1"), isSensitive = true),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
)
)
val value = MediaViewData(files, config).files.value
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible
),
value.map {
it.initialVisibleType
}
)
}
/**
* configのmediaDisplayModeがMediaDisplayMode.ALWAYS_HIDEの場合のテストコード
*/
@Test
fun initialFiles_GiveAlwaysHide() {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.ALWAYS_HIDE
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1"), isSensitive = true),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
)
)
val value = MediaViewData(files, config).files.value
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
value.map {
it.initialVisibleType
}
)
}
/**
* configのmediaDisplayModeがMediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORKの場合のテストコード
*/
@Test
fun initialFiles_GiveAlwaysHideWhenMobileNetwork() {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1"), isSensitive = true),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
)
)
val value = MediaViewData(files, config).files.value
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
value.map {
it.initialVisibleType
}
)
}
/**
* configのmediaDisplayModeがMediaDisplayMode.AUTOの場合のテストコード
*/
@Test
fun initialFiles_GiveAuto() {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.AUTO
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1"), isSensitive = true),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
)
)
val value = MediaViewData(files, config).files.value
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible
),
value.map { it.initialVisibleType }
)
}
/**
* toggleVisibilityのテストコード
*/
@Test
fun toggleVisibility_GiveConfigAsAuto() = runTest {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.AUTO
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1"), isSensitive = true),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(id = FileProperty.Id(0L, "1")),
)
)
val mediaViewData = MediaViewData(files, config)
mediaViewData.toggleVisibility(0, false, MediaDisplayMode.AUTO)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(2, false, MediaDisplayMode.AUTO)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(2, false, MediaDisplayMode.AUTO)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.Visible
),
mediaViewData.files.value.map { it.visibleType }
)
}
/**
* toggleVisibilityのテストコード、modeがALWAYS_HIDE_WHEN_MOBILE_NETWORKの時
*/
@Test
fun toggleVisibility_GiveConfigAsAlwaysHideWhenMobileNetwork() = runTest {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = true
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
)
)
val mediaViewData = MediaViewData(files, config)
mediaViewData.toggleVisibility(0, true, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(1, true, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(1, true, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
}
@Test
fun toggleVisibility_GiveConfigAsAlwaysHideWhenMobileNetworkAndNetworkIsWifi() = runTest {
val config = DefaultConfig.config.copy(
mediaDisplayMode = MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK
)
val files = listOf(
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = true
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
),
FilePreviewSource.Remote(
AppFile.Remote(id = FileProperty.Id(0L, "1")),
FileProperty.make(
id = FileProperty.Id(0L, "1"),
isSensitive = false
),
)
)
val mediaViewData = MediaViewData(files, config)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(0, false, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(1, false, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.SensitiveHide,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
mediaViewData.toggleVisibility(1, false, MediaDisplayMode.ALWAYS_HIDE_WHEN_MOBILE_NETWORK)
Assertions.assertEquals(
listOf(
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.Visible,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork,
PreviewAbleFile.VisibleType.HideWhenMobileNetwork
),
mediaViewData.files.value.map { it.visibleType }
)
}
}
================================================
FILE: benchmark/.gitignore
================================================
/build
================================================
FILE: benchmark/build.gradle
================================================
plugins {
id 'com.android.test'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'systems.panta.benchmark'
compileSdk 35
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
defaultConfig {
minSdk 28
targetSdk 35
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
def properties = new Properties()
def propertyFile = project.rootProject.file('benchmark.properties')
if (propertyFile.exists()) {
properties.load(project.rootProject.file('benchmark.properties').newDataInputStream())
}
def REMOTE_ID = properties.getProperty('account.remote_id', '')
def INSTANCE_DOMAIN = properties.getProperty('account.instance_domain', '')
def USERNAME = properties.getProperty('account.username', '')
def TOKEN = properties.getProperty('account.token', '')
buildConfigField('String', 'ACCOUNT_REMOTE_ID', "\"${REMOTE_ID}\"")
buildConfigField('String', 'INSTANCE_DOMMAIN', "\"${INSTANCE_DOMAIN}\"")
buildConfigField('String', 'USERNAME', "\"${USERNAME}\"")
buildConfigField('String', 'TOKEN', "\"${TOKEN}\"")
}
buildTypes {
// This benchmark buildType is used for benchmarking, and should function like your
// release build (for example, with minification on). It's signed with a debug key
// for easy local/CI testing.
benchmark {
debuggable = true
signingConfig = debug.signingConfig
matchingFallbacks = ["release"]
}
}
targetProjectPath = ":app"
experimentalProperties["android.experimental.self-instrumenting"] = true
}
dependencies {
implementation libs.androidx.test.ext.junit
implementation libs.androidx.test.espresso.core
implementation 'androidx.test.uiautomator:uiautomator:2.3.0'
implementation 'androidx.benchmark:benchmark-macro-junit4:1.3.0'
implementation project(":modules:data")
implementation project(":modules:model")
implementation project(":modules:common")
implementation libs.room.runtime
}
androidComponents {
beforeVariants(selector().all()) {
enable = buildType == "benchmark"
}
}
================================================
FILE: benchmark/src/main/AndroidManifest.xml
================================================
================================================
FILE: benchmark/src/main/java/systems/panta/benchmark/ExampleStartupBenchmark.kt
================================================
package systems.panta.benchmark
import android.content.ComponentName
import android.content.Intent
import androidx.benchmark.macro.StartupMode
import androidx.benchmark.macro.StartupTimingMetric
import androidx.benchmark.macro.junit4.MacrobenchmarkRule
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
/**
* This is an example startup benchmark.
*
* It navigates to the device's home screen, and launches the default activity.
*
* Before running this benchmark:
* 1) switch your app's active build variant in the Studio (affects Studio runs only)
* 2) add ` ` to your app's manifest, within the `` tag
*
* Run this benchmark from Studio to see startup measurements, and captured system traces
* for investigating your app's performance.
*/
@RunWith(AndroidJUnit4::class)
class ExampleStartupBenchmark {
@get:Rule
val benchmarkRule = MacrobenchmarkRule()
@Test
fun startup() = benchmarkRule.measureRepeated(
packageName = "jp.panta.misskeyandroidclient",
metrics = listOf(StartupTimingMetric()),
iterations = 5,
startupMode = StartupMode.COLD,
setupBlock = {
}
) {
val intent = Intent(Intent.ACTION_MAIN).apply {
component = ComponentName("jp.panta.misskeyandroidclient", "jp.panta.misskeyandroidclient.MainActivity")
putExtra("remoteId", BuildConfig.ACCOUNT_REMOTE_ID)
putExtra("host", BuildConfig.INSTANCE_DOMMAIN)
putExtra("token", BuildConfig.TOKEN)
putExtra("username", BuildConfig.USERNAME)
}
pressHome()
startActivityAndWait(intent)
}
}
================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
mavenCentral()
}
dependencies {
classpath "com.google.android.gms:oss-licenses-plugin:0.10.6"
classpath 'com.google.gms:google-services:4.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.3'
}
}
plugins {
alias libs.plugins.kotlin.serialization.plugin apply false
//com.android.tools.build:gradle:8.1.3
alias(libs.plugins.android.application) apply false
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
alias(libs.plugins.kotlin.android) apply false
//classpath 'com.google.dagger:hilt-android-gradle-plugin:2.48.1'
alias(libs.plugins.dagger.hilt.android) apply false
alias(libs.plugins.android.test) apply false
alias(libs.plugins.compose.compiler) apply false
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
================================================
FILE: csae_policy_ja.md
================================================
# 児童の性的虐待・搾取(CSAE)に関するポリシー
Pantasystem(以下「開発者」)が開発・提供する Fediverse クライアントアプリ「Milktea」(以下「本アプリ」)は、児童の安全を最優先事項のひとつとして位置づけ、児童の性的虐待および搾取(CSAE: Child Sexual Abuse and Exploitation)を一切許容しません。
---
## 1. 禁止コンテンツ
本アプリを通じた以下のコンテンツの閲覧・投稿・共有・拡散を禁止します。
- 児童性的虐待素材(CSAM: Child Sexual Abuse Material)
- 18歳未満の人物を性的に描写するコンテンツ(実写・イラスト・AI生成物を含む)
- 児童を性的に誘惑・グルーミング・搾取することを目的としたコンテンツや行為
- 児童の性的取引・人身売買を助長・促進するコンテンツ
---
## 2. 本アプリの性質について
Milktea は Misskey・Mastodon・Calckey・Firefish などの分散型ソーシャルネットワーク(Fediverse)に接続するクライアントアプリです。コンテンツはユーザーが接続する各サーバー(インスタンス)によって管理されており、開発者はサーバー上のコンテンツを直接管理する立場にありません。
ただし、本アプリを通じて CSAE に該当するコンテンツに接触した場合は、以下の手順で報告してください。
---
## 3. 報告方法
### アプリ内報告機能
本アプリには投稿・ユーザーの報告機能が実装されています。報告はその投稿が存在するサーバーの管理者に送信されます。
1. 問題のある投稿またはユーザーのメニューを開く
2. 「報告する」を選択
3. 報告理由を入力して送信
### 開発者への直接連絡
サーバー管理者への報告が困難な場合、または本アプリ自体に関する問題の場合は、以下のフォームにて開発者に連絡してください。
https://docs.google.com/forms/d/e/1FAIpQLScbSPcTt4tvnKpkEkPex0y24ekAZVgBUEHFBT4DLaahzKcLaA/viewform?usp=dialog
### 国内外の通報窓口
- **警察庁 サイバー犯罪相談窓口**: https://www.npa.go.jp/cyber/soudan.htm
- **インターネットホットラインセンター(IHC)**: https://www.internethotline.jp/
- **NCMEC(National Center for Missing & Exploited Children)**: https://www.missingkids.org/gethelpnow/cybertipline
---
## 4. 対応方針
開発者は CSAE に関する報告を受けた場合、以下の対応を行います。
1. 報告内容を速やかに確認・調査する
2. 必要に応じてサーバー管理者に通知する
3. 法的に通報が必要と判断した場合、法執行機関および関係機関に通報する
4. 本アプリの機能・設計上の問題が確認された場合、速やかに修正する
---
## 5. 改定
本ポリシーは必要に応じて改定することがあります。重要な変更がある場合はリポジトリの更新履歴にて通知します。
---
最終更新日: 2026年4月6日
開発者: Pantasystem
================================================
FILE: docs/mfm-decorator-implementation-guide.md
================================================
# MFM デコレーター 未実装構文 実装ガイド
対象ファイル: `modules/common_android_ui/src/main/java/net/pantasystem/milktea/common_android_ui/MFMDecorator.kt`
MFM パーサーライブラリ: `com.github.pantasystem:mfm-kt:main-SNAPSHOT`
パース結果の型: `List`(`dev.misskey.mfm.node` パッケージ)
`$[name.arg=val 内容]` 構文はすべて `Fn(name, args: Map, children)` ノードとして渡される。
実装は `NodeDecorator.decorateNode()` 内の `is Fn ->` ブランチの `when (node.name)` に追加する。
---
## 実装済み構文(参考)
| 構文 | Fn name | 実装済み処理 |
|---|---|---|
| `$[x2]` 〜 `$[x4]` | `"x2"` 〜 `"x4"` | `RelativeSizeSpan(2f〜4f)` |
| `$[fg.color=fff ...]` | `"fg"` | `ForegroundColorSpan` |
| `$[bg.color=fff ...]` | `"bg"` | `BackgroundColorSpan` |
| `$[font.serif ...]` 等 | `"font"` | `TypefaceSpan("serif")` 等 |
---
## 未実装構文の実装方針
### 1. `$[unixtime 1701356400]`
**難易度: 低**
`Fn` ではなく専用ノードになる可能性があるが、パーサーの実装によっては `Fn(name="unixtime", args={"1701356400": null})` か、あるいは `children` にテキストが入る形になる。実際には `children` の `MfmText.text` に数値文字列が入る。
```kotlin
"unixtime" -> {
val epochSec = node.children
.filterIsInstance()
.firstOrNull()?.text?.trim()?.toLongOrNull()
if (epochSec != null) {
val formatted = java.text.DateFormat
.getDateTimeInstance(java.text.DateFormat.SHORT, java.text.DateFormat.SHORT)
.format(java.util.Date(epochSec * 1000L))
SpannedString(formatted)
} else {
inner
}
}
```
> **注意**: `unixtime` は `inner` を返さず、変換後のテキストを直接 `SpannedString` で返す。
---
### 2. `$[blur テキスト]`
**難易度: 低**
Android 標準の `MaskFilterSpan` + `BlurMaskFilter` で実現できる。
`BlurMaskFilter` はぼかし半径(px)と種類(`NORMAL` / `OUTER` / `INNER` / `SOLID`)を指定する。
```kotlin
"blur" -> {
inner.setSpan(
android.text.style.MaskFilterSpan(
android.graphics.BlurMaskFilter(20f, android.graphics.BlurMaskFilter.Blur.NORMAL)
),
0, inner.length, 0
)
}
```
> **注意**: `MaskFilterSpan` はハードウェアアクセラレーション有効時に無視される場合がある。
> `textView.setLayerType(View.LAYER_TYPE_SOFTWARE, null)` を TextView 側に設定する必要がある。
> `DecorateTextHelper.kt` 内の `decorate()` BindingAdapter で対応するのが適切。
---
### 3. `$[scale.x=2 テキスト]` / `$[scale.y=2 テキスト]`
**難易度: 低〜中**
- **横スケール (`scale.x`)**: Android 標準の `ScaleXSpan(factor)` で実現可能。
- **縦スケール (`scale.y`)**: 標準 API にないため `RelativeSizeSpan` で代替するか、カスタム Span が必要。
```kotlin
"scale" -> {
val scaleX = node.args["x"]?.toFloatOrNull()
val scaleY = node.args["y"]?.toFloatOrNull()
if (scaleX != null) {
inner.setSpan(android.text.style.ScaleXSpan(scaleX), 0, inner.length, 0)
}
if (scaleY != null) {
// 縦スケールは RelativeSizeSpan で近似(正確ではない)
inner.setSpan(RelativeSizeSpan(scaleY), 0, inner.length, 0)
}
}
```
---
### 4. `$[border.style=solid,width=4 テキスト]`
**難易度: 中**
`ReplacementSpan` を継承したカスタム Span を作成し、`draw()` で `Canvas.drawRect()` を使って枠線を描画する。
```kotlin
class MfmBorderSpan(
private val style: String, // solid / dotted / dashed / double / groove / ridge / inset / outset
private val width: Int, // px
private val color: Int, // ARGB
private val radius: Float, // 角丸 px
) : ReplacementSpan() {
override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fm: Paint.FontMetricsInt?) =
paint.measureText(text, start, end).toInt() + width * 2
override fun draw(canvas: Canvas, text: CharSequence, start: Int, end: Int,
x: Float, top: Int, y: Int, bottom: Int, paint: Paint) {
val borderPaint = Paint(paint).apply {
this.color = this@MfmBorderSpan.color
this.style = Paint.Style.STROKE
strokeWidth = width.toFloat()
// dotted/dashed は PathEffect で対応
if (this@MfmBorderSpan.style == "dotted") {
pathEffect = DashPathEffect(floatArrayOf(4f, 4f), 0f)
} else if (this@MfmBorderSpan.style == "dashed") {
pathEffect = DashPathEffect(floatArrayOf(10f, 4f), 0f)
}
}
val rect = RectF(x, top.toFloat(), x + getSize(paint, text, start, end, null), bottom.toFloat())
canvas.drawRoundRect(rect, radius, radius, borderPaint)
canvas.drawText(text, start, end, x + width, y.toFloat(), paint)
}
}
```
`Fn` 分岐での呼び出し:
```kotlin
"border" -> {
val style = node.args["style"] ?: "solid"
val width = node.args["width"]?.toIntOrNull() ?: 1
val color = parseMfmColor(node.args["color"]) ?: Color.BLACK
val radius = node.args["radius"]?.toFloatOrNull() ?: 0f
inner.setSpan(MfmBorderSpan(style, width, color, radius), 0, inner.length, 0)
}
```
---
### 5. `$[ruby 漢字 かんじ]`
**難易度: 中**
`ReplacementSpan` を継承して、本文の上部に小さいテキスト(ルビ)を描画する。
`Fn(name="ruby", args={}, children=[MfmText("漢字 かんじ")])` の形でパースされる。
スペースで区切って `children[0]` = 本文、`children[1]` = ルビとして扱う。
```kotlin
class MfmRubySpan(
private val baseText: String,
private val rubyText: String,
) : ReplacementSpan() {
override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fm: Paint.FontMetricsInt?): Int {
return maxOf(
paint.measureText(baseText),
paint.measureText(rubyText) * (paint.textSize * 0.5f / paint.textSize)
).toInt()
}
override fun draw(canvas: Canvas, text: CharSequence, start: Int, end: Int,
x: Float, top: Int, y: Int, bottom: Int, paint: Paint) {
// ルビ(上部小テキスト)
val rubyPaint = Paint(paint).apply { textSize *= 0.5f }
canvas.drawText(rubyText, x, top + rubyPaint.textSize, rubyPaint)
// 本文
canvas.drawText(baseText, x, y.toFloat(), paint)
}
}
```
`Fn` 分岐での呼び出し:
```kotlin
"ruby" -> {
val raw = node.children.filterIsInstance().joinToString("") { it.text }
val spaceIdx = raw.lastIndexOf(' ')
if (spaceIdx > 0) {
val base = raw.substring(0, spaceIdx)
val ruby = raw.substring(spaceIdx + 1)
val spanned = SpannableString(base)
spanned.setSpan(MfmRubySpan(base, ruby), 0, base.length, 0)
spanned
} else {
inner
}
}
```
---
### 6. `$[flip テキスト]` / `$[flip.v ...]` / `$[flip.h,v ...]`
**難易度: 中**
`ReplacementSpan` で `Canvas.scale(-1f, 1f)` (水平) または `Canvas.scale(1f, -1f)` (垂直) を使用。
```kotlin
class MfmFlipSpan(
private val horizontal: Boolean,
private val vertical: Boolean,
) : ReplacementSpan() {
override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fm: Paint.FontMetricsInt?) =
paint.measureText(text, start, end).toInt()
override fun draw(canvas: Canvas, text: CharSequence, start: Int, end: Int,
x: Float, top: Int, y: Int, bottom: Int, paint: Paint) {
val w = paint.measureText(text, start, end)
val cx = x + w / 2f
val cy = (top + bottom) / 2f
canvas.save()
canvas.scale(
if (horizontal) -1f else 1f,
if (vertical) -1f else 1f,
cx, cy
)
canvas.drawText(text, start, end, x, y.toFloat(), paint)
canvas.restore()
}
}
```
`Fn` 分岐での呼び出し:
```kotlin
"flip" -> {
val h = !node.args.containsKey("v") || node.args.containsKey("h")
val v = node.args.containsKey("v")
inner.setSpan(MfmFlipSpan(h, v), 0, inner.length, 0)
}
```
---
### 7. `$[rotate.deg=30 テキスト]`
**難易度: 中〜高**
`ReplacementSpan` で `Canvas.rotate(deg)` を使用。
回転するとバウンディングボックスが変わるため、`getSize()` での幅計算が複雑になる。
```kotlin
class MfmRotateSpan(private val degrees: Float) : ReplacementSpan() {
override fun getSize(paint: Paint, text: CharSequence, start: Int, end: Int, fm: Paint.FontMetricsInt?) =
paint.measureText(text, start, end).toInt()
override fun draw(canvas: Canvas, text: CharSequence, start: Int, end: Int,
x: Float, top: Int, y: Int, bottom: Int, paint: Paint) {
val w = paint.measureText(text, start, end)
val cx = x + w / 2f
val cy = (top + bottom) / 2f
canvas.save()
canvas.rotate(degrees, cx, cy)
canvas.drawText(text, start, end, x, y.toFloat(), paint)
canvas.restore()
}
}
```
`Fn` 分岐での呼び出し:
```kotlin
"rotate" -> {
val deg = node.args["deg"]?.toFloatOrNull() ?: 0f
inner.setSpan(MfmRotateSpan(deg), 0, inner.length, 0)
}
```
---
## 実装しない構文(理由)
| 構文 | 理由 |
|---|---|
| `$[jelly]` `$[tada]` `$[jump]` `$[bounce]` `$[spin]` `$[shake]` `$[twitch]` `$[rainbow]` `$[sparkle]` | TextView の Span はアニメーション非対応。Compose や ObjectAnimator を使った別アーキテクチャが必要 |
| `$[position.x=0.8,y=0.5 ...]` | フローレイアウト内の絶対座標オフセットは TextView の行レイアウト制約上ほぼ不可能 |
---
## カスタム Span を配置するファイルの推奨場所
新規ファイルとして以下に作成する:
```
modules/common_android_ui/src/main/java/net/pantasystem/milktea/common_android_ui/mfm/
MfmBorderSpan.kt
MfmRubySpan.kt
MfmFlipSpan.kt
MfmRotateSpan.kt
```
`blur` 対応時の `LAYER_TYPE_SOFTWARE` 設定場所:
`DecorateTextHelper.kt` の `TextView.decorate(result: LazyDecorateResult?)` 内で
`LazyDecorateResult` にフラグを持たせるか、`Spanned` を検査して `MaskFilterSpan` があれば設定する。
================================================
FILE: docs/migrate-dynamic-feature-flag-plan.md
================================================
# 概要
前提として当アプリは複数のSNSのAPIやそれらフォークをサポートしている。
SNSによって使える機能やAPIやエンドポイントが異なるため、
アプリではこれを識別し、ロジックの制御やUIの表示分けを行っていた。
より多くのソフトウェアやフォークをサポートしていくために、この仕組みを改善する。
# 現状の問題点
現状はサーバーから取得できるnodeinfoや/meta, /instance情報を元に機能の判別をしている。
これ自体は問題ないが、このnodeinfo, meta, instanceなどの構造に深く依存してしまっている。
また依存している箇所ごとに複雑な評価処理を行なっていて可読性が低くなってしまっている。
```Kotlin
when (account.instanceType) {
Account.InstanceType.MISSKEY, Account.InstanceType.FIREFISH -> {
postUnReaction(deleteReaction.noteId)
&& (noteCaptureAPIProvider.get(account)
?.isCaptured(deleteReaction.noteId.noteId) == true
|| (note.reactionCounts.any { it.me }
&& noteDataSource.add(note.onIUnReacted())
.getOrThrow() != AddResult.Canceled))
}
Account.InstanceType.MASTODON, Account.InstanceType.PLEROMA -> {
val nodeInfo = nodeInfoRepository.find(account.getHost())
.getOrThrow()
if (nodeInfo.type !is NodeInfo.SoftwareType.Mastodon.Fedibird
&& nodeInfo.type !is NodeInfo.SoftwareType.Mastodon.Kmyblue
) {
if (!note.isSupportEmojiReaction) {
return@withContext false
}
}
val res = mastodonAPIProvider.get(account)
.deleteReaction(
deleteReaction.noteId.noteId,
Reaction(deleteReaction.reaction).getNameAndHost()
)
.throwIfHasError()
.body()
noteDataSourceAdder.addTootStatusDtoIntoDataSource(
account,
requireNotNull(res)
)
true
}
}
```
# 解決策
解決策として、アプリ内部に動的な機能フラグを構築し、
内部処理はこのフラグを元に使用できる機能や分岐を行うようにする。
またこの機能はユーザーが設定画面などからフラグを操作できるようにし、
アプリが想定していないForkなどであっても、フラグをON/OFFできるようにしフォールバックが提供されるようにする。
今回は実施しないがこの機能フラグの状態をサーバーから取得できるようにし、
ソースコードを直接改変することなくある程度のソフトウェアに対応できるようにする。
# 大まかな設計
## 機能フラグオブジェクト
プリミティブな値とenumのみサポートする。
実際に必要なフラグやenumは内部のnodeinfo, meta, instanceInfoを使った処理を洗い出す必要性がある。
### プロパティ
apiType, apiVersionは大まかなAPIのスキーマを選択する。
内部的な処理としてはRetrofitのインターフェースの選択に使われることを想定。
- apiType(misskey, mastodon, pleroma)
- apiVersion
- reaction
- isSupportReaction
- maxReactionsPerAccount
- unicodeFormatType
- needColon
- dontNeedColon
- supportMisskeyAntenna
- supportFireshRecommendTimeline
- supportGlobalTimeline
- supportLocalTimeline
- supportMisskeyGallery
↑無数にあるので洗い出しを行なった上で合理性の検証を必ずしたい。
## 機能フラグRepository
内部的にはNodeInfo, InstanceInfo, Metaなどの情報を用いて、
機能フラグのインスタンスを生成することになる。
確認したいこととして、機能フラグの構築に失敗してしまうと、
全機能が使用できなくなってしまう可能性があるのと、
構築が遅い場合は起動や一部処理が落ちる可能性がある。
そのため、構築するときに使用されるデータが存在しない可能性や遅延が起きる可能性を考慮したい。
インターフェースとしてはインスタンスのドメイン部を引数に受け取り、
対応する機能フラグオブジェクトを返すようにする。
またユーザーがインスタンスごとに機能フラグを設定できるようにするために、
インスタンスのドメイン部ごとに機能フラグを永続化できるようにする必要性がある。
## 機能フラグテンプレート
インスタンスやソフトウェアの種別ごとにデフォルトとして用意される機能フラグのデフォルト値集。
# 機能フラグ設定画面
機能フラグをユーザーが手動で更新するための画面。
- 機能フラグを有効にする(実際は必須でONになっているがユーザーが変更できるようにするという意味でON)
- 変更することで発生するリスクを明記
- 対象インスタンス選択DROPDOWN
- ログイン済みのアカウントのインスタンスのリスト + Intentで前の画面から値を貰えたあばいは追加表示
- 全ての設定項目を列挙
```
nodeinfoとmetaをmodelクラスに変換した構造に内部実装が依存した状態をやめる
構造ベースの依存ではなく動的な機能フラグをベースとした基盤を作成する。
動的な機能フラグの構築は自体はnodeinfoとmetaなどの情報から構築するようにする。
また機能フラグは原則としてプリミティブとenumをサポートするようにする。
機能フラグはユーザーが認証画面や設定画面から編集できるようにし、
アプリが想定していないフォークであってもある程度の機能が動作するようにする。
このためにデフォルトの挙動を表す機能フラグテンプレートを用意しnodeinfoの情報を元に
このテンプレートの判別をする。
ユーザーの設定はオーバーライドダイナミックフィーチャーフラグとしてDBに保存する。
優先度は
ユーザーの設定>アプリのテンプレート
将来手にはこのテンプレートをサーバーから配信できるようにするが今はしない
```
================================================
FILE: docs/note-editor-compose-migration-plan.md
================================================
# NoteEditorActivity Jetpack Compose 移行計画
このドキュメントは Claude が作業を進めるための実装計画書です。
完了したタスクは `- [ ]` を `- [x]` に変えてください。
各フェーズに着手する前に「前提条件」を確認し、完了後は「完了確認」を実施してください。
---
## 基本方針
`NoteEditorActivity` は現在、DataBinding を使う Fragment ベースのハイブリッド実装になっている。
ツールバー・ファイルプレビュー・ユーザーアクションメニュー・投票エディタなど約1,600行は既に Compose 化済み。
残りの XML/Fragment 部分(約2,100行)を段階的に置き換える。
**インクリメンタル戦略:** 内側から外側へ順に置き換え、各フェーズ終了後にビルド・動作確認できる状態を維持する。
---
## 現在のアーキテクチャ
```
NoteEditorActivity (AppCompatActivity + DataBinding)
└── NoteEditorFragment (Fragment + DataBinding)
├── ComposeView: NoteEditorToolbar ← 移行済み
├── RecyclerView: addressUsersView ← 要移行
├── MultiAutoCompleteTextView: cw ← 要移行(難)
├── MultiAutoCompleteTextView: inputMain ← 要移行(難)
├── FrameLayout: edit_poll
│ └── PollEditorFragment (Compose inside) ← 移行済み
├── ComposeView: filePreview ← 移行済み
├── ComposeView: noteEditorUserActionMenu ← 移行済み
└── BottomSheetDialogFragment 群(多数) ← 大半が移行済み
```
---
## フェーズ一覧
| フェーズ | 内容 | リスク | 完了後にリリース可能? |
|---------|------|--------|----------------------|
| Phase 1 | Composable の骨格作成(未接続) | 低 | Yes |
| Phase 2 | `EmojiAutoCompleteTextField`(AndroidView ラッパー) | 中 | Yes |
| Phase 3 | `NoteEditorFragment` のレイアウトを Compose に置換 | 高 | Yes |
| Phase 4 | Fragment を削除し Activity を `setContent` に移行 | 中 | Yes |
| Phase 5 | ダイアログの純粋 Compose 化(任意) | 低 | Yes |
---
## Phase 1: Composable の骨格作成
**ゴール:** ViewModel に接続せず、UI 構造だけを Compose で作る。Preview で確認できる状態にする。
**前提条件:** なし(最初のフェーズ)
### 作成するファイル
#### `NoteEditorScreen.kt`
最上位の stateful Composable。状態収集・コールバック受け渡しの責務のみを持つ。
```kotlin
@Composable
fun NoteEditorScreen(
viewModel: NoteEditorViewModel,
onNavigateUp: () -> Unit,
onPickFileFromDrive: () -> Unit,
onPickFileFromLocal: () -> Unit,
onPickImageFromLocal: () -> Unit,
onSelectMentionUsers: () -> Unit,
onSelectAddressUsers: () -> Unit,
onShowEmojiPicker: () -> Unit,
onShowDraftPicker: () -> Unit,
onShowMediaPreview: (FilePreviewSource) -> Unit,
onEditFileCaption: (FilePreviewSource) -> Unit,
onEditFileName: (FilePreviewSource) -> Unit,
)
```
ViewModel から状態を collect し、子 Composable へ値として渡す。ダイアログのトリガーはラムダで上位に委譲する。
#### `NoteEditorTextInputSection.kt`
テキスト入力エリア全体(CW フィールド + 本文フィールド + 文字数カウント)。
Phase 2 で実装する `EmojiAutoCompleteTextField` を組み込む。
#### `NoteEditorAddressSection.kt`
宛先ユーザーチップ + 追加ボタン。`FlowRow` または `LazyRow` で実装。
`UserChipListAdapter` の RecyclerView を置き換える。
#### `NoteEditorReplyPreview.kt`
リプライ先ノートの簡易プレビューカード。
`item_note_editor_reply_to_note.xml` の代替。DataBinding の複雑なバインディングは不要で、
アバター・表示名・本文テキストだけを表示するシンプルな実装でよい。
#### `NoteEditorScheduleSection.kt`
予約投稿の日時表示 + クリア・編集ボタン行。
### 設計上の注意
- ViewModel のインスタンスを孫 Composable まで引き回さない。`NoteEditorScreen` で `uiState` を collect し、派生した値のみを子に渡す
- `NoteEditorUiState` は既によく整理された構造になっているため、そのまま活用できる
### チェックリスト
- [x] `NoteEditorScreen.kt` を作成し、既存の Compose コンポーネント(`NoteEditorToolbar`、`NoteFilePreview`、`NoteEditorUserActionMenuLayout`)を組み込む
- [x] `NoteEditorTextInputSection.kt` を作成(この時点では `AndroidView` なしのプレースホルダーでよい)
- [x] `NoteEditorAddressSection.kt` を作成
- [x] `NoteEditorReplyPreview.kt` を作成
- [x] `NoteEditorScheduleSection.kt` を作成
- [x] 各 Composable に `@Preview` を追加して確認
- [x] `./gradlew :modules:features:note:compileDebugKotlin` でコンパイルエラーがないことを確認
---
## Phase 2: EmojiAutoCompleteTextField の実装
**ゴール:** `MultiAutoCompleteTextView` を `AndroidView` でラップした Composable を作る。
**前提条件:** Phase 1 完了
これが移行の最大難所。Compose の `TextField` / `BasicTextField` にはビルトインの補完機能がないため、
まず `AndroidView` でブリッジし、安定後に純粋 Compose 実装に移行する(別フェーズ)。
### `EmojiAutoCompleteTextField.kt`
```kotlin
@Composable
fun EmojiAutoCompleteTextField(
value: String,
onValueChange: (String) -> Unit,
onFocused: () -> Unit,
account: Account?,
customEmojiRepository: CustomEmojiRepository,
modifier: Modifier = Modifier,
hint: String = "",
cursorPosition: Int? = null, // ViewModel の textCursorPos flow から受け取る
)
```
実装方針:
- `AndroidView { MultiAutoCompleteTextView(ctx) }` で既存の `CustomEmojiCompleteAdapter` + `CustomEmojiTokenizer` をそのまま使う
- `update` ブロックで `value` の変化を TextView に反映する(ループ防止のため `text.toString() != value` でガード)
- `cursorPosition` が変化したら `setSelection()` を呼ぶ
### フォーカス管理の置き換え
現在 ViewModel に `var focusType: NoteEditorFocusEditTextType` という mutable var があり、Fragment がフォーカスイベントで書き換えている。
Compose では `NoteEditorScreen` のローカル状態として持つ:
```kotlin
var focusedField by remember { mutableStateOf(NoteEditorFocusEditTextType.Text) }
```
絵文字選択コールバックでこれを参照する。ViewModel の `focusType` は `SimpleEditorFragment` が移行されるまで残す。
### 注意事項
- `AndroidView` を `LazyColumn` の中に入れると再測定問題が起きる。テキスト入力エリアは `verticalScroll` + `Column` で実装する
- `MultiAutoCompleteTextView` の `performFiltering` 内に `runBlocking` があるが、これは既存の問題なので今回は触らない
- IME Insets は Activity 側の `enableEdgeToEdge()` + `ViewCompat.setOnApplyWindowInsetsListener` で既に処理済みなので競合に注意
### チェックリスト
- [x] `EmojiAutoCompleteTextField.kt` を作成し、`AndroidView` で `MultiAutoCompleteTextView` をラップする
- [x] `CustomEmojiCompleteAdapter` + `CustomEmojiTokenizer` を `AndroidView` の `factory` ブロックで設定する
- [x] `update` ブロックでテキスト同期とカーソル位置同期を実装する
- [x] `NoteEditorTextInputSection.kt` を `EmojiAutoCompleteTextField` を使う実装に更新する
- [x] `NoteEditorScreen` 内に `focusedField` ローカル状態を追加する
- [x] `./gradlew :modules:features:note:compileDebugKotlin` でコンパイルエラーがないことを確認
---
## Phase 3: NoteEditorFragment を Compose に置換
**ゴール:** `NoteEditorFragment` の DataBinding レイアウトを `NoteEditorScreen` に差し替える。Fragment と Activity は残す。
**前提条件:** Phase 1・2 完了。**このフェーズが最もリスクが高い。着手前に必ず現在の動作を手元で確認すること。**
### 変更手順
1. `NoteEditorFragment` の `Fragment(R.layout.fragment_note_editor)` を `Fragment()` に変更し、`onCreateView` で `ComposeView` を返す
```kotlin
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View = ComposeView(requireContext()).apply {
setContent {
MilkteaStyleConfigApplyAndTheme(...) {
NoteEditorScreen(
viewModel = viewModel,
onPickFileFromDrive = { openDriveLauncher.launch(...) },
...
)
}
}
}
```
2. `ActivityResultContracts` のランチャーは Fragment に残す(ライフサイクルオーナーが必要なため)。ラムダとして `NoteEditorScreen` に渡す
3. `PollEditorFragment` のトランザクションを削除し、`PollEditorLayout` を `NoteEditorScreen` 内で直接呼ぶ(`uiState.poll != null` の条件分岐)
4. `ComposeView` の島(toolbar・filePreview・userActionMenu)を `NoteEditorScreen` 内に統合
5. `UserChipListAdapter` + RecyclerView を `NoteEditorAddressSection` に置換
### バックプレス処理
現在 `requireActivity().onBackPressedDispatcher.addCallback(this)` で下書き保存確認を行っている。
Fragment が残っている間はこのまま維持する。Phase 4 で `BackHandler { }` に移行する。
### `settingStore.isPostButtonAtTheBottom` の対応
投稿ボタン位置の切り替えロジックを `NoteEditorScreen` 内で Compose の条件分岐に置き換える:
```kotlin
if (uiState.isPostButtonAtTheBottom) {
// アクションメニューを下部に配置
} else {
// ツールバー内に配置
}
```
### チェックリスト
- [x] `NoteEditorFragment.onCreateView` を `ComposeView` を返す実装に変更する
- [x] DataBinding 関連コード(`binding.*` の参照)を `NoteEditorFragment` からすべて削除する
- [x] `ActivityResultContracts` ランチャー群をラムダとして `NoteEditorScreen` に渡す
- [x] `PollEditorFragment` のトランザクションを削除し `PollEditorLayout` を直接呼ぶ
- [x] 既存の `ComposeView` 島(toolbar・filePreview・userActionMenu)を `NoteEditorScreen` 内に統合する
- [x] `UserChipListAdapter` + RecyclerView を `NoteEditorAddressSection` に置換する
- [x] `fragment_note_editor.xml` を削除する
- [ ] `PollEditorFragment.kt` を削除する(`SimpleEditorFragment` が参照しているため保留)
- [x] `./gradlew :app:assembleDebug` BUILD SUCCESSFUL を確認
- [ ] 実機またはエミュレータで以下の動作確認:
- [ ] テキスト入力・絵文字補完が動作する
- [ ] CW フィールドの表示/非表示が動作する
- [ ] ファイル添付が動作する
- [ ] 投票エディタが動作する
- [ ] 宛先ユーザー選択が動作する
- [ ] 予約投稿の設定が動作する
- [ ] バックプレスで下書き保存確認が出る
- [ ] 投稿が正常に完了する
---
## Phase 4: Activity を setContent に移行
**ゴール:** `NoteEditorFragment` を削除し、Activity が直接 `setContent` する形に変える。
**前提条件:** Phase 3 完了・動作確認済み
### NoteEditorActivity の変更
```kotlin
@AndroidEntryPoint
class NoteEditorActivity : AppCompatActivity() {
// AppCompatActivity のまま継続(ComponentActivity にすると AppCompat 依存が壊れる可能性あり)
private val viewModel: NoteEditorViewModel by viewModels()
// ActivityResultContracts ランチャーを Fragment から Activity に移動
private val openDriveLauncher = registerForActivityResult(...) { ... }
private val pickMultipleMediaLauncher = registerForActivityResult(...) { ... }
// ...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
applyTheme()
if (savedInstanceState == null) {
viewModel.initialize(parseNoteEditorArgs(intent))
}
setContent {
MilkteaStyleConfigApplyAndTheme(...) {
NoteEditorScreen(
viewModel = viewModel,
onNavigateUp = { finish() },
onPickFileFromDrive = { openDriveLauncher.launch(...) },
...
)
}
}
}
}
```
**注意:** `ComponentActivity` への変更は避ける。`AppCompatActivity` は `ComponentActivity` を継承しており `setContent { }` も使えるため、互換性を保つために `AppCompatActivity` のままにする。
### Intent API の維持
`newBundle()` コンパニオン関数は呼び出し元が多数あるため変更不要。Activity の内部実装だけ変わる。
### Window Insets の移行
Fragment が消えた後は `NoteEditorScreen` の Scaffold/Column 側で `WindowInsets` を処理する:
```kotlin
Scaffold(
contentWindowInsets = WindowInsets.safeDrawing,
...
)
```
### バックプレス処理の移行
```kotlin
// NoteEditorScreen 内
BackHandler(enabled = uiState.hasContent) {
showSaveAsDraftDialog = true
}
```
### Intent 引数パース
`parseNoteEditorArgs(intent: Intent): NoteEditorArgs` として独立関数に切り出す。
### `isSaveNoteAsDraft` フローの処理
現在 `Handler(Looper.getMainLooper()).post { finish() }` で処理している部分を `LaunchedEffect` に置き換える:
```kotlin
LaunchedEffect(Unit) {
viewModel.isSaveNoteAsDraft.collect { draftId ->
if (draftId != null) onNavigateUp()
}
}
```
### チェックリスト
- [x] `ActivityResultContracts` ランチャー群を `NoteEditorFragment` から `NoteEditorActivity` に移動する
- [x] `NoteEditorActivity.onCreate` を `setContent { NoteEditorScreen(...) }` に変更する
- [x] `NoteEditorScreen` の Scaffold に `contentWindowInsets = WindowInsets.safeDrawing` を設定する
- [x] bottomBar に `imePadding()` を追加してキーボード表示時にアクションバーが上に移動するよう対応
- [x] `NoteEditorFragment.kt` を削除する
- [x] `activity_note_editor.xml` を削除する
- [x] `./gradlew :app:assembleDebug` BUILD SUCCESSFUL を確認
- [ ] 実機またはエミュレータで Phase 3 と同じ動作確認項目を再確認する
---
## Phase 5: ダイアログの純粋 Compose 化(任意)
**ゴール:** Fragment ベースのダイアログを純粋 Compose の `Dialog { }` / `AlertDialog` composable に置き換える。
**前提条件:** Phase 4 完了。優先度低・任意対応。
ほとんどのダイアログは既に Compose inside Fragment になっている。以下を完全 Compose 化する:
| 現在 | 移行後 |
|------|--------|
| `ConfirmSaveAsDraftDialog` (Fragment) | `AlertDialog` composable(`showSaveAsDraftDialog: Boolean` state で制御) |
| `NoteEditorFileSizeWarningDialog` | 同上 |
| `ReservationPostDatePickerDialog` | `DatePickerDialog` composable |
| `ReservationPostTimePickerDialog` | `TimePickerDialog` composable |
| `PollDatePickerDialog` | 同上 |
| `PollTimePickerDialog` | 同上 |
`VisibilitySelectionDialogV2`・`NoteEditorSwitchAccountDialog`・`EditFileCaptionDialog`・`EditFileNameDialog` は既に Compose ベースなので、Fragment ラッパーを外して `Dialog { }` composable に変えるだけでよい。
### チェックリスト
- [ ] `ConfirmSaveAsDraftDialog` を `NoteEditorScreen` 内の `AlertDialog` composable に置き換える
- [ ] `NoteEditorFileSizeWarningDialog` を `AlertDialog` composable に置き換える
- [ ] `ReservationPostDatePickerDialog` / `ReservationPostTimePickerDialog` を `DatePickerDialog` / `TimePickerDialog` composable に置き換える
- [ ] `PollDatePickerDialog` / `PollTimePickerDialog` を composable に置き換える
- [ ] `VisibilitySelectionDialogV2` の Fragment ラッパーを外す
- [ ] `NoteEditorSwitchAccountDialog` の Fragment ラッパーを外す
- [ ] `EditFileCaptionDialog` / `EditFileNameDialog` の Fragment ラッパーを外す
- [ ] `./gradlew :app:assembleDebug` BUILD SUCCESSFUL を確認
---
## 技術的難所まとめ
### 1. MultiAutoCompleteTextView(Phase 2 で対処)
Compose TextField には絵文字補完機能がないため `AndroidView` でブリッジ。
将来的には `BasicTextField` + カスタムドロップダウンに置き換え可能だが初期移行では不要。
### 2. ActivityResultContracts の配置(Phase 3→4 で対処)
`rememberLauncherForActivityResult` は Composable 内でも使えるが、Activity/Fragment レベルで登録した方が
ライフサイクルの扱いが安全。今回は最終的に Activity に集約する。
### 3. テーマ適用(Phase 4 で確認必要)
`applyTheme()` が `AppCompatDelegate` に依存しているため、`AppCompatActivity` を維持することで解決する。
`ComponentActivity` への変更は今回の範囲外とする。
### 4. `isSaveNoteAsDraft` フローの処理(Phase 4 で対処)
現在 `Handler(Looper.getMainLooper()).post { finish() }` で処理している。
Compose 移行後は `LaunchedEffect` で監視する(詳細は Phase 4 参照)。
---
## SimpleEditorFragment について
`SimpleEditorFragment` は `NoteEditorActivity` とは別のエントリーポイント(メインフィード画面に埋め込み)。
`goToNormalEditor()` から `NoteEditorActivity.newBundle()` を使って遷移するため、今回の移行の影響を受けない。
`SimpleEditorFragment` 自体の Compose 化は別タスクとして切り出す。
Phase 2 で作成した `EmojiAutoCompleteTextField` を再利用できる。
---
## 参考ファイル
| ファイル | パス |
|---------|------|
| NoteEditorActivity | `modules/features/note/src/main/java/net/pantasystem/milktea/note/NoteEditorActivity.kt` |
| NoteEditorFragment | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/NoteEditorFragment.kt` |
| SimpleEditorFragment | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/SimpleEditorFragment.kt` |
| NoteEditorViewModel | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/viewmodel/NoteEditorViewModel.kt` |
| NoteEditorUiState | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/viewmodel/NoteEditorUiState.kt` |
| fragment_note_editor.xml | `modules/features/note/src/main/res/layout/fragment_note_editor.xml` |
| item_note_editor_reply_to_note.xml | `modules/features/note/src/main/res/layout/item_note_editor_reply_to_note.xml` |
| NoteEditorToolbar | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/NoteEditorToolbar.kt` |
| NoteEditorUserActionMenuLayout | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/NoteEditorUserActionMenuLayout.kt` |
| PollEditorLayout | `modules/features/note/src/main/java/net/pantasystem/milktea/note/editor/poll/PollEditorLayout.kt` |
================================================
FILE: docs/note-editor-reply-preview-mfm-plan.md
================================================
# NoteEditorReplyPreview MFM リッチ表示 実装計画書
## 概要
`NoteEditorReplyPreview` のノート本文表示を、現在のプレーンテキストから MFM 構文対応のリッチ表示に変更する。
Compose の `Text` コンポーザブル + `AnnotatedString` を主軸とし、`MFMDecorator`(TextView/Span ベース)を参考に Compose ネイティブな実装を行う。
---
## 実装方針
### アーキテクチャ
```
MFMParser.parse(text) // common_android: 既存
↓ List
buildMfmAnnotatedString() // 【新規】common_android_ui: AnnotatedString を構築
↓ AnnotatedString + Map
MfmText コンポーザブル // 【新規】common_android_ui: Text + InlineTextContent でレンダリング
↓
NoteEditorReplyPreview.kt 更新 // 既存ファイル: MfmText に置き換え
```
### 配置モジュール
新規ファイルは `modules/common_android_ui` に追加する。
理由:
- `MFMParser`(`common_android`)と mfm-kt ノード型への依存が必要
- `common_android_ui` はすでに両者に依存しており、循環依存が発生しない
- `note` モジュールはすでに `common_android_ui` に依存済み
---
## 新規ファイル
### `MfmText.kt`(`common_android_ui` モジュール)
```
modules/common_android_ui/src/main/java/net/pantasystem/milktea/common_android_ui/MfmText.kt
```
#### エントリーポイント
```kotlin
@Composable
fun MfmText(
text: String,
modifier: Modifier = Modifier,
emojiNameMap: Map = emptyMap(),
style: TextStyle = LocalTextStyle.current,
color: Color = Color.Unspecified,
maxLines: Int = Int.MAX_VALUE,
overflow: TextOverflow = TextOverflow.Clip,
)
```
#### 内部関数
```kotlin
// MfmNode リストを AnnotatedString に変換するビルダー
// InlineTextContent(カスタム絵文字用)の ID→コンテンツ も同時に収集する
private fun AnnotatedString.Builder.appendMfmNodes(
nodes: List,
baseStyle: SpanStyle,
inlineContents: MutableMap,
emojiNameMap: Map,
fontSize: TextUnit,
)
```
---
## MFM ノード対応表
### Compose `AnnotatedString` で対応可能なノード
| MfmNode | 対応方法 |
|---|---|
| `MfmText` | `append(text)` |
| `Bold` | `SpanStyle(fontWeight = FontWeight.Bold)` |
| `Italic` | `SpanStyle(fontStyle = FontStyle.Italic)` |
| `Strike` | `SpanStyle(textDecoration = TextDecoration.LineThrough)` |
| `Small` | `SpanStyle(fontSize = base * 0.6f)` |
| `Center` | `ParagraphStyle(textAlign = TextAlign.Center)` |
| `InlineCode` | `SpanStyle(fontFamily = FontFamily.Monospace, background = Color(0xFF1E1E1E), color = Color.White)` |
| `CodeBlock` | InlineCode と同様(プレビュー用簡略表示) |
| `Mention` | `SpanStyle(color = primary)` + テキスト `@user` |
| `Hashtag` | `SpanStyle(color = primary)` + テキスト `#tag` |
| `Url` | `SpanStyle(color = primary, textDecoration = Underline)` |
| `Link` | `SpanStyle(color = primary, textDecoration = Underline)` |
| `UnicodeEmoji` | `append(emoji)` (Compose ネイティブで表示) |
| `EmojiCode` | `appendInlineContent(id)` + `InlineTextContent` に Coil 画像 |
| `Plain` | `append(children.text)` |
| `MathBlock` | `append(formula)` プレーンテキスト |
| `MathInline` | `append(formula)` プレーンテキスト |
| `Search` | `append("${query} Search")` |
| `Quote` | `SpanStyle(color = onSurfaceVariant)` + 先頭に `"│ "` プレフィックス |
| `Fn("x2")` | `SpanStyle(fontSize = base * 2f)` |
| `Fn("x3")` | `SpanStyle(fontSize = base * 3f)` |
| `Fn("x4")` | `SpanStyle(fontSize = base * 4f)` |
| `Fn("fg")` | `SpanStyle(color = parsedColor)` |
| `Fn("bg")` | `SpanStyle(background = parsedColor)` |
| `Fn("font")` | `SpanStyle(fontFamily = serif/monospace/cursive/fantasy)` |
| `Fn("unixtime")` | epoch 秒を日時文字列に変換して `append()` |
| `Fn("scale")` | `SpanStyle(fontSize = base * scaleY)` + 子ノードへ適用 |
### Compose では再現困難なため省略(子ノードのプレーンテキストにフォールバック)
| MfmNode | 理由 |
|---|---|
| `Fn("ruby")` | `ReplacementSpan` 相当の Layout 操作が必要 |
| `Fn("flip")` | Canvas の scale(-1, 1) が必要 |
| `Fn("rotate")` | Canvas の rotate() が必要 |
| `Fn("border")` | カスタム描画が必要 |
> 将来的に `drawBehind` + カスタム Layout で対応可能だが、プレビュー用途には不要。
---
## `NoteEditorReplyPreview.kt` の変更点
### Before
```kotlin
val text = note.text
if (!text.isNullOrEmpty()) {
Text(
text = text,
style = MaterialTheme.typography.bodySmall,
maxLines = 3,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
```
### After
```kotlin
val text = note.text
if (!text.isNullOrEmpty()) {
MfmText(
text = text,
emojiNameMap = replyTo.toShowNote.note.emojiNameMap ?: emptyMap(),
style = MaterialTheme.typography.bodySmall,
maxLines = 3,
overflow = TextOverflow.Ellipsis,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
}
```
---
## カスタム絵文字の処理方針
`CustomEmojiText.kt` と同じ方式:
1. `EmojiCode` ノードを検出した際、一意な ID(`:emoji_name:`)を `appendInlineContent(id, altText)` でプレースホルダーとして埋め込む
2. `emojiNameMap[name]` で `CustomEmoji` を解決し、URL を取得
3. `InlineTextContent` に Coil の `rememberAsyncImagePainter` を使って画像を配置
4. 解決できない場合は `:name:` テキストにフォールバック
---
## 注意事項
- `maxLines = 3` は Compose の `Text` がそのまま処理するため、長文でも行数制限は機能する
- `Fn("x2/x3/x4")` は本文内の一部テキストが極端に大きくなるため、プレビューでは `coerceAtMost(base * 1.5f)` のようなキャップを設ける(視覚的に崩れにくくする)
- `MFMParser.parse()` は IO でないが念のため `remember(text)` でキャッシュする
- `Color.parseColor()` は `android.graphics.Color` のため Compose の `Color` への変換が必要(`Color(androidColor.toULong())` ではなく `Color(androidColor)` で OK)
---
## 変更ファイル一覧
| ファイル | 変更種別 |
|---|---|
| `modules/common_android_ui/src/main/java/.../MfmText.kt` | **新規作成** |
| `modules/features/note/src/main/java/.../editor/NoteEditorReplyPreview.kt` | **変更** |
---
## 実装チェックリスト
- [ ] `MfmText.kt` 新規作成
- [ ] `buildMfmAnnotatedString` 内部関数(再帰ノード処理)
- [ ] テキスト装飾ノード対応(Bold / Italic / Strike / Small / Center)
- [ ] コードノード対応(InlineCode / CodeBlock)
- [ ] リンク系ノード対応(Mention / Hashtag / Url / Link)
- [ ] 絵文字ノード対応(UnicodeEmoji / EmojiCode + InlineTextContent)
- [ ] Fn ノード対応(x2/x3/x4 / fg / bg / font / unixtime / scale)
- [ ] フォールバック処理(ruby / flip / rotate / border → 子テキスト表示)
- [ ] `MfmText` コンポーザブル本体
- [ ] `NoteEditorReplyPreview.kt` 更新
- [ ] `MfmText` に差し替え
- [ ] `emojiNameMap` を `toShowNote.note.emojiNameMap` から取得
- [ ] ビルド確認(`./gradlew :modules:features:note:compileDebugKotlin`)
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Tue Jan 04 01:27:04 JST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
================================================
FILE: gradle.properties
================================================
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Wed Apr 07 16:56:23 JST 2021
android.useAndroidX=true
org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.parallel=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx4096M -Dkotlin.daemon.jvm.options\="-Xmx4096M"
VERSION_CODE=94
VERSION_NAME=v2.16.8
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
================================================
FILE: gradlew
================================================
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: libs.versions.toml
================================================
[versions]
mfm-kt = "0.2.3"
kotlin-version = "2.0.0"
date-time = "0.6.1"
compose = "1.7.1"
compose-material-icons = "1.7.1"
compose-material3 = "1.3.1"
activity-compose = "1.9.2"
coil = "2.4.0"
hilt = "2.56"
lifecycle = "2.8.5"
arch = "2.2.0"
glide = "4.14.2"
animation-apng = "3.0.5"
appcompat = "1.7.0"
material = "1.12.0"
core-ktx = "1.13.1"
fragment-ktx = "1.8.3"
activity-ktx = "1.9.2"
emoji2 = "1.5.0"
constraintlayout = "2.1.4"
viewpager2 = "1.1.0"
swiperefreshlayout = "1.1.0"
flexbox = "3.0.0"
okhttp3 = "4.12.0"
work = "2.9.1"
junit = "4.13.2"
test-espresso = "3.6.1"
appstartup = "1.1.1"
junit-jupiter-api = "5.9.3"
junit-jupiter-engine = "5.9.3"
robolectric = "4.13"
serialization = "1.7.3"
recyclerview = "1.3.2"
konfetti = "2.0.3"
compose-constraintlayout = "1.0.1"
room = "2.7.0"
retrofit = "2.11.0"
coroutines = "1.8.1"
nav = "2.8.0"
firebase-bom = "33.12.0"
[libraries]
kotlin-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "date-time" }
# Compose libs
compose-ui-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-ui-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
compose-foundation-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-material-material = { module = "androidx.compose.material:material", version.ref = "compose" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
compose-material-material-icons-core = { module = "androidx.compose.material:material-icons-core", version.ref = "compose-material-icons" }
compose-material-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "compose-material-icons" }
compose-ui-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "compose" }
compose-runtime-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata", version.ref = "compose" }
# Accompanist and other libraries
activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
coil-gif = { module = "io.coil-kt:coil-gif", version.ref = "coil" }
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coil" }
compose-constraintlayout = { module = "androidx.constraintlayout:constraintlayout-compose", version.ref = "compose-constraintlayout" }
# Hilt
hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-compiler = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" }
hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" }
# Lifecycle and Arch
lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime", version.ref = "lifecycle" }
lifecycle-compiler = { module = "androidx.lifecycle:lifecycle-compiler", version.ref = "lifecycle" }
arch-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "arch" }
lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version = "2.5.1" }
lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version = "2.5.1" }
# Glide
glide-glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-compiler = { module = "com.github.bumptech.glide:compiler", version.ref = "glide" }
# Emoji2
androidx-emoji2 = { module = "androidx.emoji2:emoji2", version.ref = "emoji2" }
androidx-emoji2-bundled = { module = "androidx.emoji2:emoji2-bundled", version.ref = "emoji2" }
# Additional libraries
android-material-compose-theme-adapter = { module = "com.google.android.material:compose-theme-adapter", version = "1.1.16" }
android-material-material = { module = "com.google.android.material:material", version.ref = "material" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
appcompat-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragment-ktx" }
activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activity-ktx" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "viewpager2" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
flexbox = { module = "com.google.android.flexbox:flexbox", version.ref = "flexbox" }
okhttp3-logging-inspector = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp3" }
okhttp-sse = { module = "com.squareup.okhttp3:okhttp-sse", version.ref = "okhttp3" }
androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version = "1.2.0" }
androidx-work-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "work" }
hilt-work = { module = "androidx.hilt:hilt-work", version = "1.2.0" }
androidx-hilt-compiler = { module = "androidx.hilt:hilt-compiler", version = "1.2.0" }
# Test libraries
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version = "1.1.4" }
junit = { module = "junit:junit", version.ref = "junit" }
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "test-espresso" }
# App Startup
androidx-appstartup = { module = "androidx.startup:startup-runtime", version.ref = "appstartup" }
# JUnit Jupiter
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit-jupiter-api" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter-engine" }
# Additional dependencies
konfetti = { module = "nl.dionsegijn:konfetti-xml", version.ref = "konfetti" }
animation-apng = { module = "com.github.penfeizhou.android.animation:apng", version.ref = "animation-apng" }
recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
accompanist-glide = { module = "com.google.accompanist:accompanist-glide", version = "0.14.0" }
wada811-databinding = { module = "com.github.wada811:DataBinding-ktx", version = "5.0.2" }
# Room
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
room-testing = { module = "androidx.room:room-testing", version.ref = "room" }
# Retrofit
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
retrofit-serialization-converter = { module = "com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter", version = "1.0.0" }
# Coroutines
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
# Firebase
firebase-bom = { module = "com.google.firebase:firebase-bom", version.ref = "firebase-bom" }
# Navigation
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "nav" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "nav" }
navigation-dynamic-features = { module = "androidx.navigation:navigation-dynamic-features-fragment", version.ref = "nav" }
navigation-testing = { module = "androidx.navigation:navigation-testing", version.ref = "nav" }
navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "nav" }
# MFM parser
mfm-kt = { module = "com.github.pantasystem:mfm-kt", version.ref = "mfm-kt" }
# Kotlin reflect
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-version" }
[plugins]
kotlin-serialization-plugin = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version" }
android-application = { id = "com.android.application", version = "8.7.3" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-version" }
dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
android-test = { id = "com.android.test", version = "8.7.3" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin-version" }
================================================
FILE: modules/api/.gitignore
================================================
/build
================================================
FILE: modules/api/build.gradle
================================================
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
alias libs.plugins.kotlin.serialization.plugin
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
compileSdk 35
defaultConfig {
minSdk 21
targetSdk 35
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
// for junit5
testOptions {
unitTests.all {
useJUnitPlatform()
}
}
namespace 'net.pantasystem.milktea.api'
}
dependencies {
implementation libs.androidx.core.ktx
implementation libs.appcompat.appcompat
implementation libs.android.material.material
implementation project(path: ':modules:model')
implementation project(path: ':modules:common')
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso.core
implementation libs.retrofit.serialization.converter
implementation libs.kotlin.serialization
implementation libs.kotlin.datetime
// hilt
implementation libs.hilt.android
kapt libs.hilt.compiler
androidTestImplementation libs.hilt.android.testing
kaptAndroidTest libs.hilt.compiler
testImplementation libs.hilt.android.testing
kaptTest libs.hilt.compiler
testImplementation libs.junit.jupiter.api
testRuntimeOnly libs.junit.jupiter.engine
}
================================================
FILE: modules/api/consumer-rules.pro
================================================
================================================
FILE: modules/api/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
================================================
FILE: modules/api/src/main/AndroidManifest.xml
================================================
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/activitypub/NodeInfoAPI.kt
================================================
package net.pantasystem.milktea.api.activitypub
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Url
interface NodeInfoAPI {
@GET
suspend fun getNodeInfo(@Url url: String): Response
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/activitypub/NodeInfoDTO.kt
================================================
package net.pantasystem.milktea.api.activitypub
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class NodeInfoDTO(
@SerialName("version")
val version: String,
@SerialName("software")
val software: SoftwareDTO
) {
@kotlinx.serialization.Serializable
data class SoftwareDTO(
@SerialName("name")
val name: String,
@SerialName("version")
val version: String,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/activitypub/WellKnownNodeInfo.kt
================================================
package net.pantasystem.milktea.api.activitypub
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class WellKnownNodeInfo(
@SerialName("links")
val links: List
) {
@kotlinx.serialization.Serializable
data class Link(
@SerialName("rel")
val rel: String,
@SerialName("href")
val href: String,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/activitypub/WellKnownNodeInfoAPI.kt
================================================
package net.pantasystem.milktea.api.activitypub
import retrofit2.Response
import retrofit2.http.GET
interface WellKnownNodeInfoAPI {
@GET(".well-known/nodeinfo")
suspend fun getWellKnownNodeInfo(): Response
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/MastodonAPI.kt
================================================
package net.pantasystem.milktea.api.mastodon
import net.pantasystem.milktea.api.mastodon.accounts.FollowParamsRequest
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountRelationshipDTO
import net.pantasystem.milktea.api.mastodon.accounts.MuteAccountRequest
import net.pantasystem.milktea.api.mastodon.apps.AccessToken
import net.pantasystem.milktea.api.mastodon.apps.App
import net.pantasystem.milktea.api.mastodon.apps.CreateApp
import net.pantasystem.milktea.api.mastodon.apps.ObtainToken
import net.pantasystem.milktea.api.mastodon.context.ContextDTO
import net.pantasystem.milktea.api.mastodon.emojis.TootEmojiDTO
import net.pantasystem.milktea.api.mastodon.filter.V1FilterDTO
import net.pantasystem.milktea.api.mastodon.instance.Instance
import net.pantasystem.milktea.api.mastodon.list.AddAccountsToList
import net.pantasystem.milktea.api.mastodon.list.CreateListRequest
import net.pantasystem.milktea.api.mastodon.list.ListDTO
import net.pantasystem.milktea.api.mastodon.list.RemoveAccountsFromList
import net.pantasystem.milktea.api.mastodon.marker.MarkersDTO
import net.pantasystem.milktea.api.mastodon.marker.SaveMarkersRequest
import net.pantasystem.milktea.api.mastodon.media.TootMediaAttachment
import net.pantasystem.milktea.api.mastodon.media.UpdateMediaAttachment
import net.pantasystem.milktea.api.mastodon.notification.MstNotificationDTO
import net.pantasystem.milktea.api.mastodon.poll.TootPollDTO
import net.pantasystem.milktea.api.mastodon.report.CreateReportRequest
import net.pantasystem.milktea.api.mastodon.report.MstReportDTO
import net.pantasystem.milktea.api.mastodon.rule.RuleDTO
import net.pantasystem.milktea.api.mastodon.search.SearchResponse
import net.pantasystem.milktea.api.mastodon.status.CreateStatus
import net.pantasystem.milktea.api.mastodon.status.ScheduledStatus
import net.pantasystem.milktea.api.mastodon.status.TootStatusDTO
import net.pantasystem.milktea.api.mastodon.subscription.SubscribePushNotification
import net.pantasystem.milktea.api.mastodon.subscription.WebPushSubscription
import net.pantasystem.milktea.api.mastodon.suggestion.SuggestionDTO
import net.pantasystem.milktea.api.mastodon.tag.MastodonTagDTO
import retrofit2.Response
import retrofit2.http.*
interface MastodonAPI {
@GET("api/v1/instance")
suspend fun getInstance(): Instance
@GET("api/v1/custom_emojis")
suspend fun getCustomEmojis(): Response>
@POST("api/v1/apps")
suspend fun createApp(@Body body: CreateApp): Response
@POST("oauth/token")
suspend fun obtainToken(@Body body: ObtainToken): Response
@GET("api/v1/accounts/verify_credentials")
suspend fun verifyCredentials(): Response
/**
* @param visibilities fedibirdの独自パラメータ
*/
@GET("api/v1/timelines/public")
suspend fun getPublicTimeline(
@Query("local") local: Boolean = false,
@Query("remote") remote: Boolean = false,
@Query("only_media") onlyMedia: Boolean = false,
@Query("max_id") maxId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("min_id") minId: String? = null,
@Query("limit") limit: Int = 20,
@Query("visibilities[]", encoded = true) visibilities: List? = null,
): Response>
@GET("api/v1/timelines/tag/{tag}")
suspend fun getHashtagTimeline(
@Path("tag") tag: String,
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("only_media") onlyMedia: Boolean = false,
): Response>
/**
* @param visibilities fedibirdの独自パラメータ
*/
@GET("api/v1/timelines/home")
suspend fun getHomeTimeline(
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("visibilities[]", encoded = true) visibilities: List? = null,
): Response>
@GET("api/v1/timelines/list/{listId}")
suspend fun getListTimeline(
@Path("listId") listId: String,
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
): Response>
@POST("api/v1/statuses/{statusId}/reblog")
suspend fun reblog(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/unreblog")
suspend fun unreblog(@Path("statusId") statusId: String): Response
@GET("api/v1/accounts/{accountId}/followers")
suspend fun getFollowers(
@Path("accountId") accountId: String,
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("limit") limit: Int = 40,
): Response>
@GET("api/v1/accounts/{accountId}/following")
suspend fun getFollowing(
@Path("accountId") accountId: String,
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("limit") limit: Int = 40,
): Response>
@GET("api/v1/accounts/{accountId}")
suspend fun getAccount(@Path("accountId") accountId: String): Response
@GET("api/v1/accounts/relationships")
suspend fun getAccountRelationships(
@Query(
"id[]",
encoded = true
) ids: List,
): Response>
@POST("api/v1/accounts/{accountId}/follow")
suspend fun follow(@Path("accountId") accountId: String, @Body params: FollowParamsRequest): Response
@POST("api/v1/accounts/{accountId}/unfollow")
suspend fun unfollow(@Path("accountId") accountId: String): Response
@PUT("api/v1/statuses/{statusId}/emoji_reactions/{emoji}")
suspend fun reaction(
@Path("statusId") statusId: String,
@Path("emoji") emoji: String,
): Response
@DELETE("api/v1/statuses/{statusId}/emoji_reactions/{emoji}")
suspend fun deleteReaction(
@Path("statusId") statusId: String,
@Path("emoji") emoji: String,
): Response
@POST("api/v1/statuses/{statusId}/emoji_unreaction")
suspend fun unreaction(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/favourite")
suspend fun favouriteStatus(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/unfavourite")
suspend fun unfavouriteStatus(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/bookmark")
suspend fun bookmarkStatus(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/unbookmark")
suspend fun unbookmarkStatus(@Path("statusId") statusId: String): Response
@GET("api/v1/favourites")
suspend fun getFavouriteStatuses(
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
): Response>
@POST("api/v1/accounts/{accountId}/mute")
suspend fun muteAccount(
@Path("accountId") accountId: String,
@Body body: MuteAccountRequest,
): Response
@POST("api/v1/accounts/{accountId}/unmute")
suspend fun unmuteAccount(@Path("accountId") accountId: String): Response
@POST("api/v1/accounts/{accountId}/block")
suspend fun blockAccount(@Path("accountId") accountId: String): Response
@POST("api/v1/accounts/{accountId}/unblock")
suspend fun unblockAccount(@Path("accountId") accountId: String): Response
@GET("api/v1/notifications")
suspend fun getNotifications(
@Query("min_id") minId: String? = null,
@Query("max_id") maxId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("limit") limit: Int? = null,
@Query("types[]", encoded = true) types: List? = null,
@Query("exclude_types[]", encoded = true) excludeTypes: List? = null,
@Query("account_id") accountId: String? = null,
): Response>
@POST("api/v1/push/subscription")
suspend fun subscribePushNotification(@Body body: SubscribePushNotification): Response
@DELETE("api/v1/push/subscription")
suspend fun unSubscribePushNotification(): Response
@POST("api/v1/statuses")
suspend fun createStatus(
@Body body: CreateStatus,
): Response
@POST("api/v1/status")
suspend fun createScheduledStatus(
@Body body: CreateStatus,
): Response
@GET("api/v1/statuses/{statusId}")
suspend fun getStatus(@Path("statusId") statusId: String): Response
@DELETE("api/v1/statuses/{statusId}")
suspend fun deleteStatus(@Path("statusId") statusId: String): Response
@POST("api/v1/polls/{pollId}/votes")
suspend fun voteOnPoll(
@Path("pollId") pollId: String,
@Field("choices[]", encoded = true) choices: List,
): Response
@POST("api/v1/statuses/{statusId}/mute")
suspend fun muteConversation(@Path("statusId") statusId: String): Response
@POST("api/v1/statuses/{statusId}/unmute")
suspend fun unmuteConversation(@Path("statusId") statusId: String): Response
@GET("api/v1/accounts/{accountId}/statuses")
suspend fun getAccountTimeline(
@Path("accountId") accountId: String,
@Query("only_media") onlyMedia: Boolean? = false,
@Query("max_id") maxId: String? = null,
@Query("min_id") minId: String? = null,
@Query("limit") limit: Int = 20,
@Query("exclude_reblogs") excludeReblogs: Boolean? = null,
@Query("exclude_replies") excludeReplies: Boolean? = null,
): Response>
@GET("api/v1/bookmarks")
suspend fun getBookmarks(
@Query("max_id") maxId: String? = null,
@Query("min_id") minId: String? = null,
@Query("limit") limit: Int = 20,
): Response>
@GET("api/v1/lists")
suspend fun getMyLists(): Response>
@POST("api/v1/lists")
suspend fun createList(@Body body: CreateListRequest): Response
@GET("api/v1/lists/{listId}")
suspend fun getList(@Path("listId") listId: String): Response
@POST("api/v1/lists/{listId}/accounts")
suspend fun addAccountsToList(
@Path("listId") listId: String,
@Body body: AddAccountsToList,
): Response
@DELETE("api/v1/lists/{listId}/accounts")
suspend fun removeAccountsFromList(
@Path("listId") listId: String,
@Body body: RemoveAccountsFromList,
): Response
@GET("api/v1/lists/{listId}")
suspend fun getAccountsInList(
@Path("listId") listId: String,
@Query("max_id") maxId: String? = null,
@Query("min_id") minId: String? = null,
): Response>
@GET("api/v1/statuses/{statusId}/context")
suspend fun getStatusesContext(@Path("statusId") statusId: String): Response
@PUT("api/v1/media/{mediaId}")
suspend fun updateMediaAttachment(
@Path("mediaId") mediaId: String,
@Body body: UpdateMediaAttachment,
): Response
@GET("api/v2/search")
suspend fun search(
@Query("q") q: String,
@Query("type") type: String? = null,
@Query("resolve") resolve: Boolean = true,
@Query("following") following: Boolean = false,
@Query("account_id") accountId: String? = null,
@Query("exclude_unreviewed") excludeUnreviewed: String? = null,
@Query("max_id") maxId: String? = null,
@Query("min_id") minId: String? = null,
@Query("limit") limit: Int? = null,
@Query("offset") offset: Int? = null,
): Response
@POST("api/v1/follow_requests/{accountId}/authorize")
suspend fun acceptFollowRequest(@Path("accountId") accountId: String): Response
@POST("api/v1/follow_requests/{accountId}/reject")
suspend fun rejectFollowRequest(@Path("accountId") accountId: String): Response
@GET("api/v1/follow_requests")
suspend fun getFollowRequests(
@Query("max_id") maxId: String? = null,
@Query("min_id") minId: String? = null,
): Response>
@GET("api/v1/markers")
suspend fun getMarkers(
@Query("timeline[]", encoded = true) timeline: List,
): Response
@POST("api/v1/markers")
suspend fun saveMarkers(
@Body markers: SaveMarkersRequest,
): Response
@GET("api/v1/filters")
suspend fun getFilters(): Response>
@POST("api/v1/reports")
suspend fun createReport(@Body request: CreateReportRequest): Response
@GET("api/v1/instance/rules")
suspend fun getRules(): Response>
@GET("api/v1/statuses/{id}/reblogged_by")
suspend fun getRebloggedBy(
@Path("id") id: String,
@Query("max_id") maxId: String? = null,
@Query("since_id") sinceId: String? = null,
@Query("min_id") minId: String? = null,
): Response>
@GET("api/v1/trends/statuses")
suspend fun getTrendStatuses(
@Query("limit") limit: Int? = null,
@Query("offset") offset: Int? = null,
): Response>
@GET("api/v1/trends/tags")
suspend fun getTagTrends(
@Query("limit") limit: Int? = null,
@Query("offset") offset: Int? = null,
): Response>
@GET("api/v2/suggestions")
suspend fun getSuggestionUsers(
@Query("limit") limit: Int? = null
): Response>
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/accounts/FollowParamsRequest.kt
================================================
package net.pantasystem.milktea.api.mastodon.accounts
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class FollowParamsRequest(
@SerialName("reblogs") val reblogs: Boolean? = null,
@SerialName("notify") val notify: Boolean? = null,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/accounts/MastodonAccountDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.accounts
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.pantasystem.milktea.api.mastodon.emojis.TootEmojiDTO
@Serializable
data class MastodonAccountDTO(
@SerialName("id")
val id: String,
@SerialName("username")
val username: String,
@SerialName("acct")
val acct: String,
@SerialName("display_name")
val displayName: String,
@SerialName("locked")
val locked: Boolean,
@SerialName("bot")
val bot: Boolean,
@SerialName("created_at")
val createdAt: Instant,
@SerialName("note")
val note: String,
@SerialName("url")
val url: String,
@SerialName("avatar")
val avatar: String,
@SerialName("avatar_static")
val avatarStatic: String,
@SerialName("header")
val header: String,
@SerialName("header_static")
val headerStatic: String,
@SerialName("emojis")
val emojis: List,
@SerialName("followers_count")
val followersCount: Long,
@SerialName("following_count")
val followingCount: Long,
@SerialName("statuses_count")
val statusesCount: Long,
)
@Serializable
data class MastodonAccountRelationshipDTO(
@SerialName("id")
val id: String,
@SerialName("following")
val following: Boolean,
@SerialName("showing_reblogs")
val showingReblogs: Boolean? = null,
@SerialName("notifying")
val notifying: Boolean? = null,
@SerialName("followed_by")
val followedBy: Boolean,
@SerialName("blocking")
val blocking: Boolean,
@SerialName("blocked_by")
val blockedBy: Boolean,
@SerialName("muting")
val muting: Boolean,
@SerialName("muting_notifications")
val mutingNotifications: Boolean,
@SerialName("requested")
val requested: Boolean,
@SerialName("domain_blocking")
val domainBlocking: Boolean,
@SerialName("endorsed")
val endorsed: Boolean,
@SerialName("note")
val note: String,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/accounts/MuteAccountRequest.kt
================================================
package net.pantasystem.milktea.api.mastodon.accounts
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class MuteAccountRequest(
@SerialName("duration")
val duration: Long = 0L,
@SerialName("notifications")
val notifications: Boolean = true
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/apps/App.kt
================================================
package net.pantasystem.milktea.api.mastodon.apps
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.pantasystem.milktea.model.app.AppType
@Serializable
data class CreateApp(
@SerialName("client_name")
val clientName: String,
@SerialName("redirect_uris")
val redirectUris: String,
@SerialName("scopes")
val scopes: String
)
@Serializable
data class App(
@SerialName("id")
val id: String,
@SerialName("name")
val name: String,
@SerialName("client_id")
val clientId: String,
@SerialName("redirect_uri")
val redirectUri: String,
@SerialName("client_secret")
val clientSecret: String,
) {
fun toModel(): AppType.Mastodon {
return AppType.Mastodon(
id = id,
name = name,
clientSecret = clientSecret,
clientId = clientId,
redirectUri = redirectUri,
)
}
fun toPleromaModel() : AppType.Pleroma {
return AppType.Pleroma(
id = id,
name = name,
clientSecret = clientSecret,
clientId = clientId,
redirectUri = redirectUri,
)
}
}
@Serializable
data class ObtainToken(
@SerialName("client_id")
val clientId: String,
@SerialName("client_secret")
val clientSecret: String,
@SerialName("redirect_uri")
val redirectUri: String,
@SerialName("scope")
val scope: String,
@SerialName("code")
val code: String,
@SerialName("grant_type")
val grantType: String,
)
@Serializable
data class AccessToken(
@SerialName("access_token")
val accessToken: String,
@SerialName("token_type")
val tokenType: String,
@SerialName("scope")
val scope: String,
@SerialName("created_at")
val createdAt: Long
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/context/ContextDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.context
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.status.TootStatusDTO
@kotlinx.serialization.Serializable
data class ContextDTO (
@SerialName("ancestors")
val ancestors: List,
@SerialName("descendants")
val descendants: List
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/emojis/TootEmojiDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.emojis
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.pantasystem.milktea.model.emoji.CustomEmoji
import net.pantasystem.milktea.model.emoji.EmojiWithAlias
@Serializable
data class TootEmojiDTO(
@SerialName("shortcode")
val shortcode: String,
@SerialName("url")
val url: String,
@SerialName("static_url")
val staticUrl: String,
@SerialName("category")
val category: String? = null,
@SerialName("visible_in_picker")
val visibleInPicker: Boolean = true,
@SerialName("width")
val width: Int? = null,
@SerialName("height")
val height: Int? = null,
@SerialName("aliases")
val aliases: List? = null,
) {
fun toEmojiWithAlias(cachePath: String? = null): EmojiWithAlias {
val emoji = toEmoji(cachePath)
return EmojiWithAlias(
emoji = emoji,
aliases = aliases?.filterNotNull(),
)
}
fun toEmoji(cachePath: String? = null): CustomEmoji {
return CustomEmoji(
name = shortcode,
url = url,
category = category,
aspectRatio = if (width == null || height == null) null else (width.toFloat() / height),
cachePath = cachePath,
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/filter/FilterContext.kt
================================================
package net.pantasystem.milktea.api.mastodon.filter
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
enum class FilterContext {
@SerialName("home") Home,
@SerialName("notifications") Notifications,
@SerialName("public") Public,
@SerialName("thread") Thread,
@SerialName("account") Account,
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/filter/FilterResultDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.filter
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class FilterResultDTO(
@SerialName("filter")
val filter: HitFilter,
@SerialName("keyword_matches")
val keywordMatches: List? = null,
@SerialName("status_matches")
val statusMatches: List? = null,
) {
@kotlinx.serialization.Serializable
data class HitFilter(
@SerialName("id")
val id: String,
@SerialName("title")
val title: String,
@SerialName("context")
val context: List,
@SerialName("filter_action")
val filterAction: V2FilterDTO.FilterAction,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/filter/V1FilterDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.filter
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.filter.MastodonWordFilter
@kotlinx.serialization.Serializable
data class V1FilterDTO(
@SerialName("id")
val id: String,
@SerialName("phrase")
val phrase: String,
@SerialName("context")
val context: List,
@SerialName("whole_word")
val wholeWord: Boolean,
@SerialName("expires_at")
val expiresAt: Instant? = null,
@SerialName("irreversible")
val irreversible: Boolean,
) {
fun toModel(account: Account): MastodonWordFilter {
return MastodonWordFilter(
MastodonWordFilter.Id(account.accountId, id),
phrase,
context = context.map {
when(it) {
FilterContext.Home -> MastodonWordFilter.FilterContext.Home
FilterContext.Notifications -> MastodonWordFilter.FilterContext.Notifications
FilterContext.Public -> MastodonWordFilter.FilterContext.Public
FilterContext.Thread -> MastodonWordFilter.FilterContext.Thread
FilterContext.Account -> MastodonWordFilter.FilterContext.Account
}
},
wholeWord,
expiresAt,
irreversible
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/filter/V2FilterDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.filter
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class V2FilterDTO(
@SerialName("id")
val id: String,
@SerialName("title")
val title: String,
@SerialName("context")
val context: List,
@SerialName("expires_at")
val expiresAt: Instant? = null,
@SerialName("filter_action")
val filterAction: FilterAction,
@SerialName("keywords")
val keywords: List,
@SerialName("statuses")
val statuses: List,
) {
@kotlinx.serialization.Serializable
enum class FilterAction {
@SerialName("warn")
Warn,
@SerialName("hide")
Hide
}
@kotlinx.serialization.Serializable
data class FilterKeyword(
@SerialName("id")
val id: String,
@SerialName("keyword")
val keyword: String,
@SerialName("whole_word")
val wholeWord: Boolean,
)
@kotlinx.serialization.Serializable
data class FilterStatus(
@SerialName("id")
val id: String,
@SerialName("status_id")
val statusId: String
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/instance/Instance.kt
================================================
package net.pantasystem.milktea.api.mastodon.instance
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Instance(
@SerialName("uri")
val uri: String,
@SerialName("title")
val title: String,
@SerialName("description")
val description: String,
@SerialName("email")
val email: String,
@SerialName("version")
val version: String,
@SerialName("urls")
val urls: Urls,
@SerialName("configuration")
val configuration: Configuration? = null,
@SerialName("fedibird_capabilities")
val fedibirdCapabilities: List? = null,
@SerialName("pleroma")
val pleroma: Pleroma? = null,
@SerialName("feature_quote")
val featureQuote: Boolean? = null,
) {
@Serializable
data class Configuration(
@SerialName("statuses")
val statuses: Statuses? = null,
@SerialName("polls")
val polls: Polls? = null,
@SerialName("emoji_reactions")
val emojiReactions: EmojiReactions? = null,
) {
@Serializable
data class Statuses(
@SerialName("max_characters") val maxCharacters: Int? = null,
@SerialName("max_media_attachments") val maxMediaAttachments: Int? = null,
)
@Serializable
data class Polls(
@SerialName("max_options") val maxOptions: Int? = null,
@SerialName("max_characters_per_option") val maxCharactersPerOption: Int? = null,
@SerialName("min_expiration") val minExpiration: Int? = null,
@SerialName("max_expiration") val maxExpiration: Int? = null,
)
@Serializable
data class EmojiReactions(
@SerialName("max_reactions") val maxReactions: Int? = null,
@SerialName("max_reactions_per_account") val maxReactionsPerAccount: Int? = null,
)
}
@Serializable
data class Urls(
@SerialName("streaming_api") val streamingApi: String
)
@Serializable
data class Pleroma(
@SerialName("metadata") val metadata: Metadata,
) {
@Serializable
data class Metadata(
@SerialName("features") val features: List,
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/list/AddAccountsToList.kt
================================================
package net.pantasystem.milktea.api.mastodon.list
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class AddAccountsToList(
@SerialName("account_ids") val accountIds: List
)
typealias RemoveAccountsFromList = AddAccountsToList
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/list/CreateListRequest.kt
================================================
package net.pantasystem.milktea.api.mastodon.list
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class CreateListRequest(
@SerialName("title") val title: String,
@SerialName("replies_policy") val repliesPolicy: ListDTO.RepliesPolicyType
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/list/ListDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.list
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.model.account.Account
import net.pantasystem.milktea.model.list.UserList
@kotlinx.serialization.Serializable
data class ListDTO(
@SerialName("id")
val id: String,
@SerialName("title")
val title: String,
@SerialName("replies_policy")
val repliesPolicy: RepliesPolicyType
) {
@kotlinx.serialization.Serializable
enum class RepliesPolicyType {
@SerialName("followed") Followed,
@SerialName("list") List,
@SerialName("none") None,
}
fun toModel(account: Account): UserList {
return UserList(
id = UserList.Id(accountId = account.accountId, id),
createdAt = Instant.fromEpochMilliseconds(Long.MAX_VALUE),
name = title,
userIds = emptyList()
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/marker/MarkerDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.marker
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.model.markers.Marker
@kotlinx.serialization.Serializable
data class MarkerDTO(
@SerialName("last_read_id") val lastReadId: String,
@SerialName("version") val version: Long,
@SerialName("updated_at") val updatedAt: Instant
) {
fun toModel(): Marker {
return Marker(
lastReadId = lastReadId,
version = version,
updatedAt = updatedAt
)
}
}
@kotlinx.serialization.Serializable
data class MarkersDTO(
@SerialName("home")
val home: MarkerDTO? = null,
@SerialName("notifications")
val notifications: MarkerDTO? = null,
)
@kotlinx.serialization.Serializable
data class SaveMarkersRequest(
@SerialName("home")
val home: SaveParams? = null,
@SerialName("notifications")
val notifications: SaveParams? = null,
) {
@kotlinx.serialization.Serializable
data class SaveParams(
@SerialName("last_read_id") val lastReadId: String
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/media/TootMediaAttachment.kt
================================================
package net.pantasystem.milktea.api.mastodon.media
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class TootMediaAttachment(
@SerialName("id")
val id: String,
@SerialName("type")
val type: String,
@SerialName("url")
val url: String?,
@SerialName("preview_url")
val previewUrl: String? = null,
@SerialName("remote_url")
val remoteUrl: String? = null,
@SerialName("description")
val description: String? = null,
@SerialName("blurhash")
val blurhash: String? = null,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/media/UpdateMediaAttachment.kt
================================================
package net.pantasystem.milktea.api.mastodon.media
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class UpdateMediaAttachment(
@SerialName("description")
val description: String,
@SerialName("focus")
val focus: String
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/notification/MstNotificationDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.notification
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
import net.pantasystem.milktea.api.mastodon.report.MstReportDTO
import net.pantasystem.milktea.api.mastodon.status.TootStatusDTO
@kotlinx.serialization.Serializable
data class MstNotificationDTO(
@SerialName("id")
val id: String,
@SerialName("type")
val type: NotificationType,
@SerialName("created_at")
val createdAt: Instant,
@SerialName("account")
val account: MastodonAccountDTO,
@SerialName("status")
val status: TootStatusDTO? = null,
@SerialName("report")
val report: MstReportDTO? = null,
@SerialName("emoji_reaction")
val emojiReaction: EmojiReaction? = null,
) {
@kotlinx.serialization.Serializable
enum class NotificationType(
val value: String
) {
@SerialName("mention")
Mention("mention"),
@SerialName("status")
Status("status"),
@SerialName("reblog")
Reblog("reblog"),
@SerialName("follow")
Follow("follow"),
@SerialName("follow_request")
FollowRequest("follow_request"),
@SerialName("favourite")
Favourite("favourite"),
@SerialName("poll")
Poll("poll"),
@SerialName("update")
Update("update"),
@SerialName("admin.sign_up")
AdminSingUp("admin.sign_up"),
@SerialName("admin.report")
AdminReport("admin.report"),
@SerialName("emoji_reaction")
EmojiReaction("emoji_reaction"),
}
@kotlinx.serialization.Serializable
data class EmojiReaction(
@SerialName("name")
val name: String,
@SerialName("count")
val count: Int,
@SerialName("me")
val me: Boolean? = null,
@SerialName("url")
val url: String? = null,
@SerialName("domain")
val domain: String? = null,
@SerialName("static_url")
val staticUrl: String? = null,
) {
private val isCustomEmoji = url != null || staticUrl != null
val reaction = if (isCustomEmoji) {
if (domain == null) {
":$name@.:"
} else {
":$name@$domain:"
}
} else {
name
}
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/poll/TootPollDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.poll
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.emojis.TootEmojiDTO
@kotlinx.serialization.Serializable
data class TootPollDTO(
@SerialName("id")
val id: String,
@SerialName("expires_at")
val expiresAt: Instant? = null,
@SerialName("expired")
val expired: Boolean? = null,
@SerialName("multiple")
val multiple: Boolean? = null,
@SerialName("votes_count")
val votesCount: Int? = null,
@SerialName("voters_count")
val votersCount: Int? = null,
@SerialName("options")
val options: List,
@SerialName("emojis")
val emojis: List,
@SerialName("voted")
val voted: Boolean? = null,
@SerialName("own_votes")
val ownVotes: List? = null,
) {
@kotlinx.serialization.Serializable
data class Option(
@SerialName("title")
val title: String,
@SerialName("votes_count")
val votesCount: Int? = null,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/report/CreateReportRequest.kt
================================================
package net.pantasystem.milktea.api.mastodon.report
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class CreateReportRequest(
@SerialName("account_id") val accountId: String,
@SerialName("status_ids") val statusIds: List,
@SerialName("comment") val comment: String? = null,
@SerialName("forward") val forward: Boolean = false,
@SerialName("category") val category: Category = Category.Other,
@SerialName("rule_ids") val ruleIds: List? = null,
) {
@kotlinx.serialization.Serializable
enum class Category {
@SerialName("spam") Spam,
@SerialName("violation") Violation,
@SerialName("other") Other,
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/report/MstReportDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.report
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
@kotlinx.serialization.Serializable
data class MstReportDTO(
@SerialName("id")
val id: String,
@SerialName("action_taken")
val actionTaken: Boolean? = null,
@SerialName("action_taken_at")
val actionTakenAt: Instant? = null,
@SerialName("category")
val category: String? = null,
@SerialName("comment")
val comment: String? = null,
@SerialName("forwarded")
val forwarded: Boolean? = null,
@SerialName("created_at")
val createdAt: Instant? = null,
@SerialName("status_ids")
val statusIds: List? = null,
@SerialName("rule_ids")
val ruleIds: List? = null,
@SerialName("target_account")
val targetAccount: MastodonAccountDTO? = null
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/rule/RuleDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.rule
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class RuleDTO(
@SerialName("id") val id: String,
@SerialName("text") val text: String,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/search/SearchResponse.kt
================================================
package net.pantasystem.milktea.api.mastodon.search
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
import net.pantasystem.milktea.api.mastodon.status.TootStatusDTO
import net.pantasystem.milktea.api.mastodon.tag.MastodonTagDTO
@kotlinx.serialization.Serializable
data class SearchResponse(
@SerialName("accounts")
val accounts: List,
@SerialName("statuses")
val statuses: List,
@SerialName("hashtags")
val hashtags: List,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/status/CreateStatus.kt
================================================
package net.pantasystem.milktea.api.mastodon.status
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class CreateStatus(
@SerialName("status")
val status: String,
@SerialName("media_ids")
val mediaIds: List,
@SerialName("poll")
val poll: CreatePoll? = null,
@SerialName("in_reply_to_id")
val inReplyToId: String? = null,
@SerialName("sensitive")
val sensitive: Boolean = false,
@SerialName("spoiler_text")
val spoilerText: String? = null,
@SerialName("visibility")
val visibility: String = "public",
@SerialName("language")
val language: String? = null,
@SerialName("scheduled_at")
val scheduledAt: Instant? = null,
@SerialName("quote_id")
val quoteId: String? = null,
) {
@kotlinx.serialization.Serializable
data class CreatePoll(
@SerialName("options")
val options: List,
@SerialName("expires_in")
val expiresIn: Int,
@SerialName("multiple")
val multiple: Boolean = false,
@SerialName("hide_totals")
val hideTotals: Boolean = false,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/status/ScheduledStatus.kt
================================================
package net.pantasystem.milktea.api.mastodon.status
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.media.TootMediaAttachment
@kotlinx.serialization.Serializable
data class ScheduledStatus(
@SerialName("id")
val id: String,
@SerialName("scheduled_at")
val scheduledAt: Instant,
@SerialName("params")
val params: Params,
@SerialName("media_attachments")
val mediaAttachments: List? = null
) {
@kotlinx.serialization.Serializable
data class Params(
@SerialName("text")
val text: String,
@SerialName("poll")
val poll: CreateStatus.CreatePoll? = null,
@SerialName("media_ids")
val mediaIds: List? = null,
@SerialName("sensitive")
val sensitive: Boolean? = null,
@SerialName("spoiler_text")
val spoilerText: String? = null,
@SerialName("visibility")
val visibility: String,
@SerialName("in_reply_to_id")
val inReplyToId: String? = null,
@SerialName("language")
val language: String? = null,
@SerialName("application_id")
val applicationId: Int? = null,
@SerialName("scheduled_at")
val scheduledAt: Instant? = null,
@SerialName("with_rate_limit")
val withRateLimit: Boolean? = null,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/status/TootPreviewCardDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.status
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class TootPreviewCardDTO(
@SerialName("url")
val url: String,
@SerialName("title")
val title: String,
@SerialName("type")
val type: String,
@SerialName("description")
val description: String,
@SerialName("author_name")
val authorName: String? = null,
@SerialName("author_url")
val authorUrl: String? = null,
@SerialName("provider_url")
val providerUrl: String,
@SerialName("html")
val html: String? = null,
@SerialName("width")
val width: Int? = null,
@SerialName("height")
val height: Int? = null,
@SerialName("image")
val image: String?,
@SerialName("embed_url")
val embedUrl: String? = null,
@SerialName("blurhash")
val blurhash: String? = null,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/status/TootStatusDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.status
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
import net.pantasystem.milktea.api.mastodon.emojis.TootEmojiDTO
import net.pantasystem.milktea.api.mastodon.filter.FilterResultDTO
import net.pantasystem.milktea.api.mastodon.media.TootMediaAttachment
import net.pantasystem.milktea.api.mastodon.poll.TootPollDTO
import net.pantasystem.milktea.common.serializations.EnumIgnoreUnknownSerializer
import net.pantasystem.milktea.model.emoji.CustomEmoji
import net.pantasystem.milktea.model.note.Note
@kotlinx.serialization.Serializable
data class TootStatusDTO(
@SerialName("id")
val id: String,
@SerialName("uri")
val uri: String,
@SerialName("created_at")
val createdAt: Instant,
@SerialName("account")
val account: MastodonAccountDTO,
@SerialName("content")
val content: String? = null,
@SerialName("visibility")
val visibility: StatusVisibilityType,
@SerialName("sensitive")
val sensitive: Boolean,
@SerialName("spoiler_text")
val spoilerText: String,
@SerialName("media_attachments")
val mediaAttachments: List,
@SerialName("mentions")
val mentions: List? = null,
@SerialName("tags")
val tags: List? = null,
@SerialName("emojis")
val emojis: List,
@SerialName("reblogs_count")
val reblogsCount: Int,
@SerialName("favourites_count")
val favouritesCount: Int? = null,
@SerialName("replies_count")
val repliesCount: Int,
@SerialName("url")
val url: String? = null,
@SerialName("in_reply_to_id")
val inReplyToId: String? = null,
@SerialName("in_reply_account_id")
val inReplyAccountId: String? = null,
@SerialName("reblog")
val reblog: TootStatusDTO? = null,
@SerialName("poll")
val poll: TootPollDTO? = null,
@SerialName("card")
val card: TootPreviewCardDTO? = null,
@SerialName("language")
val language: String? = null,
@SerialName("text")
val text: String? = null,
@SerialName("edited_at")
val editedAt: Instant? = null,
@SerialName("favourited")
val favourited: Boolean? = null,
@SerialName("reblogged")
val reblogged: Boolean? = null,
@SerialName("muted")
val muted: Boolean? = null,
@SerialName("bookmarked")
val bookmarked: Boolean? = null,
@SerialName("pinned")
val pinned: Boolean? = null,
@SerialName("filtered")
val filtered: List? = null,
@SerialName("emoji_reactions")
val emojiReactions: List? = null,
@SerialName("quote")
val quote: TootStatusDTO? = null,
@SerialName("circle_id")
val circleId: String? = null,
@SerialName("visibility_ex")
val visibilityEx: String? = null,
) {
@kotlinx.serialization.Serializable
data class Mention(
@SerialName("id")
val id: String,
@SerialName("username")
val username: String,
@SerialName("url")
val url: String,
@SerialName("acct")
val acct: String,
) {
fun toModel(): Note.Type.Mastodon.Mention {
return Note.Type.Mastodon.Mention(
id = id,
username = username,
url = url,
acct = acct
)
}
}
@kotlinx.serialization.Serializable
data class Tag(
@SerialName("name")
val name: String,
@SerialName("url")
val url: String,
) {
fun toModel(): Note.Type.Mastodon.Tag {
return Note.Type.Mastodon.Tag(
name = name,
url = url,
)
}
}
@kotlinx.serialization.Serializable
data class EmojiReactionCount(
@SerialName("name")
val name: String,
@SerialName("count")
val count: Int,
@SerialName("account_ids")
val accountIds: List,
@SerialName("me")
val me: Boolean? = null,
@SerialName("url")
val url: String? = null,
@SerialName("domain")
val domain: String? = null,
@SerialName("static_url")
val staticUrl: String? = null,
@SerialName("width")
val width: Float? = null,
@SerialName("height")
val height: Float? = null,
) {
val isCustomEmoji = url != null || staticUrl != null
val reaction = if (isCustomEmoji) {
if (domain == null) {
":$name@.:"
} else {
":$name@$domain:"
}
} else {
name
}
fun getEmoji(cachePath: String? = null): CustomEmoji? {
if (!isCustomEmoji) {
return null
}
return CustomEmoji(
name = if (domain == null) {
"$name@."
} else {
"$name@$domain"
},
url = url,
host = domain,
aspectRatio = if (width == null || height == null) {
null
} else {
width / height
},
cachePath = cachePath,
)
}
fun myReaction(): String? {
return reaction.takeIf {
me == true
}
}
}
}
object TootStatusVisibilityTypeSerializer : EnumIgnoreUnknownSerializer(StatusVisibilityType.values(), StatusVisibilityType.Public)
@kotlinx.serialization.Serializable(with = TootStatusVisibilityTypeSerializer::class)
enum class StatusVisibilityType {
@SerialName("private") Private,
@SerialName("unlisted") Unlisted,
@SerialName("public") Public,
@SerialName("direct") Direct
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/subscription/SubscribePushNotification.kt
================================================
package net.pantasystem.milktea.api.mastodon.subscription
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class SubscribePushNotification(
@SerialName("subscription") val subscription: Subscription,
@SerialName("data") val data: Data,
) {
@Serializable
data class Subscription(
@SerialName("endpoint") val endpoint: String,
@SerialName("keys") val keys: Keys,
) {
@Serializable
data class Keys(
@SerialName("p256dh") val p256dh: String,
@SerialName("auth") val auth: String,
)
}
@Serializable
data class Data(
@SerialName("alerts") val alerts: WebPushSubscriptionAlerts,
@SerialName("policy") val policy: String? = null,
)
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/subscription/WebPushSubscription.kt
================================================
package net.pantasystem.milktea.api.mastodon.subscription
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class WebPushSubscription(
@SerialName("id") val id: String,
@SerialName("endpoint") val endpoint: String,
@SerialName("alerts") val alerts: WebPushSubscriptionAlerts,
@SerialName("server_key") val serverKey: String,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/subscription/WebPushSubscriptionAlerts.kt
================================================
package net.pantasystem.milktea.api.mastodon.subscription
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class WebPushSubscriptionAlerts(
@SerialName("mention") val mention: Boolean? = null,
@SerialName("status") val status: Boolean? = null,
@SerialName("reblog") val reblog: Boolean? = null,
@SerialName("follow") val follow: Boolean? = null,
@SerialName("follow_request") val followRequest: Boolean? = null,
@SerialName("favourite") val favourite: Boolean? = null,
@SerialName("poll") val poll: Boolean? = null,
@SerialName("update") val update: Boolean? = null,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/suggestion/SuggestionDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.suggestion
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.api.mastodon.accounts.MastodonAccountDTO
@kotlinx.serialization.Serializable
data class SuggestionDTO(
@SerialName("source")
val source: String,
@SerialName("account")
val account: MastodonAccountDTO
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/mastodon/tag/MastodonTagDTO.kt
================================================
package net.pantasystem.milktea.api.mastodon.tag
import kotlinx.serialization.SerialName
import net.pantasystem.milktea.model.hashtag.HashTag
@kotlinx.serialization.Serializable
data class MastodonTagDTO(
@SerialName("name") val name: String,
@SerialName("url") val url: String,
@SerialName("history") val history: List,
) {
@kotlinx.serialization.Serializable
data class History(
@SerialName("day") val day: Long,
@SerialName("uses") val uses: Int,
@SerialName("accounts") val accounts: Int,
)
fun toModel(): HashTag {
return HashTag(
name,
history.sumOf { it.uses },
history.map { it.uses }
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/CreateInstanceRequest.kt
================================================
package net.pantasystem.milktea.api.milktea
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class CreateInstanceRequest(@SerialName("host") val host: String)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/InstanceInfoResponse.kt
================================================
package net.pantasystem.milktea.api.milktea
import kotlinx.serialization.SerialName
@kotlinx.serialization.Serializable
data class InstanceInfoResponse(
@SerialName("id")
val id: String,
@SerialName("host")
val host: String,
@SerialName("name")
val name: String? = null,
@SerialName("description")
val description: String? = null,
@SerialName("clientMaxBodyByteSize")
val clientMaxBodyByteSize: Long? = null,
@SerialName("iconUrl")
val iconUrl: String? = null,
@SerialName("themeColor")
val themeColor: String? = null,
)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/MilkteaAPIService.kt
================================================
package net.pantasystem.milktea.api.milktea
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
interface MilkteaAPIService {
@GET("/api/instances")
suspend fun getInstances(): Response>
@POST("/api/instances")
suspend fun createInstance(@Body body: CreateInstanceRequest): Response
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/MilkteaAPIServiceBuilder.kt
================================================
package net.pantasystem.milktea.api.milktea
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
import okhttp3.MediaType.Companion.toMediaType
import retrofit2.Retrofit
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class MilkteaAPIServiceBuilder @Inject constructor(
val okHttpClientProvider: OkHttpClientProvider
) {
val json = Json {
ignoreUnknownKeys = true
}
@OptIn(ExperimentalSerializationApi::class)
fun build(baseUrl: String): MilkteaAPIService {
return Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.client(okHttpClientProvider.get())
.build()
.create(MilkteaAPIService::class.java)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/instance/ticker/InstanceTickerAPIService.kt
================================================
package net.pantasystem.milktea.api.milktea.instance.ticker
import net.pantasystem.milktea.api.misskey.infos.SimpleInstanceInfo
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query
interface InstanceTickerAPIService {
@GET("/instances")
suspend fun getInstanceInfo(@Query("host") host: String): Response
@GET("instances-search")
suspend fun getInstances(
@Query("query") name: String? = null,
@Query("limit") limit: Int? = null,
@Query("offset") offset: Int? = null,
): Response>
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/instance/ticker/InstanceTickerAPIServiceBuilder.kt
================================================
package net.pantasystem.milktea.api.milktea.instance.ticker
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.OkHttpClientProvider
import okhttp3.MediaType.Companion.toMediaType
import retrofit2.Retrofit
import javax.inject.Inject
import javax.inject.Singleton
@Singleton
class InstanceTickerAPIServiceBuilder @Inject constructor(
val okHttpClientProvider: OkHttpClientProvider
) {
val json = Json {
ignoreUnknownKeys = true
}
fun build(baseUrl: String): InstanceTickerAPIService {
return Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.client(okHttpClientProvider.get())
.build()
.create(InstanceTickerAPIService::class.java)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/milktea/instance/ticker/InstanceTickerNetworkDTO.kt
================================================
package net.pantasystem.milktea.api.milktea.instance.ticker
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import net.pantasystem.milktea.model.instance.ticker.InstanceTicker
@Serializable
data class InstanceTickerNetworkDTO(
@SerialName("uri") val uri: String,
@SerialName("faviconUrl") val faviconUrl: String?,
@SerialName("iconUrl") val iconUrl: String?,
@SerialName("name") val name: String?,
@SerialName("softwareName") val softwareName: String?,
@SerialName("softwareVersion") val softwareVersion: String?,
@SerialName("themeColor") val themeColor: String?,
) {
fun toModel(): InstanceTicker {
return InstanceTicker(
uri = uri,
faviconUrl = faviconUrl,
iconUrl = iconUrl,
name = name,
softwareName = softwareName,
softwareVersion = softwareVersion,
themeColor = themeColor,
)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/misskey/EmptyRequest.kt
================================================
package net.pantasystem.milktea.api.misskey
import androidx.annotation.Keep
@kotlinx.serialization.Serializable
@Keep
object EmptyRequest
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/misskey/I.kt
================================================
package net.pantasystem.milktea.api.misskey
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class I(@SerialName("i") val i: String?)
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/misskey/InstanceInfosAPI.kt
================================================
package net.pantasystem.milktea.api.misskey
import com.jakewharton.retrofit2.converter.kotlinx.serialization.asConverterFactory
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import net.pantasystem.milktea.api.misskey.infos.SimpleInstanceInfo
import okhttp3.MediaType.Companion.toMediaType
import retrofit2.Response
import retrofit2.Retrofit
import retrofit2.http.GET
import retrofit2.http.Query
import javax.inject.Inject
import javax.inject.Singleton
interface InstanceInfosAPI {
@GET("instances")
suspend fun getInstances(
@Query("name") name: String? = null,
@Query("limit") limit: Int? = null,
@Query("offset") offset: Int? = null,
@Query("lang") lang: String? = null,
): Response>
}
@Singleton
class InstanceInfoAPIBuilder @Inject constructor(val okHttpClientProvider: OkHttpClientProvider) {
private val json = Json {
ignoreUnknownKeys = true
}
@OptIn(ExperimentalSerializationApi::class)
private val retrofitBuilder by lazy {
Retrofit.Builder()
.baseUrl("https://milktea-instance-suggestions.milktea.workers.dev")
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.client(okHttpClientProvider.get())
.build()
}
fun build(): InstanceInfosAPI {
return retrofitBuilder.create(InstanceInfosAPI::class.java)
}
}
================================================
FILE: modules/api/src/main/java/net/pantasystem/milktea/api/misskey/MisskeyAPI.kt
================================================
package net.pantasystem.milktea.api.misskey
import kotlinx.serialization.json.JsonObject
import net.pantasystem.milktea.api.misskey.ap.ApResolveRequest
import net.pantasystem.milktea.api.misskey.ap.ApResolveResult
import net.pantasystem.milktea.api.misskey.app.CreateApp
import net.pantasystem.milktea.api.misskey.auth.App
import net.pantasystem.milktea.api.misskey.clip.*
import net.pantasystem.milktea.api.misskey.drive.*
import net.pantasystem.milktea.api.misskey.favorite.Favorite
import net.pantasystem.milktea.api.misskey.groups.AcceptInvitationDTO
import net.pantasystem.milktea.api.misskey.groups.CreateGroupDTO
import net.pantasystem.milktea.api.misskey.groups.DeleteGroupDTO
import net.pantasystem.milktea.api.misskey.groups.GroupDTO
import net.pantasystem.milktea.api.misskey.groups.InviteUserDTO
import net.pantasystem.milktea.api.misskey.groups.RejectInvitationDTO
import net.pantasystem.milktea.api.misskey.groups.RemoveUserDTO
import net.pantasystem.milktea.api.misskey.groups.ShowGroupDTO
import net.pantasystem.milktea.api.misskey.groups.TransferGroupDTO
import net.pantasystem.milktea.api.misskey.groups.UpdateGroupDTO
import net.pantasystem.milktea.api.misskey.hashtag.SearchHashtagRequest
import net.pantasystem.milktea.api.misskey.instance.MetaNetworkDTO
import net.pantasystem.milktea.api.misskey.instance.RequestMeta
import net.pantasystem.milktea.api.misskey.list.*
import net.pantasystem.milktea.api.misskey.messaging.MessageAction
import net.pantasystem.milktea.api.misskey.messaging.MessageDTO
import net.pantasystem.milktea.api.misskey.messaging.RequestMessage
import net.pantasystem.milktea.api.misskey.messaging.RequestMessageHistory
import net.pantasystem.milktea.api.misskey.notes.*
import net.pantasystem.milktea.api.misskey.notes.favorite.CreateFavorite
import net.pantasystem.milktea.api.misskey.notes.favorite.DeleteFavorite
import net.pantasystem.milktea.api.misskey.notes.mute.ToggleThreadMuteRequest
import net.pantasystem.milktea.api.misskey.notes.reaction.ReactionHistoryDTO
import net.pantasystem.milktea.api.misskey.notes.reaction.RequestReactionHistoryDTO
import net.pantasystem.milktea.api.misskey.notes.translation.Translate
import net.pantasystem.milktea.api.misskey.notes.translation.TranslationResult
import net.pantasystem.milktea.api.misskey.notification.NotificationDTO
import net.pantasystem.milktea.api.misskey.notification.NotificationRequest
import net.pantasystem.milktea.api.misskey.online.user.OnlineUserCount
import net.pantasystem.milktea.api.misskey.register.Subscription
import net.pantasystem.milktea.api.misskey.register.SubscriptionStateNetworkDTO
import net.pantasystem.milktea.api.misskey.register.UnSubscription
import net.pantasystem.milktea.api.misskey.register.WebClientBaseRequest
import net.pantasystem.milktea.api.misskey.register.WebClientRegistries
import net.pantasystem.milktea.api.misskey.trend.HashtagTrend
import net.pantasystem.milktea.api.misskey.users.*
import net.pantasystem.milktea.api.misskey.users.follow.FollowUserRequest
import net.pantasystem.milktea.api.misskey.users.follow.UnFollowUserRequest
import net.pantasystem.milktea.api.misskey.users.follow.UpdateUserFollowRequest
import net.pantasystem.milktea.api.misskey.users.renote.mute.CreateRenoteMuteRequest
import net.pantasystem.milktea.api.misskey.users.renote.mute.DeleteRenoteMuteRequest
import net.pantasystem.milktea.api.misskey.users.renote.mute.RenoteMuteDTO
import net.pantasystem.milktea.api.misskey.users.renote.mute.RenoteMutesRequest
import net.pantasystem.milktea.api.misskey.users.report.ReportDTO
import net.pantasystem.milktea.api.misskey.v10.FollowFollowerUsers
import net.pantasystem.milktea.api.misskey.v10.RequestFollowFollower
import net.pantasystem.milktea.api.misskey.v12.antenna.AntennaDTO
import net.pantasystem.milktea.api.misskey.v12.antenna.AntennaQuery
import net.pantasystem.milktea.api.misskey.v12.antenna.AntennaToAdd
import net.pantasystem.milktea.api.misskey.v12.channel.ChannelDTO
import net.pantasystem.milktea.api.misskey.v12.channel.CreateChannelDTO
import net.pantasystem.milktea.api.misskey.v12.channel.FindPageable
import net.pantasystem.milktea.api.misskey.v12.channel.FollowChannelDTO
import net.pantasystem.milktea.api.misskey.v12.channel.ShowChannelDTO
import net.pantasystem.milktea.api.misskey.v12.channel.UnFollowChannelDTO
import net.pantasystem.milktea.api.misskey.v12.channel.UpdateChannelDTO
import net.pantasystem.milktea.api.misskey.v12.user.reaction.UserReaction
import net.pantasystem.milktea.api.misskey.v12.user.reaction.UserReactionRequest
import net.pantasystem.milktea.api.misskey.v12_75_0.CreateGallery
import net.pantasystem.milktea.api.misskey.v12_75_0.Delete
import net.pantasystem.milktea.api.misskey.v12_75_0.GalleryPost
import net.pantasystem.milktea.api.misskey.v12_75_0.GetPosts
import net.pantasystem.milktea.api.misskey.v12_75_0.Like
import net.pantasystem.milktea.api.misskey.v12_75_0.LikedGalleryPost
import net.pantasystem.milktea.api.misskey.v12_75_0.Show
import net.pantasystem.milktea.api.misskey.v12_75_0.UnLike
import net.pantasystem.milktea.api.misskey.v12_75_0.Update
import net.pantasystem.milktea.api.misskey.v13.EmojisResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
interface MisskeyAPI {
@POST("api/app/create")
suspend fun createApp(@Body createApp: CreateApp): Response
@POST("api/blocking/create")
suspend fun blockUser(@Body requestUser: RequestUser): Response
@POST("api/blocking/delete")
suspend fun unblockUser(@Body requestUser: RequestUser): Response
@POST("api/i")
suspend fun i(@Body i: I): Response
//users
@POST("api/users")
suspend fun getUsers(@Body requestUser: RequestUser): Response>
@POST("api/users/show")
suspend fun showUser(@Body requestUser: RequestUser): Response
@POST("api/users/show")
suspend fun showUsers(@Body requestUser: RequestUser): Response>
@POST("api/users/search")
suspend fun searchUser(@Body requestUser: RequestUser): Response>
@POST("api/users/lists/list")
suspend fun userList(@Body i: I): Response>
@POST("api/users/lists/show")
suspend fun showList(@Body listId: ListId): Response
@POST("api/users/lists/create")
suspend fun createList(@Body createList: CreateList): Response
@POST("api/lists/delete")
suspend fun deleteList(@Body listId: ListId): Response
@POST("api/users/lists/update")
suspend fun updateList(@Body createList: UpdateList): Response
@POST("api/users/lists/push")
suspend fun pushUserToList(@Body listUserOperation: ListUserOperation): Response
@POST("api/users/lists/pull")
suspend fun pullUserFromList(@Body listUserOperation: ListUserOperation): Response
@POST("api/following/delete")
suspend fun unFollowUser(@Body requestUser: UnFollowUserRequest): Response
@POST("api/following/create")
suspend fun followUser(@Body requestUser: FollowUserRequest): Response
@POST("api/following/update")
suspend fun updateFollowUser(@Body request: UpdateUserFollowRequest): Response
@POST("api/following/requests/accept")
suspend fun acceptFollowRequest(@Body followRequest: AcceptFollowRequest) : Response
@POST("api/following/requests/reject")
suspend fun rejectFollowRequest(@Body rejectFollowRequest: RejectFollowRequest) : Response
@POST("api/following/requests/list")
suspend fun getFollowRequestsList(@Body body: GetFollowRequest): Response>
//account
@POST("api/i/favorites")
suspend fun favorites(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/favorites/create")
suspend fun createFavorite(@Body noteRequest: CreateFavorite): Response
@POST("api/notes/favorites/delete")
suspend fun deleteFavorite(@Body noteRequest: DeleteFavorite): Response
@POST("api/i/notifications")
suspend fun notification(@Body notificationRequest: NotificationRequest): Response?>
@POST("api/notifications/mark-all-as-read")
suspend fun markAllAsReadNotifications(i: I): Response
@POST("api/notes/create")
suspend fun create(@Body createNote: CreateNote): Response
@POST("api/notes/delete")
suspend fun delete(@Body deleteNote: DeleteNote): Response
@POST("api/notes/reactions")
suspend fun reactions(@Body body: RequestReactionHistoryDTO): Response>
@POST("api/notes/reactions/create")
suspend fun createReaction(@Body reaction: CreateReactionDTO): Response
@POST("api/notes/reactions/delete")
suspend fun deleteReaction(@Body deleteNote: DeleteNote): Response
@POST("api/notes/unrenote")
suspend fun unrenote(@Body deleteNote: DeleteNote): Response
@POST("api/notes/search")
suspend fun searchNote(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/state")
suspend fun noteState(@Body noteRequest: NoteRequest): Response
@POST("api/notes/show")
suspend fun showNote(@Body requestNote: NoteRequest): Response
@POST("api/notes/children")
suspend fun children(@Body req: GetNoteChildrenRequest): Response>
@POST("api/notes/conversation")
suspend fun conversation(@Body noteRequest: NoteRequest): Response>
@POST("api/notes/featured")
suspend fun featured(@Body noteRequest: NoteRequest): Response?>
//timeline
@POST("api/notes/timeline")
suspend fun homeTimeline(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/hybrid-timeline")
suspend fun hybridTimeline(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/local-timeline")
suspend fun localTimeline(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/global-timeline")
suspend fun globalTimeline(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/polls/vote")
suspend fun vote(@Body vote: Vote) : Response
@POST("api/notes/search-by-tag")
suspend fun searchByTag(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/user-list-timeline")
suspend fun userListTimeline(@Body noteRequest: NoteRequest): Response?>
//user
@POST("api/users/notes")
suspend fun userNotes(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/mentions")
suspend fun mentions(@Body noteRequest: NoteRequest): Response?>
@POST("api/notes/recommended-timeline")
suspend fun getCalckeyRecommendedTimeline(@Body noteRequest: NoteRequest): Response?>
//drive
@POST("api/drive/files")
suspend fun getFiles(@Body fileRequest: RequestFile): Response>
@POST("api/drive/files/update")
suspend fun updateFile(@Body updateFileRequest: JsonObject): Response
@POST("api/drive/files/delete")
suspend fun deleteFile(@Body req: DeleteFileDTO): Response
@POST("api/drive/files/show")
suspend fun showFile(@Body req: ShowFile) : Response
@POST("api/drive/folders")
suspend fun getFolders(@Body folderRequest: RequestFolder): Response>
@POST("api/drive/folders/create")
suspend fun createFolder(@Body createFolder: CreateFolder): Response
@POST("api/drive/folders/show")
suspend fun showFolder(@Body req: ShowFolderRequest): Response
//meta
@POST("api/meta")
suspend fun getMeta(@Body requestMeta: RequestMeta): Response
//message
@POST("api/messaging/history")
suspend fun getMessageHistory(@Body requestMessageHistory: RequestMessageHistory): Response>
@POST("api/messaging/messages")
suspend fun getMessages(@Body requestMessage: RequestMessage): Response>
@POST("api/messaging/messages/create")
suspend fun createMessage(@Body messageAction: MessageAction): Response
@POST("api/messaging/messages/delete")
suspend fun deleteMessage(@Body messageAction: MessageAction): Response
@POST("api/messaging/messages/read")
suspend fun readMessage(@Body messageAction: MessageAction): Response
@POST("api/mute/create")
suspend fun muteUser(@Body createMuteRequest: CreateMuteUserRequest): Response
@POST("api/mute/delete")
suspend fun unmuteUser(@Body requestUser: RequestUser): Response
@POST("api/sw/register")
suspend fun swRegister(@Body subscription: Subscription) : Response
@POST("api/sw/unregister")
suspend fun swUnRegister(@Body unSub: UnSubscription) : Response
@POST("api/following/requests/cancel")
suspend fun cancelFollowRequest(@Body req: CancelFollow) : Response
@POST("api/notes/renotes")
suspend fun renotes(@Body req: FindRenotes) : Response>
@POST("api/notes/translate")
@Headers("Content-Type: application/json")
suspend fun translate(@Body req: Translate) : Response
@POST("api/users/report-abuse")
suspend fun report(@Body req: ReportDTO) : Response
@POST("api/ap/show")
suspend fun resolve(@Body req: ApResolveRequest) : Response
@POST("api/notes/thread-muting/create")
suspend fun createThreadMute(@Body req: ToggleThreadMuteRequest) : Response
@POST("api/notes/thread-muting/delete")
suspend fun deleteThreadMute(@Body req: ToggleThreadMuteRequest) : Response
@POST("api/hashtags/search")
suspend fun searchHashtag(@Body req: SearchHashtagRequest) : Response>
@POST("api/emojis")
suspend fun getEmojis(@Body req: EmptyRequest) : Response