fix(Instagram - Limit feed to followed profiles): Preserve favorites feed (#5963)
This commit is contained in:
parent
c72d99518c
commit
ef514017f4
1 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue