From: Claire Date: Sat, 5 Dec 2020 16:33:29 +0000 (+0100) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=f8d867bac43e7e18d293ac32a9be597d1f46dce3;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - `app/services/remove_status_service.rb`: Conflict caused by us having a distinc Direct timeline. Ported upstream changes. - `app/javascript/mastodon/features/compose/components/compose_form.js`: Conflict between glitch-soc's variable character limit and upstream refactoring that part of the code. Ported upstream changes. --- f8d867bac43e7e18d293ac32a9be597d1f46dce3 diff --cc app/javascript/mastodon/features/compose/components/compose_form.js index 46c52d9e4,8af806ec4..adec8dc8b --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@@ -78,6 -77,18 +78,18 @@@ class ComposeForm extends ImmutablePure } } + getFulltextForCharacterCounting = () => { + return [this.props.spoiler? this.props.spoilerText: '', countableText(this.props.text)].join(''); + } + + canSubmit = () => { + const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props; + const fulltext = this.getFulltextForCharacterCounting(); + const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0; + - return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia)); ++ return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (isOnlyWhitespace && !anyMedia)); + } + handleSubmit = () => { if (this.props.text !== this.autosuggestTextarea.textarea.value) { // Something changed the text inside the textarea (e.g. browser extensions like Grammarly) @@@ -244,7 -249,7 +250,7 @@@ -
-
++
diff --cc app/services/remove_status_service.rb index a5aafee21,d6043fb5d..2918c6f6f --- a/app/services/remove_status_service.rb +++ b/app/services/remove_status_service.rb @@@ -21,17 -18,32 +18,33 @@@ class RemoveStatusService < BaseServic RedisLock.acquire(lock_options) do |lock| if lock.acquired? - remove_from_self if status.account.local? + remove_from_self if @account.local? remove_from_followers remove_from_lists - remove_from_affected - remove_reblogs - remove_from_hashtags - remove_from_public - remove_from_media if status.media_attachments.any? - remove_from_direct if status.direct_visibility? - remove_from_spam_check - remove_media + + # There is no reason to send out Undo activities when the + # cause is that the original object has been removed, since + # original object being removed implicitly removes reblogs + # of it. The Delete activity of the original is forwarded + # separately. + if @account.local? && !@options[:original_removed] + remove_from_remote_followers + remove_from_remote_reach + end + + # Since reblogs don't mention anyone, don't get reblogged, + # favourited and don't contain their own media attachments + # or hashtags, this can be skipped + unless @status.reblog? + remove_from_mentions + remove_reblogs + remove_from_hashtags + remove_from_public + remove_from_media if @status.media_attachments.any? ++ remove_from_direct if status.direct_visibility? + remove_from_spam_check + remove_media + end @status.destroy! if @options[:immediate] || !@status.reported? else @@@ -153,19 -154,9 +156,15 @@@ return unless @status.public_visibility? redis.publish('timeline:public:media', @payload) - if @status.local? - redis.publish('timeline:public:local:media', @payload) - else - redis.publish('timeline:public:remote:media', @payload) - end + redis.publish(@status.local? ? 'timeline:public:local:media' : 'timeline:public:remote:media', @payload) end + def remove_from_direct + @mentions.each do |mention| + FeedManager.instance.unpush_from_direct(mention.account, @status) if mention.account.local? + end + end + def remove_media return if @options[:redraft] || (!@options[:immediate] && @status.reported?)