]> cat aescling's git repositories - mastodon.git/commitdiff
Merge branch 'master' into glitch-soc/merge-upstream
authorThibaut Girka <thib@sitedethib.com>
Sun, 12 Jan 2020 14:57:34 +0000 (15:57 +0100)
committerThibaut Girka <thib@sitedethib.com>
Sun, 12 Jan 2020 14:57:34 +0000 (15:57 +0100)
Conflicts:
- `Gemfile.lock`:
  No real conflict, glitch-soc-only dependency (redcarpet) too close to an
  upstream one (rdf-normalize)
- `README.md`:
  we have different READMEs, discarded upstream's changes
- `app/views/admin/custom_emojis/index.html.haml`:
  No real conflict, different context because of glitch-soc theming
- `lib/mastodon/statuses_cli.rb`:
  Upstream added code to keep bookmarked statuses, we were already doing so
  with slightly different code. Discarded upstream's changes.
- `package.json`:
  No real conflict, glitch-soc-only dependency (favico.js) too close to
  an upstream one

24 files changed:
1  2 
Gemfile
Gemfile.lock
app/helpers/accounts_helper.rb
app/javascript/mastodon/locales/defaultMessages.json
app/javascript/mastodon/locales/en.json
app/javascript/mastodon/locales/ja.json
app/javascript/mastodon/locales/pl.json
app/javascript/styles/mastodon/admin.scss
app/javascript/styles/mastodon/components.scss
app/lib/formatter.rb
app/lib/sanitize_config.rb
app/models/account.rb
app/models/status.rb
app/views/admin/custom_emojis/index.html.haml
app/views/admin/reports/show.html.haml
app/views/layouts/admin.html.haml
config/locales/en.yml
config/locales/ja.yml
config/locales/pl.yml
config/locales/simple_form.en.yml
config/locales/simple_form.ja.yml
package.json
spec/models/status_spec.rb
yarn.lock

diff --cc Gemfile
index 7e409ffa1276c95b8b7e45f4d9ca2e1e01da9b3e,316ebb81db940cf67724f41506b6468d46521255..c365da5547d214c0e8c95b6a594b3c4b3c23474f
+++ b/Gemfile
@@@ -52,9 -55,8 +55,9 @@@ gem 'goldfinger', '~> 2.1
  gem 'hiredis', '~> 0.6'
  gem 'redis-namespace', '~> 1.7'
  gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
 +gem 'html2text'
  gem 'htmlentities', '~> 4.3'
- gem 'http', '~> 3.3'
+ gem 'http', '~> 4.3'
  gem 'http_accept_language', '~> 2.1'
  gem 'http_parser.rb', '~> 0.6', git: 'https://github.com/tmm1/http_parser.rb', ref: '54b17ba8c7d8d20a16dfc65d1775241833219cf2', submodules: true
  gem 'httplog', '~> 1.3'
@@@ -100,10 -101,8 +102,10 @@@ gem 'webpush
  
  gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', ref: 'e742697a0906e74e8bb777ef98137bc3955d981d'
  gem 'json-ld-preloaded', '~> 3.0'
- gem 'rdf-normalize', '~> 0.3'
+ gem 'rdf-normalize', '~> 0.4'
  
 +gem 'redcarpet', '~> 3.4'
 +
  group :development, :test do
    gem 'fabrication', '~> 2.21'
    gem 'fuubar', '~> 2.5'
diff --cc Gemfile.lock
index a2def3c6e77e844732a60a62bdc4e280e913d684,44682002af5fc28c2f44a4017b205c6ffe898c46..ec7ac0f5a9c480c75ab102712b485c2350700c53
@@@ -292,17 -296,17 +296,19 @@@ GE
      highline (2.0.1)
      hiredis (0.6.3)
      hkdf (0.3.0)
 +    html2text (0.2.1)
 +      nokogiri (~> 1.6)
      htmlentities (4.3.4)
-     http (3.3.0)
+     http (4.3.0)
        addressable (~> 2.3)
        http-cookie (~> 1.0)
-       http-form_data (~> 2.0)
-       http_parser.rb (~> 0.6.0)
+       http-form_data (~> 2.2)
+       http-parser (~> 1.2.0)
      http-cookie (1.0.3)
        domain_name (~> 0.5)
-     http-form_data (2.1.1)
+     http-form_data (2.2.0)
+     http-parser (1.2.1)
+       ffi-compiler (>= 1.0, < 2.0)
      http_accept_language (2.1.1)
      httplog (1.3.3)
        rack (>= 1.0)
        thor (>= 0.19.0, < 2.0)
      rainbow (3.0.0)
      rake (13.0.1)
