about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-06-07 05:13:49 -0500
committerDavid Yip <yipdw@member.fsf.org>2018-06-07 05:13:49 -0500
commit8142bd2553e7819722fdfc401e06cb10eeddd230 (patch)
treed771e65a58d3c69ba1c08c3fc145f24b5b806274 /app/services
parentf8d50a40701f344ea7c2a0e5475bbcbc727ef930 (diff)
parent2304d52599bfd3a907931971a94b9b68f229ab0a (diff)
Merge remote-tracking branch 'tootsuite/master' into merge-upstream
  Conflicts:
 	app/models/status.rb

The conflict in the Status model was due to
https://github.com/tootsuite/mastodon/commit/5bf500338478f819a65d25636a0af61a482972d3.
It was resolved by accepting tootsuite's changes.
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fetch_link_card_service.rb2
-rw-r--r--app/services/post_status_service.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/services/fetch_link_card_service.rb b/app/services/fetch_link_card_service.rb
index 86d0f9971..560a81768 100644
--- a/app/services/fetch_link_card_service.rb
+++ b/app/services/fetch_link_card_service.rb
@@ -40,7 +40,7 @@ class FetchLinkCardService < BaseService
     @card ||= PreviewCard.new(url: @url)
 
     failed = Request.new(:head, @url).perform do |res|
-      res.code != 405 && (res.code != 200 || res.mime_type != 'text/html')
+      res.code != 405 && res.code != 501 && (res.code != 200 || res.mime_type != 'text/html')
     end
 
     return if failed
diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb
index b1d5bd3a7..6e982c7e6 100644
--- a/app/services/post_status_service.rb
+++ b/app/services/post_status_service.rb
@@ -28,7 +28,7 @@ class PostStatusService < BaseService
       status = account.statuses.create!(text: text,
                                         media_attachments: media || [],
                                         thread: in_reply_to,
-                                        sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]),
+                                        sensitive: (options[:sensitive].nil? ? account.user&.setting_default_sensitive : options[:sensitive]) || options[:spoiler_text].present?,
                                         spoiler_text: options[:spoiler_text] || '',
                                         visibility: options[:visibility] || account.user&.setting_default_privacy,
                                         language: language_from_option(options[:language]) || LanguageDetector.instance.detect(text, account),