Skip to content

Commit 740bd91

Browse files
authored
Merge pull request #1100 from kmycode/kb-draft-23.1
Release: 23.1
2 parents 3393e70 + ef0d497 commit 740bd91

File tree

14 files changed

+148
-60
lines changed

14 files changed

+148
-60
lines changed

Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ GEM
9999
ast (2.4.3)
100100
attr_required (1.0.2)
101101
aws-eventstream (1.4.0)
102-
aws-partitions (1.1227.0)
102+
aws-partitions (1.1238.0)
103103
aws-sdk-core (3.244.0)
104104
aws-eventstream (~> 1, >= 1.3.0)
105105
aws-partitions (~> 1, >= 1.992.0)
@@ -111,7 +111,7 @@ GEM
111111
aws-sdk-kms (1.123.0)
112112
aws-sdk-core (~> 3, >= 3.244.0)
113113
aws-sigv4 (~> 1.5)
114-
aws-sdk-s3 (1.217.0)
114+
aws-sdk-s3 (1.219.0)
115115
aws-sdk-core (~> 3, >= 3.244.0)
116116
aws-sdk-kms (~> 1)
117117
aws-sigv4 (~> 1.5)
@@ -121,7 +121,7 @@ GEM
121121
rexml
122122
base64 (0.3.0)
123123
bcp47_spec (0.2.1)
124-
bcrypt (3.1.21)
124+
bcrypt (3.1.22)
125125
benchmark (0.5.0)
126126
better_errors (2.10.1)
127127
erubi (>= 1.0.0)
@@ -631,7 +631,7 @@ GEM
631631
activesupport (>= 3.0.0)
632632
raabro (1.4.0)
633633
racc (1.8.1)
634-
rack (3.2.5)
634+
rack (3.2.6)
635635
rack-attack (6.8.0)
636636
rack (>= 1.0, < 4)
637637
rack-cors (3.0.0)
@@ -650,7 +650,7 @@ GEM
650650
rack (>= 3.0.0, < 4)
651651
rack-proxy (0.7.7)
652652
rack
653-
rack-session (2.1.1)
653+
rack-session (2.1.2)
654654
base64 (>= 0.1.0)
655655
rack (>= 3.0.0)
656656
rack-test (2.2.0)

app/helpers/context_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module ContextHelper
4444
},
4545
quote_requests: { 'QuoteRequest' => 'https://w3id.org/fep/044f#QuoteRequest' },
4646
quotes: {
47-
'quote' => 'https://w3id.org/fep/044f#quote',
47+
'quote' => { '@id' => 'https://w3id.org/fep/044f#quote', '@type' => '@id' },
4848
'quoteUri' => 'http://fedibird.com/ns#quoteUri',
4949
'_misskey_quote' => 'https://misskey-hub.net/ns#_misskey_quote',
5050
'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
@@ -47,8 +47,10 @@ export function updateEmojiReactions(emoji_reaction) {
4747

4848
export function updateNotifications(notification, intlMessages, intlLocale) {
4949
return (dispatch, getState) => {
50-
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', notification.type], true);
51-
const playSound = getState().getIn(['settings', 'notifications', 'sounds', notification.type], true);
50+
const filterType = notification.type === 'quoted_update' ? 'update' : notification.type;
51+
52+
const showAlert = getState().getIn(['settings', 'notifications', 'alerts', filterType], true);
53+
const playSound = getState().getIn(['settings', 'notifications', 'sounds', filterType], true);
5254

5355
let filtered = false;
5456

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class User < ApplicationRecord
9797

9898
has_one :custom_css, inverse_of: :user, dependent: :destroy
9999

100-
validates :email, presence: true, email_address: true
100+
validates :email, presence: true, email_address: true, length: { maximum: 320 }
101101

102102
validates_with UserEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? }
103103
validates_with EmailMxValidator, if: :validate_email_dns?

app/policies/status_policy.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ def show_activity?
2626
following_author_domain?
2727
end
2828

29-
# This is about requesting a quote post, not validating it
3029
def quote?
31-
show? && record.quote_policy_for_account(current_account) != :denied
30+
show? && !blocking_author? && record.quote_policy_for_account(current_account) != :denied
3231
end
3332

3433
def reblog?

app/services/activitypub/process_account_service.rb

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

3434
with_redis_lock("process_account:#{@uri}") do
35-
@account = Account.remote.find_by(uri: @uri) if @options[:only_key]
36-
@account ||= Account.find_remote(@username, @domain)
35+
if @options[:only_key]
36+
# `only_key` is used to update an existing account known by its `uri`.
37+
# Lookup by handle and new account creation do not make sense in this case.
38+
@account = Account.remote.find_by(uri: @uri)
39+
return if @account.nil?
40+
else
41+
@account = Account.find_remote(@username, @domain)
42+
end
43+
3744
@old_public_key = @account&.public_key
3845
@old_protocol = @account&.protocol
3946
@old_searchability = @account&.searchability

app/validators/email_address_validator.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ def validate_each(record, attribute, value)
1111
value = value.strip
1212

1313
address = Mail::Address.new(value)
14-
record.errors.add(attribute, :invalid) if address.address != value
14+
record.errors.add(attribute, :invalid) if address.address != value || contains_disallowed_characters?(value)
1515
rescue Mail::Field::FieldError
1616
record.errors.add(attribute, :invalid)
1717
end
18+
19+
private
20+
21+
def contains_disallowed_characters?(value)
22+
value.include?('%') || value.include?(',') || value.include?('"')
23+
end
1824
end

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ services:
5959
web:
6060
# You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes
6161
build: .
62-
image: kmyblue:23.0
62+
image: kmyblue:23.1
6363
restart: always
6464
env_file: .env.production
6565
command: bundle exec puma -C config/puma.rb
@@ -83,7 +83,7 @@ services:
8383
build:
8484
dockerfile: ./streaming/Dockerfile
8585
context: .
86-
image: kmyblue-streaming:23.0
86+
image: kmyblue-streaming:23.1
8787
restart: always
8888
env_file: .env.production
8989
command: node ./streaming/index.js
@@ -101,7 +101,7 @@ services:
101101

102102
sidekiq:
103103
build: .
104-
image: kmyblue:23.0
104+
image: kmyblue:23.1
105105
restart: always
106106
env_file: .env.production
107107
command: bundle exec sidekiq

lib/mastodon/version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def kmyblue_major
1313
end
1414

1515
def kmyblue_minor
16-
0
16+
1
1717
end
1818

1919
def kmyblue_flag
@@ -35,7 +35,7 @@ def patch
3535
end
3636

3737
def default_prerelease
38-
'alpha.6'
38+
'alpha.7'
3939
end
4040

4141
def prerelease

lib/tasks/dev.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ namespace :dev do
441441
text: 'This post has a manual quote policy',
442442
account: remote_account,
443443
visibility: :public,
444-
quote_approval_policy: Status::QUOTE_APPROVAL_POLICY_FLAGS[:public]
444+
quote_approval_policy: InteractionPolicy::POLICY_FLAGS[:public]
445445
).find_or_create_by!(id: 10_000_030)
446446
end
447447
end

0 commit comments

Comments
 (0)