mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-27 14:26:49 +01:00
fix(YouTube - Hide layout components): Correctly hide Join button
This commit is contained in:
parent
bed8f9f640
commit
b945e2f44b
@ -29,6 +29,8 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
private final StringFilterGroup expandableMetadata;
|
||||
private final ByteArrayFilterGroup searchResultRecommendations;
|
||||
private final StringFilterGroup searchResultVideo;
|
||||
private final StringFilterGroup compactChannelBarInner;
|
||||
private final ByteArrayFilterGroup joinMembership;
|
||||
|
||||
static {
|
||||
mixPlaylistsExceptions.addPatterns(
|
||||
@ -194,9 +196,14 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
"set_reminder_button"
|
||||
);
|
||||
|
||||
final var joinMembership = new StringFilterGroup(
|
||||
compactChannelBarInner = new StringFilterGroup(
|
||||
Settings.HIDE_JOIN_MEMBERSHIP_BUTTON,
|
||||
"compact_sponsor_button"
|
||||
"compact_channel_bar_inner"
|
||||
);
|
||||
|
||||
joinMembership = new ByteArrayFilterGroup(
|
||||
Settings.HIDE_JOIN_MEMBERSHIP_BUTTON,
|
||||
"Join this channel"
|
||||
);
|
||||
|
||||
final var channelWatermark = new StringFilterGroup(
|
||||
@ -233,7 +240,7 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
quickActions,
|
||||
relatedVideos,
|
||||
compactBanner,
|
||||
joinMembership,
|
||||
compactChannelBarInner,
|
||||
medicalPanel,
|
||||
videoQualityMenuFooter,
|
||||
infoPanel,
|
||||
@ -258,6 +265,12 @@ public final class LayoutComponentsFilter extends Filter {
|
||||
}
|
||||
}
|
||||
|
||||
if (matchedGroup == compactChannelBarInner) {
|
||||
if (joinMembership.check(protobufBufferArray).isFiltered()){
|
||||
return super.isFiltered(identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// The groups are excluded from the filter due to the exceptions list below.
|
||||
// Filter them separately here.
|
||||
if (matchedGroup == notifyMe || matchedGroup == inFeedSurvey || matchedGroup == expandableMetadata)
|
||||
|
Loading…
Reference in New Issue
Block a user