mirror of
https://github.com/revanced/revanced-patches.git
synced 2025-12-07 01:51:27 +01:00
fix(Instagram - Limit feed to followed profiles): Preserve favorites feed (#5963)
This commit is contained in:
@@ -10,9 +10,17 @@ public class LimitFeedToFollowedProfiles {
|
||||
* Injection point.
|
||||
*/
|
||||
public static Map<String, String> setFollowingHeader(Map<String, String> requestHeaderMap) {
|
||||
String paginationHeaderName = "pagination_source";
|
||||
|
||||
// Patch the header only if it's trying to fetch the default feed
|
||||
String currentHeader = requestHeaderMap.get(paginationHeaderName);
|
||||
if (currentHeader != null && !currentHeader.equals("feed_recs")) {
|
||||
return requestHeaderMap;
|
||||
}
|
||||
|
||||
// Create new map as original is unmodifiable.
|
||||
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
|
||||
patchedRequestHeaderMap.put("pagination_source", "following");
|
||||
patchedRequestHeaderMap.put(paginationHeaderName, "following");
|
||||
return patchedRequestHeaderMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user