Skip to content

Commit

Permalink
feat: update filter post
Browse files Browse the repository at this point in the history
  • Loading branch information
pantasystem committed Nov 11, 2023
1 parent 3300777 commit 1b635f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class AppAuthViewModel @Inject constructor(

private val logger = loggerFactory.create("AppAuthViewModel")

val instanceDomain = MutableStateFlow("misskey.io")
val instanceDomain = MutableStateFlow("")

val isOpenInWebView = MutableStateFlow(false)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ class TimelineViewModel @AssistedInject constructor(

cache.addFilter(object : PlaneNoteViewDataCache.ViewDataFilter {
override suspend fun check(viewData: PlaneNoteViewData): PlaneNoteViewData.FilterResult {

// NOTE: 将来的にセンシティブな投稿をフィルタリングするための機能を追加するための実験的なテストコード
if (viewData.account.remoteId == "7slno9u6re" && viewData.account.getHost() == "misskey.io") {
if (viewData.note.files?.any { it.isSensitive } == true
|| viewData.subNote?.files?.any { it.isSensitive } == true) {
return PlaneNoteViewData.FilterResult.ShouldFilterNote
}
}
return timelineFilterService.filterNote(viewData).filterResult
}
})
Expand Down

0 comments on commit 1b635f0

Please sign in to comment.