Bug: Fix duplicate messages from Twitter DM and tweets (#599)

* Bug: Fix duplicate messages from Twitter DM and tweets
This commit is contained in:
Sojan Jose
2020-03-06 01:47:37 +05:30
committed by GitHub
parent fabc6c87af
commit a8ac048716
14 changed files with 120 additions and 76 deletions

View File

@@ -39,10 +39,16 @@ class Twitter::SendReplyService
end
def send_tweet_reply
twitter_client.send_tweet_reply(
response = twitter_client.send_tweet_reply(
reply_to_tweet_id: conversation.additional_attributes['tweet_id'],
tweet: screen_name + message.content
)
if response.status == '200'
tweet_data = response.body
message.update!(source_id: tweet_data['id_str'])
else
Rails.logger 'TWITTER_TWEET_REPLY_ERROR' + response.body
end
end
def send_reply