-     rdf (3.0.13)
+     rdf (3.1.0)
        hamster (~> 3.0)
        link_header (~> 0.0, >= 0.0.8)
-     rdf-normalize (0.3.3)
-       rdf (>= 2.2, < 4.0)
+     rdf-normalize (0.4.0)
+       rdf (~> 3.1)
 +    redcarpet (3.4.0)
      redis (4.1.3)
      redis-actionpack (5.0.2)
        actionpack (>= 4.0, < 6)
@@@ -723,9 -726,8 +729,9 @@@ DEPENDENCIE
    hamlit-rails (~> 0.2)
    health_check!
    hiredis (~> 0.6)
 +  html2text
    htmlentities (~> 4.3)
-   http (~> 3.3)
+   http (~> 4.3)
    http_accept_language (~> 2.1)
    http_parser.rb (~> 0.6)!
    httplog (~> 1.3)
    rails-controller-testing (~> 1.0)
    rails-i18n (~> 5.1)
    rails-settings-cached (~> 0.6)
-   rdf-normalize (~> 0.3)
+   rdf-normalize (~> 0.4)
 +  redcarpet (~> 3.4)
    redis (~> 4.1)
    redis-namespace (~> 1.7)
    redis-rails (~> 5.0)
Simple merge
index 9159db2a158db9bad204a0c056e90461cc938902,c771dcaaa0d4c178b075b0a708fae84a527ad501..36cdae9f7e474af55fefbebfc32da59e0f58084b
@@@ -308,33 -245,11 +308,34 @@@ class Formatte
      end
  
      standard = Extractor.extract_entities_with_indices(text, options)
+     xmpp = Extractor.extract_xmpp_uris_with_indices(text, options)
  
-     Extractor.remove_overlapping_entities(special + standard)
+     Extractor.remove_overlapping_entities(special + standard + xmpp)
    end
  
 +  def html_friendly_extractor(html, options = {})
 +    gaps = []
 +    total_offset = 0
 +
 +    escaped = html.gsub(/<[^>]*>|&#[0-9]+;/) do |match|
 +      total_offset += match.length - 1
 +      end_offset = Regexp.last_match.end(0)
 +      gaps << [end_offset - total_offset, total_offset]
 +      "\u200b"
 +    end
 +
 +    entities = Extractor.extract_hashtags_with_indices(escaped, :check_url_overlap => false) +
 +               Extractor.extract_mentions_or_lists_with_indices(escaped)
 +    Extractor.remove_overlapping_entities(entities).map do |extract|
 +      pos = extract[:indices].first
 +      offset_idx = gaps.rindex { |gap| gap.first <= pos }
 +      offset = offset_idx.nil? ? 0 : gaps[offset_idx].last
 +      next extract.merge(
 +        :indices => [extract[:indices].first + offset, extract[:indices].last + offset]
 +      )
 +    end
 +  end
 +
    def link_to_url(entity, options = {})
      url        = Addressable::URI.parse(entity[:url])
      html_attrs = { target: '_blank', rel: 'nofollow noopener noreferrer' }
Simple merge
Simple merge
Simple merge
index 4fbadee9053b2e929ce51f0f4a4ce8e552f8ecc7,389e9dd71901b657225d6218c8137ab5f3ed03c4..dc9ebf50758a8199e9bbd4f1760c71418eaf2b78
@@@ -1,6 -1,12 +1,9 @@@
  - content_for :page_title do
    = t('admin.custom_emojis.title')
  
 -- content_for :header_tags do
 -  = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
 -
+ - content_for :heading_actions do
+   = link_to t('admin.custom_emojis.upload'), new_admin_custom_emoji_path, class: 'button'
  .filters
    .filter-subset
      %strong= t('admin.accounts.location.title')
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc package.json
index d72c9b93dd218b29eac10f961bff33dcfaa75735,2726fd1c017a3963f4c3433eb9f83b6ef91ca8eb..649ecbbcb5f4fdfd5b78e33ba08e95ea121d8704
@@@ -95,8 -93,7 +95,8 @@@
      "escape-html": "^1.0.3",
      "exif-js": "^2.3.0",
      "express": "^4.17.1",
-     "file-loader": "^4.2.0",
+     "file-loader": "^5.0.2",
 +    "favico.js": "^0.3.10",
      "font-awesome": "^4.7.0",
      "glob": "^7.1.6",
      "history": "^4.10.1",
Simple merge
diff --cc yarn.lock
Simple merge