Skip to content

Commit c363eb8

Browse files
committed
Merge commit 'cf9bbf0a95a4841b62354ad3a314e95bc4ccc3e3' into glitch-soc/merge-4.5
Conflicts: - `package.json` and `yarn.lock`: Conflict because of a glitch-soc-only dependency textually adjacent to one updated by upstream. Updated as upstream did.
2 parents a6dc5bc + cf9bbf0 commit c363eb8

10 files changed

Lines changed: 119 additions & 52 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ gem 'haml-rails', '~>3.0'
1313
gem 'pg', '~> 1.5'
1414
gem 'pghero'
1515

16-
gem 'aws-sdk-core', '< 3.216.0', require: false # TODO: https://github.com/mastodon/mastodon/pull/34173#issuecomment-2733378873
16+
gem 'aws-sdk-core', require: false
1717
gem 'aws-sdk-s3', '~> 1.123', require: false
1818
gem 'blurhash', '~> 0.1'
1919
gem 'fog-core', '<= 2.6.0'

Gemfile.lock

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,20 @@ GEM
9696
ast (2.4.3)
9797
attr_required (1.0.2)
9898
aws-eventstream (1.4.0)
99-
aws-partitions (1.1168.0)
100-
aws-sdk-core (3.215.1)
99+
aws-partitions (1.1238.0)
100+
aws-sdk-core (3.244.0)
101101
aws-eventstream (~> 1, >= 1.3.0)
102102
aws-partitions (~> 1, >= 1.992.0)
103103
aws-sigv4 (~> 1.9)
104+
base64
105+
bigdecimal
104106
jmespath (~> 1, >= 1.6.1)
105-
aws-sdk-kms (1.96.0)
106-
aws-sdk-core (~> 3, >= 3.210.0)
107+
logger
108+
aws-sdk-kms (1.123.0)
109+
aws-sdk-core (~> 3, >= 3.244.0)
107110
aws-sigv4 (~> 1.5)
108-
aws-sdk-s3 (1.177.0)
109-
aws-sdk-core (~> 3, >= 3.210.0)
111+
aws-sdk-s3 (1.219.0)
112+
aws-sdk-core (~> 3, >= 3.244.0)
110113
aws-sdk-kms (~> 1)
111114
aws-sigv4 (~> 1.5)
112115
aws-sigv4 (1.12.1)
@@ -115,7 +118,7 @@ GEM
115118
rexml
116119
base64 (0.3.0)
117120
bcp47_spec (0.2.1)
118-
bcrypt (3.1.20)
121+
bcrypt (3.1.22)
119122
benchmark (0.5.0)
120123
better_errors (2.10.1)
121124
erubi (>= 1.0.0)
@@ -346,7 +349,7 @@ GEM
346349
azure-blob (~> 0.5.2)
347350
hashie (~> 5.0)
348351
jmespath (1.6.2)
349-
json (2.15.1)
352+
json (2.15.2.1)
350353
json-canonicalization (1.0.0)
351354
json-jwt (1.17.0)
352355
activesupport (>= 4.2)
@@ -621,7 +624,7 @@ GEM
621624
activesupport (>= 3.0.0)
622625
raabro (1.4.0)
623626
racc (1.8.1)
624-
rack (3.2.5)
627+
rack (3.2.6)
625628
rack-attack (6.8.0)
626629
rack (>= 1.0, < 4)
627630
rack-cors (3.0.0)
@@ -640,7 +643,7 @@ GEM
640643
rack (>= 3.0.0, < 4)
641644
rack-proxy (0.7.7)
642645
rack
643-
rack-session (2.1.1)
646+
rack-session (2.1.2)
644647
base64 (>= 0.1.0)
645648
rack (>= 3.0.0)
646649
rack-test (2.2.0)
@@ -933,7 +936,7 @@ DEPENDENCIES
933936
active_model_serializers (~> 0.10)
934937
addressable (~> 2.8)
935938
annotaterb (~> 4.13)
936-
aws-sdk-core (< 3.216.0)
939+
aws-sdk-core
937940
aws-sdk-s3 (~> 1.123)
938941
better_errors (~> 2.9)
939942
binding_of_caller (~> 1.0)

