From: Thibaut Girka Date: Wed, 15 May 2019 15:11:40 +0000 (+0200) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=6badf2d252a980d496b894c7258a778c57639953;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream --- 6badf2d252a980d496b894c7258a778c57639953 diff --cc app/services/post_status_service.rb index 333bf88d8,b470a40e9..d2cca145b --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@@ -47,12 -47,9 +47,12 @@@ class PostStatusService < BaseServic private def preprocess_attributes! - @text = @options.delete(:spoiler_text) if @text.blank? && @options[:spoiler_text].present? + if @text.blank? && @options[:spoiler_text].present? + @text = '.' + @text = @media.find(&:video?) ? '📹' : '🖼' if @media.size > 0 + end @visibility = @options[:visibility] || @account.user&.setting_default_privacy - @visibility = :unlisted if @visibility == :public && @account.silenced + @visibility = :unlisted if @visibility == :public && @account.silenced? @scheduled_at = @options[:scheduled_at]&.to_datetime @scheduled_at = nil if scheduled_in_the_past? rescue ArgumentError diff --cc spec/services/notify_service_spec.rb index 7bfca7fb5,a387d9407..a68fdd8df --- a/spec/services/notify_service_spec.rb +++ b/spec/services/notify_service_spec.rb @@@ -44,10 -44,10 +44,10 @@@ RSpec.describe NotifyService, type: :se end it 'does not notify when recipient is suspended' do - recipient.update(suspended: true) + recipient.suspend! is_expected.to_not change(Notification, :count) end - + context 'for direct messages' do let(:activity) { Fabricate(:mention, account: recipient, status: Fabricate(:status, account: sender, visibility: :direct)) }