mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2026-01-11 13:46:17 +00: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.
|
* Injection point.
|
||||||
*/
|
*/
|
||||||
public static Map<String, String> setFollowingHeader(Map<String, String> requestHeaderMap) {
|
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.
|
// Create new map as original is unmodifiable.
|
||||||
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
|
Map<String, String> patchedRequestHeaderMap = new HashMap<>(requestHeaderMap);
|
||||||
patchedRequestHeaderMap.put("pagination_source", "following");
|
patchedRequestHeaderMap.put(paginationHeaderName, "following");
|
||||||
return patchedRequestHeaderMap;
|
return patchedRequestHeaderMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user