From 3b43be6e514296e3d04e78aa15b3d368e5a14a74 Mon Sep 17 00:00:00 2001 From: austin Date: Thu, 10 Nov 2022 10:02:18 -0600 Subject: [PATCH] pull request: block Twitter Blue users Feature: block Twitter Blue users, --- src/content/autoBlock.ts | 55 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/src/content/autoBlock.ts b/src/content/autoBlock.ts index 6452df0..484a6d4 100644 --- a/src/content/autoBlock.ts +++ b/src/content/autoBlock.ts @@ -154,7 +154,60 @@ function recursivelyDetectNFTs( value.profile_image_url_http = avatar_url; } } - } else if (value.rest_id && value.has_nft_avatar) { + } + else if (value.id_str && value.ext_is_blue_verified) { + const res = callback({ + id: value.id_str, + name: value.screen_name, + + verified: value.verified ?? false, + followed_by: value.followed_by ?? false, + following: value.following ?? false, + + alreadyBlocked: value.blocking ?? false, + alreadyMuted: value.muting ?? false, + }); + if (res) { + const [blocking, muting, avatar_url] = res; + + if (blocking !== undefined) { + value.blocking = blocking; + if (blocking) value.following = false; + } + if (muting !== undefined) value.muting = muting; + if (avatar_url !== undefined) { + value.profile_image_url_https = avatar_url; + value.profile_image_url_http = avatar_url; + } + } + } + else if (value.id_str && value.is_blue_verified) { + const res = callback({ + id: value.id_str, + name: value.screen_name, + + verified: value.verified ?? false, + followed_by: value.followed_by ?? false, + following: value.following ?? false, + + alreadyBlocked: value.blocking ?? false, + alreadyMuted: value.muting ?? false, + }); + if (res) { + const [blocking, muting, avatar_url] = res; + + if (blocking !== undefined) { + value.blocking = blocking; + if (blocking) value.following = false; + } + if (muting !== undefined) value.muting = muting; + if (avatar_url !== undefined) { + value.profile_image_url_https = avatar_url; + value.profile_image_url_http = avatar_url; + } + } + } + else if (value.rest_id && value.has_nft_avatar) { const res = callback({ id: value.rest_id, name: value.legacy?.screen_name ?? '',