feat: Ignore tweets from blocked users (#1408)

This commit is contained in:
Pranav Raj S
2020-11-16 10:46:53 +05:30
committed by GitHub
parent 563da0e052
commit ef99fd3311
3 changed files with 14 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ class Twitter::TweetParserService < Twitter::WebhooksBaseService
def perform
set_inbox
return if message_already_exist?
return if message_already_exist? || user_has_blocked?
create_message
end
@@ -34,6 +34,10 @@ class Twitter::TweetParserService < Twitter::WebhooksBaseService
tweet_data['id'].to_s
end
def user_has_blocked?
payload['user_has_blocked'] == true
end
def parent_tweet_id
tweet_data['in_reply_to_status_id_str'].nil? ? tweet_data['id'].to_s : tweet_data['in_reply_to_status_id_str']
end