]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorClaire <claire.github-309c@sitedethib.com>
Sat, 5 Dec 2020 16:33:29 +0000 (17:33 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Sat, 5 Dec 2020 16:33:37 +0000 (17:33 +0100)
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.

13 files changed:
1  2 
Gemfile
Gemfile.lock
app/helpers/application_helper.rb
app/javascript/mastodon/features/compose/components/compose_form.js
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/pl.json
app/javascript/styles/mastodon/components.scss
app/services/remove_status_service.rb
app/views/statuses/_simple_status.html.haml
lib/mastodon/version.rb
package.json
yarn.lock

diff --cc Gemfile
Simple merge
diff --cc Gemfile.lock
Simple merge
Simple merge
index 46c52d9e4b97bf66ff0e381e109ffe2e513e6fde,8af806ec437b8d0b748c0ca566e50c38f3a495ff..adec8dc8bc1917ff318229e315b80e31d05ed244
@@@ -78,6 -77,18 +78,18 @@@ class ComposeForm extends ImmutablePure
      }
    }
  
 -    return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
+   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) > 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)
              <PrivacyDropdownContainer />
              <SpoilerButtonContainer />
            </div>
-           <div className='character-counter__wrapper'><CharacterCounter max={maxChars} text={text} /></div>
 -          <div className='character-counter__wrapper'><CharacterCounter max={500} text={this.getFulltextForCharacterCounting()} /></div>
++          <div className='character-counter__wrapper'><CharacterCounter max={maxChars} text={this.getFulltextForCharacterCounting()} /></div>
          </div>
  
          <div className='compose-form__publish'>
index a5aafee21ecfcd0d01fe75c33f855474668cc01a,d6043fb5d8099cc318286c2b49fbe851b11bd6db..2918c6f6ff099fe010a14a4b561c87a14a7f5a68
@@@ -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
      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?)
  
Simple merge
diff --cc package.json
Simple merge
diff --cc yarn.lock
Simple merge