Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
fix: unexpected and unknown promoted trend appears in some country
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonKhew96 authored Jun 24, 2023
1 parent 9977431 commit dbc5296
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/icu/nullptr/twifucker/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ fun writeJsonLog(content: String) {

fun isEntryNeedsRemove(entryId: String): Boolean {
// promoted tweet
if (entryId.startsWith("promotedTweet-") && modulePrefs.getBoolean(
// "superhero-superhero" == promoted trend
if ((entryId.startsWith("promotedTweet-") || entryId.startsWith("superhero-")) && modulePrefs.getBoolean(
"disable_promoted_content", true
)
) {
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/icu/nullptr/twifucker/hook/JsonHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ object JsonHook : BaseHook() {
?.optJSONObject("tweet")
?.has("promotedMetadata") == true || optJSONObject("content")?.optJSONObject("content")
?.has("tweetPromotedMetadata") == true || optJSONObject("item")?.optJSONObject("content")
?.has("tweetPromotedMetadata") == true
?.has("tweetPromotedMetadata") == true || optJSONObject("content")?.optJSONObject("item")
?.optJSONObject("content")?.optJSONObject("eventSummary")
?.has("promotedMetadata") == true

private fun JSONObject.entryIsWhoToFollow(): Boolean = optString("entryId").let {
it.startsWith("whoToFollow-") || it.startsWith("who-to-follow-") || it.startsWith("connect-module-")
Expand Down

0 comments on commit dbc5296

Please sign in to comment.