refactor: Rename clearWarningAction to clearContentFilter (#1125)

This commit is contained in:
Nik Clayton 2024-11-22 14:52:17 +01:00 committed by GitHub
parent ac36ed6264
commit 79a69513ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 7 deletions

View File

@ -356,7 +356,7 @@ class ConversationsFragment :
viewModel.voteInPoll(choices, viewData.lastStatus.actionableId, poll.id)
}
override fun clearWarningAction(pachliAccountId: Long, viewData: ConversationViewData) {
override fun clearContentFilter(pachliAccountId: Long, viewData: ConversationViewData) {
}
// Filters don't apply in conversations

View File

@ -632,7 +632,7 @@ class NotificationsFragment :
onContentCollapsedChange(pachliAccountId, viewData, isCollapsed)
}
override fun clearWarningAction(pachliAccountId: Long, viewData: NotificationViewData) {
override fun clearContentFilter(pachliAccountId: Long, viewData: NotificationViewData) {
adapter.snapshot().withIndex().filter { it.value?.statusViewData?.actionableId == viewData.statusViewData!!.actionableId }
.map {
it.value?.statusViewData = it.value?.statusViewData?.copy(

View File

@ -160,7 +160,7 @@ class SearchStatusesFragment : SearchFragment<StatusViewData>(), StatusActionLis
viewModel.voteInPoll(viewData, poll, choices)
}
override fun clearWarningAction(pachliAccountId: Long, viewData: StatusViewData) {}
override fun clearContentFilter(pachliAccountId: Long, viewData: StatusViewData) {}
override fun onReblog(viewData: StatusViewData, reblog: Boolean) {
viewModel.reblog(viewData, reblog)

View File

@ -650,7 +650,7 @@ class TimelineFragment :
viewModel.accept(StatusAction.VoteInPoll(poll, choices, viewData))
}
override fun clearWarningAction(pachliAccountId: Long, viewData: StatusViewData) {
override fun clearContentFilter(pachliAccountId: Long, viewData: StatusViewData) {
viewModel.clearWarning(pachliAccountId, viewData)
}

View File

@ -397,7 +397,7 @@ class ViewThreadFragment :
}
}
override fun clearWarningAction(pachliAccountId: Long, viewData: StatusViewData) {
override fun clearContentFilter(pachliAccountId: Long, viewData: StatusViewData) {
viewModel.clearWarning(viewData)
}

View File

@ -58,7 +58,7 @@ interface StatusActionListener<T : IStatusViewData> : LinkListener {
fun onShowFavs(statusId: String) {}
fun onVoteInPoll(viewData: T, poll: Poll, choices: List<Int>)
fun onShowEdits(statusId: String) {}
fun clearWarningAction(pachliAccountId: Long, viewData: T)
fun clearContentFilter(pachliAccountId: Long, viewData: T)
/** Edit the filter that matched this status. */
fun onEditFilterById(pachliAccountId: Long, filterId: String)

View File

@ -201,7 +201,7 @@ class ListStatusAccessibilityDelegate<T : IStatusViewData>(
app.pachli.core.ui.R.id.action_more -> {
statusActionListener.onMore(host, status)
}
app.pachli.core.ui.R.id.action_show_anyway -> statusActionListener.clearWarningAction(pachliAccountId, status)
app.pachli.core.ui.R.id.action_show_anyway -> statusActionListener.clearContentFilter(pachliAccountId, status)
app.pachli.core.ui.R.id.action_edit_filter -> {
(recyclerView.findContainingViewHolder(host) as? FilterableStatusViewHolder<*>)?.matchedFilter?.let {
statusActionListener.onEditFilterById(pachliAccountId, it.id)