Feat: Manage conversation for tweets based on the tweet flag (#3353)

Add tweet conversation only if tweets are enabled.

Fixes #1961
This commit is contained in:
Tejaswini Chile
2021-12-16 00:24:50 +05:30
committed by GitHub
parent e2e459a1ac
commit 9984edd3ef
12 changed files with 73 additions and 17 deletions

View File

@@ -3,7 +3,8 @@ class Twitter::TweetParserService < Twitter::WebhooksBaseService
def perform
set_inbox
return if message_already_exist? || user_has_blocked?
return if !tweets_enabled? || message_already_exist? || user_has_blocked?
create_message
end
@@ -38,6 +39,10 @@ class Twitter::TweetParserService < Twitter::WebhooksBaseService
payload['user_has_blocked'] == true
end
def tweets_enabled?
@inbox.channel.tweets_enabled?
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