about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Vagrantfile2
-rw-r--r--app/javascript/glitch/components/local_settings/page/index.js10
-rw-r--r--app/javascript/glitch/components/status/index.js4
-rw-r--r--app/javascript/glitch/locales/en.json1
-rw-r--r--app/javascript/glitch/reducers/local_settings.js1
m---------app/javascript/themes/mastodon-go0
-rw-r--r--app/models/glitch/keyword_mute.rb4
-rw-r--r--config/environments/production.rb4
-rw-r--r--spec/models/glitch/keyword_mute_spec.rb7
10 files changed, 32 insertions, 4 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..35b0cd787
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "app/javascript/themes/mastodon-go"]
+	path = app/javascript/themes/mastodon-go
+	url = https://github.com/marrus-sh/mastodon-go
diff --git a/Vagrantfile b/Vagrantfile
index 0c21bed68..351ab5cfa 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -83,7 +83,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
 
   config.vm.provider :virtualbox do |vb|
     vb.name = "mastodon"
-    vb.customize ["modifyvm", :id, "--memory", "2048"]
+    vb.customize ["modifyvm", :id, "--memory", "4096"]
 
     # Disable VirtualBox DNS proxy to skip long-delay IPv6 resolutions.
     # https://github.com/mitchellh/vagrant/issues/1172
diff --git a/app/javascript/glitch/components/local_settings/page/index.js b/app/javascript/glitch/components/local_settings/page/index.js
index 366c113c0..498230f7b 100644
--- a/app/javascript/glitch/components/local_settings/page/index.js
+++ b/app/javascript/glitch/components/local_settings/page/index.js
@@ -126,6 +126,16 @@ export default class LocalSettingsPage extends React.PureComponent {
           </LocalSettingsPageItem>
           <LocalSettingsPageItem
             settings={settings}
+            item={['collapsed', 'auto', 'reblogs']}
+            id='mastodon-settings--collapsed-auto-reblogs'
+            onChange={onChange}
+            dependsOn={[['collapsed', 'enabled']]}
+            dependsOnNot={[['collapsed', 'auto', 'all']]}
+          >
+            <FormattedMessage id='settings.auto_collapse_reblogs' defaultMessage='Boosts' />
+          </LocalSettingsPageItem>
+          <LocalSettingsPageItem
+            settings={settings}
             item={['collapsed', 'auto', 'replies']}
             id='mastodon-settings--collapsed-auto-replies'
             onChange={onChange}
diff --git a/app/javascript/glitch/components/status/index.js b/app/javascript/glitch/components/status/index.js
index 9e758793c..6bd95b051 100644
--- a/app/javascript/glitch/components/status/index.js
+++ b/app/javascript/glitch/components/status/index.js
@@ -287,6 +287,7 @@ properly and our intersection observer is good to go.
       muted,
       id,
       intersectionObserverWrapper,
+      prepend,
     } = this.props;
     const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);
 
@@ -300,6 +301,9 @@ properly and our intersection observer is good to go.
           status.get('media_attachments').size && !muted ? 650 : 400
         )
       ) || (
+        autoCollapseSettings.get('reblogs') &&
+        prepend === 'reblogged_by'
+      ) || (
         autoCollapseSettings.get('replies') &&
         status.get('in_reply_to_id', null) !== null
       ) || (
diff --git a/app/javascript/glitch/locales/en.json b/app/javascript/glitch/locales/en.json
index 18e412356..69aa29108 100644
--- a/app/javascript/glitch/locales/en.json
+++ b/app/javascript/glitch/locales/en.json
@@ -14,6 +14,7 @@
   "settings.auto_collapse_lengthy": "Lengthy toots",
   "settings.auto_collapse_media": "Toots with media",
   "settings.auto_collapse_notifications": "Notifications",
+  "settings.auto_collapse_reblogs": "Boosts",
   "settings.auto_collapse_replies": "Replies",
   "settings.close": "Close",
   "settings.collapsed_statuses": "Collapsed toots",
diff --git a/app/javascript/glitch/reducers/local_settings.js b/app/javascript/glitch/reducers/local_settings.js
index 813e130ca..03654fbe2 100644
--- a/app/javascript/glitch/reducers/local_settings.js
+++ b/app/javascript/glitch/reducers/local_settings.js
@@ -59,6 +59,7 @@ const initialState = ImmutableMap({
       all              : false,
       notifications    : true,
       lengthy          : true,
+      reblogs          : false,
       replies          : false,
       media            : false,
     }),
diff --git a/app/javascript/themes/mastodon-go b/app/javascript/themes/mastodon-go
new file mode 160000
+Subproject 74c0293e83dbb49ea4f27eea108526df6216d2a
diff --git a/app/models/glitch/keyword_mute.rb b/app/models/glitch/keyword_mute.rb
index 73de4d4b7..009de1880 100644
--- a/app/models/glitch/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -35,7 +35,7 @@ class Glitch::KeywordMute < ApplicationRecord
     def initialize(account_id)
       @account_id = account_id
       regex_text = Rails.cache.fetch("keyword_mutes:regex:#{account_id}") { regex_text_for_account }
-      @regex = /#{regex_text}/i
+      @regex = /#{regex_text}/
     end
 
     def =~(str)
@@ -60,7 +60,7 @@ class Glitch::KeywordMute < ApplicationRecord
       sb = keyword =~ /\A[[:word:]]/ ? '\b' : ''
       eb = keyword =~ /[[:word:]]\Z/ ? '\b' : ''
 
-      /#{sb}#{Regexp.escape(keyword)}#{eb}/
+      /(?mix:#{sb}#{Regexp.escape(keyword)}#{eb})/
     end
   end
 end
diff --git a/config/environments/production.rb b/config/environments/production.rb
index e0ee393c1..f7cb4b08a 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -97,6 +97,8 @@ Rails.application.configure do
     'X-XSS-Protection'        => '1; mode=block',
     'Content-Security-Policy' => "frame-ancestors 'none'; object-src 'none'; script-src 'self' https://dev-static.glitch.social 'unsafe-inline'; base-uri 'none';" , 
     'Referrer-Policy'         => 'no-referrer, strict-origin-when-cross-origin',
-    'Strict-Transport-Security' => 'max-age=63072000; includeSubDomains; preload'
+    'Strict-Transport-Security' => 'max-age=63072000; includeSubDomains; preload',
+    'X-Clacks-Overhead' => 'GNU Natalie Nguyen'
+
   }
 end
diff --git a/spec/models/glitch/keyword_mute_spec.rb b/spec/models/glitch/keyword_mute_spec.rb
index 1423823ba..9685c6493 100644
--- a/spec/models/glitch/keyword_mute_spec.rb
+++ b/spec/models/glitch/keyword_mute_spec.rb
@@ -60,6 +60,13 @@ RSpec.describe Glitch::KeywordMute, type: :model do
         expect(matcher =~ 'This is a HOT take').to be_truthy
       end
 
+      it 'maintains case-insensitivity when combining keywords into a single matcher' do
+        Glitch::KeywordMute.create!(account: alice, keyword: 'hot')
+        Glitch::KeywordMute.create!(account: alice, keyword: 'cold')
+
+        expect(matcher =~ 'This is a HOT take').to be_truthy
+      end
+
       it 'matches keywords surrounded by non-alphanumeric ornamentation' do
         Glitch::KeywordMute.create!(account: alice, keyword: 'hot')