Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Operate on statuses through a new StatusRepository #1279

Merged
merged 7 commits into from
Feb 10, 2025

Conversation

nikclayton
Copy link
Contributor

@nikclayton nikclayton commented Feb 10, 2025

Previous code operated on statuses either through direct calls to
StatusDao or via methods exposed in TimelineCases.

There probably isn't enough business logic to justify the overhead
of having use-cases for this functionality, so fold that in to a
new StatusRepository and remove some duplicated code.

Previous code to show the notification account filtering dialogs and
respond to the user's choices was specific to notification account
filters.

As additional account filters will be developed make this more general.

- Add an enum to specify the timeline affected by the filters.
- Pass this, and UX strings, to the dialog dispaying the filtering
  options.
- Rewrite the viewmodel to use actions
TimelineCases is increasingly badly named, as some of these methods
operate on statuses irrespective of whether or not they're on a
timeline.

Move reblog, favourite, and bookmark methods in to a new
StatusRepository.
- Migrate timelineCases.voteInPoll
- Rename `pinAccount` to correct `pinStatus`
- Fix bug in ViewThreadViewModel, optimistic updates were not reverted
on failure.
- Optimistically update in search results
- Rename "setVoted" to "setPoll" to accurately reflect what it does
- Add factorys to Moshi in FakeNetworkModule
# Conflicts:
#	app/src/main/java/app/pachli/components/conversation/ConversationsViewModel.kt
#	app/src/main/java/app/pachli/components/search/SearchViewModel.kt
#	app/src/main/java/app/pachli/components/search/fragments/SearchStatusesFragment.kt
#	app/src/main/java/app/pachli/components/viewthread/ViewThreadViewModel.kt
#	core/data/src/main/kotlin/app/pachli/core/data/repository/notifications/NotificationsRepository.kt
@nikclayton nikclayton changed the title wip: Status repository refactor: Operate on statuses through a new StatusRepository Feb 10, 2025
@nikclayton nikclayton merged commit fbb0fea into pachli:main Feb 10, 2025
28 of 29 checks passed
@nikclayton nikclayton deleted the status-repository branch February 10, 2025 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant