diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/services/facebook.rb | 2 | ||||
-rw-r--r-- | app/models/status_message.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/services/facebook.rb b/app/models/services/facebook.rb index f49fd2e51..65d1006c3 100644 --- a/app/models/services/facebook.rb +++ b/app/models/services/facebook.rb @@ -29,7 +29,7 @@ class Services::Facebook < Service {message: message, access_token: access_token, - link: URI.extract(message, ['https', 'http']).first + link: post.message.urls.first } end diff --git a/app/models/status_message.rb b/app/models/status_message.rb index fa04daf4d..5d857c640 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -148,13 +148,13 @@ class StatusMessage < Post end def contains_oembed_url_in_text? - urls = URI.extract(self.raw_message, ['http', 'https']) + urls = self.message.urls self.oembed_url = urls.find{ |url| !TRUSTED_OEMBED_PROVIDERS.find(url).nil? } end def contains_open_graph_url_in_text? return nil if self.contains_oembed_url_in_text? - self.open_graph_url = URI.extract(self.raw_message, ['http', 'https'])[0] + self.open_graph_url = self.message.urls[0] end def address |