forked from LucasGGamerM/moshidon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove StatusFilterPredicate
Removes the deprecated StatusFilterPredicate class, as it has been replaced upstream. Client-side filters are now directly applied in the when building a StatusDisplayItem.
- Loading branch information
1 parent
00726ab
commit 28c851a
Showing
5 changed files
with
25 additions
and
243 deletions.
There are no files selected for viewing
104 changes: 0 additions & 104 deletions
104
mastodon/src/androidTest/java/org/joinmastodon/android/utils/StatusFilterPredicateTest.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
mastodon/src/main/java/org/joinmastodon/android/model/AltTextFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
package org.joinmastodon.android.model; | ||
|
||
import org.joinmastodon.android.GlobalUserPreferences; | ||
import org.jsoup.internal.StringUtil; | ||
|
||
import java.util.EnumSet; | ||
|
||
public class AltTextFilter extends LegacyFilter { | ||
|
||
public AltTextFilter(FilterAction filterAction, FilterContext firstContext, FilterContext... restContexts) { | ||
public AltTextFilter(FilterAction filterAction, EnumSet<FilterContext> filterContexts) { | ||
this.filterAction = filterAction; | ||
isRemote = false; | ||
context = EnumSet.of(firstContext, restContexts); | ||
context = filterContexts; | ||
} | ||
|
||
@Override | ||
public boolean matches(Status status) { | ||
return status.getContentStatus().mediaAttachments.stream().map(attachment -> attachment.description).anyMatch(StringUtil::isBlank); | ||
} | ||
|
||
@Override | ||
public boolean isActive(){ | ||
return !GlobalUserPreferences.showPostsWithoutAlt; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 0 additions & 120 deletions
120
mastodon/src/main/java/org/joinmastodon/android/utils/StatusFilterPredicate.java
This file was deleted.
Oops, something went wrong.