diff --git a/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java b/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java index a8909cdac..544a0a997 100644 --- a/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java +++ b/app/src/main/java/ru/vtosters/lite/hooks/AdBlockHook.java @@ -277,41 +277,9 @@ public class AdBlockHook { } } - if (!json.has("items")) return json; - - var items = json.optJSONArray("items"); - if (items != null) { - for (int i = 0; i < items.length(); i++) { - var item = items.optJSONObject(i); - if (item != null) { - parseStoriesItem(item); - } - } - } - return json; } - private static void parseStoriesItem(JSONObject item) throws JSONException { - var stories = item.optJSONArray("stories"); - var newStories = new JSONArray(); - - if (stories == null) return; - - for (int j = 0; j < stories.length(); j++) { - var story = stories.optJSONObject(j); - - if (!story.optBoolean("is_ads") && !story.optBoolean("is_promo")) { - newStories.put(story); - } else { - if (dev()) - Log.d("StoriesAds", "Fetched ad, owner id " + story.optString("owner_id") + ", caption " + story.optString("caption")); - } - } - - item.put("stories", newStories); - } - public static Boolean isAds(JSONObject list, String type) throws JSONException { if (list == null || type == null || !ads()) return false;