Chore: Twitter Integration house cleaning (#855)

Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
Sojan Jose
2020-05-14 22:51:07 +05:30
committed by GitHub
parent 1108446974
commit 20f39caa42
11 changed files with 159 additions and 63 deletions

View File

@@ -35,7 +35,7 @@ class Channel::TwitterProfile < ApplicationRecord
source_id: profile_id
)
rescue StandardError => e
Rails.logger e
Rails.logger.info e
end
end
@@ -53,7 +53,10 @@ class Channel::TwitterProfile < ApplicationRecord
private
def unsubscribe
webhooks_list = twitter_client.fetch_webhooks.body
twitter_client.unsubscribe_webhook(id: webhooks_list.first['id']) if webhooks_list.present?
### Fix unsubscription with new endpoint
unsubscribe_response = twitter_client.remove_subscription(user_id: profile_id)
Rails.logger.info 'TWITTER_UNSUBSCRIBE: ' + unsubscribe_response.body.to_s
rescue StandardError => e
Rails.logger.info e
end
end

View File

@@ -55,7 +55,7 @@ class Channel::WebWidget < ApplicationRecord
)
contact_inbox
rescue StandardError => e
Rails.logger e
Rails.logger.info e
end
end
end