Skip to content

Commit ef51401

Browse files
authored
fix(Instagram - Limit feed to followed profiles): Preserve favorites feed (#5963)
1 parent c72d995 commit ef51401

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

extensions/instagram/src/main/java/app/revanced/extension/instagram/feed/LimitFeedToFollowedProfiles.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ public class LimitFeedToFollowedProfiles {
1010
* Injection point.
1111
*/
1212
public static Map<String, String> setFollowingHeader(Map<String, String> requestHeaderMap) {
13+
String paginationHeaderName = "pagination_source";
14+
15+
// Patch the header only if it's trying to fetch the default feed
16+
String currentHeader = requestHeaderMap.get(paginationHeaderName);
17+
if (currentHeader != null && !currentHeader.equals("feed_recs")) {
18+
return requestHeaderMap;
19+
}
20+
1321
// Create new map as original is unmodifiable.
1422
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
15-
patchedRequestHeaderMap.put("pagination_source", "following");
23+
patchedRequestHeaderMap.put(paginationHeaderName, "following");
1624
return patchedRequestHeaderMap;
1725
}
1826
}

0 commit comments

Comments
 (0)