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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user