app/helpers/context_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module ContextHelper
2828
attribution_domains: { 'toot' => 'http://joinmastodon.org/ns#', 'attributionDomains' => { '@id' => 'toot:attributionDomains', '@type' => '@id' } },
2929
quote_requests: { 'QuoteRequest' => 'https://w3id.org/fep/044f#QuoteRequest' },
3030
quotes: {
31-
'quote' => 'https://w3id.org/fep/044f#quote',
31+
'quote' => { '@id' => 'https://w3id.org/fep/044f#quote', '@type' => '@id' },
3232
'quoteUri' => 'http://fedibird.com/ns#quoteUri',
3333
'_misskey_quote' => 'https://misskey-hub.net/ns#_misskey_quote',
3434
'quoteAuthorization' => { '@id' => 'https://w3id.org/fep/044f#quoteAuthorization', '@type' => '@id' },

app/javascript/mastodon/actions/notifications.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ defineMessages({
2626

2727
export function updateNotifications(notification, intlMessages, intlLocale) {
2828
return (dispatch, getState) => {
29-
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', notification.type], true);
30-
const playSound = getState().getIn(['settings', 'notifications', 'sounds', notification.type], true);
29+
const filterType = notification.type === 'quoted_update' ? 'update' : notification.type;
30+
31+
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', filterType], true);
32+
const playSound = getState().getIn(['settings', 'notifications', 'sounds', filterType], true);
3133

3234
let filtered = false;
3335

app/policies/status_policy.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ def show?
2020
end
2121
end
2222

23-
# This is about requesting a quote post, not validating it
2423
def quote?
25-
show? && record.quote_policy_for_account(current_account, preloaded_relations: @preloaded_relations) != :denied
24+
show? && !blocking_author? && record.quote_policy_for_account(current_account, preloaded_relations: @preloaded_relations) != :denied
2625
end
2726

2827
def reblog?

app/services/activitypub/process_account_service.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ def call(username, domain, json, options = {})
2828
@options[:request_id] ||= "#{Time.now.utc.to_i}-#{username}@#{domain}"
2929

3030
with_redis_lock("process_account:#{@uri}") do
31-
@account = Account.remote.find_by(uri: @uri) if @options[:only_key]
32-
@account ||= Account.find_remote(@username, @domain)
31+
if @options[:only_key]
32+
# `only_key` is used to update an existing account known by its `uri`.
33+
# Lookup by handle and new account creation do not make sense in this case.
34+
@account = Account.remote.find_by(uri: @uri)
35+
return if @account.nil?
36+
else
37+
@account = Account.find_remote(@username, @domain)
38+
end
39+
3340
@old_public_key = @account&.public_key
3441
@old_protocol = @account&.protocol
3542
@suspension_changed = false

lib/tasks/mastodon.rake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ namespace :mastodon do
2727
q.messages[:valid?] = 'Invalid domain. If you intend to use unicode characters, enter punycode here'
2828
end
2929

30+
if env['LOCAL_DOMAIN'].include?('mastodon') || env['LOCAL_DOMAIN'].include?('mstdn')
31+
prompt.warn 'The Mastodon name is a trademark and its use is restricted.'
32+
prompt.warn 'You can read the trademark policy at https://joinmastodon.org/trademark'
33+
next prompt.warn 'Nothing saved. Bye!' if prompt.no?('Continue anyway?')
34+
end
35+
3036
prompt.say "\n"
3137

3238
prompt.say('Single user mode disables registrations and redirects the landing page to your public profile.')

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"arrow-key-navigation": "^1.2.0",
5858
"async-mutex": "^0.5.0",
5959
"atrament": "0.2.4",
60-
"axios": "^1.4.0",
60+
"axios": "^1.15.0",
6161
"babel-plugin-formatjs": "^10.5.37",
6262
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
6363
"blurhash": "^2.0.5",
@@ -80,11 +80,11 @@
8080
"hoist-non-react-statics": "^3.3.2",
8181
"http-link-header": "^1.1.1",
8282
"idb": "^8.0.3",
83-
"immutable": "^4.3.0",
83+
"immutable": "^4.3.7",
8484
"intl-messageformat": "^10.7.16",
8585
"js-yaml": "^4.1.0",
8686
"lande": "^1.0.10",
87-
"lodash": "^4.17.21",
87+
"lodash": "4.18.1",
8888
"marky": "^1.2.5",
8989
"path-complete-extname": "^1.0.0",
9090
"postcss-preset-env": "^10.1.5",

spec/requests/api/v1/statuses_spec.rb

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,56 @@
304304
end
305305
end
306306

307+
context 'with a quote in an unlisted message' do
308+
let!(:quoted_status) { Fabricate(:status, quote_approval_policy: Status::QUOTE_APPROVAL_POLICY_FLAGS[:public] << 16) }
309+
let(:params) do
310+
{
311+
status: 'Hello, this is a quote',
312+
quoted_status_id: quoted_status.id,
313+
visibility: 'unlisted',
314+
}
315+
end
316+
317+
it 'returns a quote post, as well as rate limit headers', :aggregate_failures do
318+
expect { subject }.to change(user.account.statuses, :count).by(1)
319+
320+
expect(response).to have_http_status(200)
321+
expect(response.content_type)
322+
.to start_with('application/json')
323+
expect(response.parsed_body[:quote]).to be_present
324+
expect(response.headers['X-RateLimit-Limit']).to eq RateLimiter::FAMILIES[:statuses][:limit].to_s
325+
expect(response.headers['X-RateLimit-Remaining']).to eq (RateLimiter::FAMILIES[:statuses][:limit] - 1).to_s
326+
end
327+
328+
context 'when the quoter is blocked by the quotee' do
329+
before do
330+
quoted_status.account.block!(user.account)
331+
end
332+
333+
it 'returns an error and does not create a post', :aggregate_failures do
334+
expect { subject }.to_not change(user.account.statuses, :count)
335+
336+
expect(response).to have_http_status(404)
337+
expect(response.content_type)
338+
.to start_with('application/json')
339+
end
340+
end
341+
342+
context 'when the quotee is blocked by the quoter' do
343+
before do
344+
user.account.block!(quoted_status.account)
345+
end
346+
347+
it 'returns an error and does not create a post', :aggregate_failures do
348+
expect { subject }.to_not change(user.account.statuses, :count)
349+
350+
expect(response).to have_http_status(404)
351+
expect(response.content_type)
352+
.to start_with('application/json')
353+
end
354+
end
355+
end
356+
307357
context 'with a quote of a reblog' do
308358
let(:quoted_status) { Fabricate(:status, quote_approval_policy: Status::QUOTE_APPROVAL_POLICY_FLAGS[:public] << 16) }
309359
let(:reblog) { Fabricate(:status, reblog: quoted_status) }

yarn.lock

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,7 @@ __metadata:
28442844
arrow-key-navigation: "npm:^1.2.0"
28452845
async-mutex: "npm:^0.5.0"
28462846
atrament: "npm:0.2.4"
2847-
axios: "npm:^1.4.0"
2847+
axios: "npm:^1.15.0"
28482848
babel-plugin-formatjs: "npm:^10.5.37"
28492849
babel-plugin-transform-react-remove-prop-types: "npm:^0.4.24"
28502850
blurhash: "npm:^2.0.5"
@@ -2881,12 +2881,12 @@ __metadata:
28812881
http-link-header: "npm:^1.1.1"
28822882
husky: "npm:^9.0.11"
28832883
idb: "npm:^8.0.3"
2884-
immutable: "npm:^4.3.0"
2884+
immutable: "npm:^4.3.7"
28852885
intl-messageformat: "npm:^10.7.16"
28862886
js-yaml: "npm:^4.1.0"
28872887
lande: "npm:^1.0.10"
28882888
lint-staged: "npm:^16.0.0"
2889-
lodash: "npm:^4.17.21"
2889+
lodash: "npm:4.18.1"
28902890
marky: "npm:^1.2.5"
28912891
msw: "npm:^2.10.2"
28922892
msw-storybook-addon: "npm:^2.0.5"
@@ -5487,14 +5487,14 @@ __metadata:
54875487
languageName: node
54885488
linkType: hard
54895489

5490-
"axios@npm:^1.4.0":
5491-
version: 1.13.1
5492-
resolution: "axios@npm:1.13.1"
5490+
"axios@npm:^1.15.0":
5491+
version: 1.15.0
5492+
resolution: "axios@npm:1.15.0"
54935493
dependencies:
5494-
follow-redirects: "npm:^1.15.6"
5495-
form-data: "npm:^4.0.4"
5496-
proxy-from-env: "npm:^1.1.0"
5497-
checksum: 10c0/de9c3c6de43d3ee1146d3afe78645f19450cac6a5d7235bef8b8e8eeb705c2e47e2d231dea99cecaec4dae1897c521118ca9413b9d474063c719c4d94c5b9adc
5494+
follow-redirects: "npm:^1.15.11"
5495+
form-data: "npm:^4.0.5"
5496+
proxy-from-env: "npm:^2.1.0"
5497+
checksum: 10c0/47e0f860e98d4d7aa145e89ce0cae00e1fb0f1d2485f065c21fce955ddb1dba4103a46bd0e47acd18a27208a7f62c96249e620db575521b92a968619ab133409
54985498
languageName: node
54995499
linkType: hard
55005500

@@ -7702,13 +7702,13 @@ __metadata:
77027702
languageName: node
77037703
linkType: hard
77047704

7705-
"follow-redirects@npm:^1.15.6":
7706-
version: 1.15.6
7707-
resolution: "follow-redirects@npm:1.15.6"
7705+
"follow-redirects@npm:^1.15.11":
7706+
version: 1.16.0
7707+
resolution: "follow-redirects@npm:1.16.0"
77087708
peerDependenciesMeta:
77097709
debug:
77107710
optional: true
7711-
checksum: 10c0/9ff767f0d7be6aa6870c82ac79cf0368cd73e01bbc00e9eb1c2a16fbb198ec105e3c9b6628bb98e9f3ac66fe29a957b9645bcb9a490bb7aa0d35f908b6b85071
7711+
checksum: 10c0/a1e2900163e6f1b4d1ed5c221b607f41decbab65534c63fe7e287e40a5d552a6496e7d9d7d976fa4ba77b4c51c11e5e9f683f10b43011ea11e442ff128d0e181
77127712
languageName: node
77137713
linkType: hard
77147714

@@ -7731,16 +7731,16 @@ __metadata:
77317731
languageName: node
77327732
linkType: hard
77337733

7734-
"form-data@npm:^4.0.4":
7735-
version: 4.0.4
7736-
resolution: "form-data@npm:4.0.4"
7734+
"form-data@npm:^4.0.5":
7735+
version: 4.0.5
7736+
resolution: "form-data@npm:4.0.5"
77377737
dependencies:
77387738
asynckit: "npm:^0.4.0"
77397739
combined-stream: "npm:^1.0.8"
77407740
es-set-tostringtag: "npm:^2.1.0"
77417741
hasown: "npm:^2.0.2"
77427742
mime-types: "npm:^2.1.12"
7743-
checksum: 10c0/373525a9a034b9d57073e55eab79e501a714ffac02e7a9b01be1c820780652b16e4101819785e1e18f8d98f0aee866cc654d660a435c378e16a72f2e7cac9695
7743+
checksum: 10c0/dd6b767ee0bbd6d84039db12a0fa5a2028160ffbfaba1800695713b46ae974a5f6e08b3356c3195137f8530dcd9dfcb5d5ae1eeff53d0db1e5aad863b619ce3b
77447744
languageName: node
77457745
linkType: hard
77467746

@@ -8362,10 +8362,10 @@ __metadata:
83628362
languageName: node
83638363
linkType: hard
83648364

8365-
"immutable@npm:^4.0.0-rc.1, immutable@npm:^4.3.0":
8366-
version: 4.3.7
8367-
resolution: "immutable@npm:4.3.7"
8368-
checksum: 10c0/9b099197081b22f6433003e34929da8ecddbbdc1474cdc8aa3b7669dee4adda349c06143de22def36016d1b6de5322b043eccd7a11db1dad2ca85dad4fff5435
8365+
"immutable@npm:^4.0.0-rc.1, immutable@npm:^4.3.7":
8366+
version: 4.3.8
8367+
resolution: "immutable@npm:4.3.8"
8368+
checksum: 10c0/3de58996305a0faf6ef3fc0685f996c42653ad757760214f5aec7d4a6b59ea7abb882522c5f9a61776fae88c0b45e08eb77cbded5a4f57745ec7c63f9642e44b
83698369
languageName: node
83708370
linkType: hard
83718371

@@ -9377,10 +9377,10 @@ __metadata:
93779377
languageName: node
93789378
linkType: hard
93799379

9380-
"lodash@npm:^4.17.20, lodash@npm:^4.17.21":
9381-
version: 4.17.21
9382-
resolution: "lodash@npm:4.17.21"
9383-
checksum: 10c0/d8cbea072bb08655bb4c989da418994b073a608dffa608b09ac04b43a791b12aeae7cd7ad919aa4c925f33b48490b5cfe6c1f71d827956071dae2e7bb3a6b74c
9380+
"lodash@npm:4.18.1, lodash@npm:^4.17.20, lodash@npm:^4.17.21":
9381+
version: 4.18.1
9382+
resolution: "lodash@npm:4.18.1"
9383+
checksum: 10c0/757228fc68805c59789e82185135cf85f05d0b2d3d54631d680ca79ec21944ec8314d4533639a14b8bcfbd97a517e78960933041a5af17ecb693ec6eecb99a27
93849384
languageName: node
93859385
linkType: hard
93869386

@@ -11220,10 +11220,10 @@ __metadata:
1122011220
languageName: node
1122111221
linkType: hard
1122211222

11223-
"proxy-from-env@npm:^1.1.0":
11224-
version: 1.1.0
11225-
resolution: "proxy-from-env@npm:1.1.0"
11226-
checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b
11223+
"proxy-from-env@npm:^2.1.0":
11224+
version: 2.1.0
11225+
resolution: "proxy-from-env@npm:2.1.0"
11226+
checksum: 10c0/ed01729fd4d094eab619cd7e17ce3698b3413b31eb102c4904f9875e677cd207392795d5b4adee9cec359dfd31c44d5ad7595a3a3ad51c40250e141512281c58
1122711227
languageName: node
1122811228
linkType: hard
1122911229

0 commit comments

Comments
 (0)