Chore: Twitter Integration house cleaning (#855)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -55,7 +55,7 @@ class Channel::WebWidget < ApplicationRecord
|
||||
)
|
||||
contact_inbox
|
||||
rescue StandardError => e
|
||||
Rails.logger e
|
||||
Rails.logger.info e
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user