Skip to content

Commit

Permalink
Merge branch 'neatchee:main' into newmain
Browse files Browse the repository at this point in the history
  • Loading branch information
moyitpro committed Sep 21, 2023
2 parents 5a39112 + fb2a846 commit ef7b928
Show file tree
Hide file tree
Showing 24 changed files with 1,116 additions and 918 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -63,3 +63,8 @@ yarn-debug.log

# Ignore Docker option files
docker-compose.override.yml

# Ignore some local files for Urusai
import_emoji.rb
log.txt
public.old/
1,654 changes: 889 additions & 765 deletions AUTHORS.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions CHANGELOG.md
Expand Up @@ -27,7 +27,7 @@ The following changelog entries focus on changes visible to users, administrator
- Add `ONE_CLICK_SSO_LOGIN` environment variable to directly link to the Single-Sign On provider if there is only one sign up method available ([CSDUMMI](https://github.com/mastodon/mastodon/pull/26083), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26368), [CSDUMMI](https://github.com/mastodon/mastodon/pull/26857), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26901))
- **Add webhook templating** ([Gargron](https://github.com/mastodon/mastodon/pull/23289))
- **Add webhooks for local `status.created`, `status.updated`, `account.updated` and `report.updated`** ([VyrCossont](https://github.com/mastodon/mastodon/pull/24133), [VyrCossont](https://github.com/mastodon/mastodon/pull/24243), [VyrCossont](https://github.com/mastodon/mastodon/pull/24211))
- **Add exclusive lists** ([dariusk](https://github.com/mastodon/mastodon/pull/22048), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25324))
- **Add exclusive lists** ([dariusk, necropolina](https://github.com/mastodon/mastodon/pull/22048), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25324))
- **Add a confirmation screen when suspending a domain** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25144), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25603))
- **Add support for importing lists** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25203), [mgmn](https://github.com/mastodon/mastodon/pull/26120), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26372))
- **Add optional hCaptcha support** ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25019), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25057), [Gargron](https://github.com/mastodon/mastodon/pull/25395), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/26388))
Expand Down Expand Up @@ -306,8 +306,8 @@ The following changelog entries focus on changes visible to users, administrator

### Security

- Fix missing HTML sanitization in translation API (CVE-2023-42452)
- Fix incorrect domain name normalization (CVE-2023-42451)
- Fix missing HTML sanitization in translation API (CVE-2023-42452, [GHSA-2693-xr3m-jhqr](https://github.com/mastodon/mastodon/security/advisories/GHSA-2693-xr3m-jhqr))
- Fix incorrect domain name normalization (CVE-2023-42451, [GHSA-v3xf-c9qf-j667](https://github.com/mastodon/mastodon/security/advisories/GHSA-v3xf-c9qf-j667))

## [4.1.7] - 2023-09-05

Expand Down
76 changes: 37 additions & 39 deletions app/javascript/flavours/glitch/features/explore/results.jsx
Expand Up @@ -156,45 +156,43 @@ class Results extends PureComponent {

let filteredResults;

if (!isLoading) {
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());

switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}

{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}

{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());

switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}

{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}

{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}

return (
Expand Down
76 changes: 37 additions & 39 deletions app/javascript/mastodon/features/explore/results.jsx
Expand Up @@ -156,45 +156,43 @@ class Results extends PureComponent {

let filteredResults;

if (!isLoading) {
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());

switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}

{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}

{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}
const accounts = results.get('accounts', ImmutableList());
const hashtags = results.get('hashtags', ImmutableList());
const statuses = results.get('statuses', ImmutableList());

switch(type) {
case 'all':
filteredResults = (accounts.size + hashtags.size + statuses.size) > 0 ? (
<>
{accounts.size > 0 && (
<SearchSection key='accounts' title={<><Icon id='users' fixedWidth /><FormattedMessage id='search_results.accounts' defaultMessage='Profiles' /></>} onClickMore={this.handleLoadMoreAccounts}>
{accounts.take(INITIAL_DISPLAY).map(id => <Account key={id} id={id} />)}
</SearchSection>
)}

{hashtags.size > 0 && (
<SearchSection key='hashtags' title={<><Icon id='hashtag' fixedWidth /><FormattedMessage id='search_results.hashtags' defaultMessage='Hashtags' /></>} onClickMore={this.handleLoadMoreHashtags}>
{hashtags.take(INITIAL_DISPLAY).map(hashtag => <Hashtag key={hashtag.get('name')} hashtag={hashtag} />)}
</SearchSection>
)}

{statuses.size > 0 && (
<SearchSection key='statuses' title={<><Icon id='quote-right' fixedWidth /><FormattedMessage id='search_results.statuses' defaultMessage='Posts' /></>} onClickMore={this.handleLoadMoreStatuses}>
{statuses.take(INITIAL_DISPLAY).map(id => <Status key={id} id={id} />)}
</SearchSection>
)}
</>
) : [];
break;
case 'accounts':
filteredResults = renderAccounts(accounts);
break;
case 'hashtags':
filteredResults = renderHashtags(hashtags);
break;
case 'statuses':
filteredResults = renderStatuses(statuses);
break;
}

return (
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/be.json
Expand Up @@ -414,6 +414,7 @@
"navigation_bar.lists": "Спісы",
"navigation_bar.logout": "Выйсці",
"navigation_bar.mutes": "Ігнараваныя карыстальнікі",
"navigation_bar.opened_in_classic_interface": "Допісы, уліковыя запісы і іншыя спецыфічныя старонкі па змоўчанні адчыняюцца ў класічным вэб-інтэрфейсе.",
"navigation_bar.personal": "Асабістае",
"navigation_bar.pins": "Замацаваныя допісы",
"navigation_bar.preferences": "Параметры",
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/mastodon/locales/de.json
Expand Up @@ -169,7 +169,7 @@
"confirmations.delete.confirm": "Löschen",
"confirmations.delete.message": "Möchtest du diesen Beitrag wirklich löschen?",
"confirmations.delete_list.confirm": "Löschen",
"confirmations.delete_list.message": "Möchtest du diese Liste endgültig löschen?",
"confirmations.delete_list.message": "Möchtest du diese Liste für immer löschen?",
"confirmations.discard_edit_media.confirm": "Verwerfen",
"confirmations.discard_edit_media.message": "Du hast Änderungen an der Medienbeschreibung oder -vorschau vorgenommen, die noch nicht gespeichert sind. Trotzdem verwerfen?",
"confirmations.domain_block.confirm": "Domain blockieren",
Expand Down Expand Up @@ -434,7 +434,7 @@
"notification.status": "{name} hat gerade etwas gepostet",
"notification.update": "{name} bearbeitete einen Beitrag",
"notifications.clear": "Benachrichtigungen löschen",
"notifications.clear_confirmation": "Möchtest du diese Benachrichtigung für immer löschen?",
"notifications.clear_confirmation": "Möchtest du wirklich alle Benachrichtigungen für immer löschen?",
"notifications.column_settings.admin.report": "Neue Meldungen:",
"notifications.column_settings.admin.sign_up": "Neue Registrierungen:",
"notifications.column_settings.alert": "Desktop-Benachrichtigungen",
Expand Down
6 changes: 3 additions & 3 deletions app/javascript/mastodon/locales/ko.json
Expand Up @@ -308,11 +308,11 @@
"home.column_settings.show_reblogs": "부스트 표시",
"home.column_settings.show_replies": "답글 표시",
"home.explore_prompt.body": "홈 피드에는 내가 팔로우한 해시태그 그리고 팔로우한 사람과 부스트가 함께 나타나요. 너무 고요하게 느껴진다면, 다음 것들을 살펴볼 수 있어요:",
"home.explore_prompt.title": "여기가 Mastodon 이용의 본거지예요.",
"home.explore_prompt.title": "이곳은 마스토돈의 내 본거지입니다.",
"home.hide_announcements": "공지사항 숨기기",
"home.pending_critical_update.body": "가능한 한 빨리 마스토돈 서버를 업데이트 하세요!",
"home.pending_critical_update.body": "서둘러 마스토돈 서버를 업데이트 하세요!",
"home.pending_critical_update.link": "업데이트 보기",
"home.pending_critical_update.title": "긴급한 보안 업데이트가 있습니다!",
"home.pending_critical_update.title": "긴급 보안 업데이트가 있어요!",
"home.show_announcements": "공지사항 보기",
"interaction_modal.description.favourite": "마스토돈 계정을 통해, 게시물을 좋아하는 것으로 작성자에게 호의를 표하고 나중에 보기 위해 저장할 수 있습니다.",
"interaction_modal.description.follow": "마스토돈 계정을 통해, {name} 님을 팔로우 하고 그의 게시물을 홈 피드에서 받아 볼 수 있습니다.",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/locales/nl.json
@@ -1,5 +1,5 @@
{
"about.blocks": "Beperkte en opgeschorte servers",
"about.blocks": "Gelimiteerde en opgeschorte servers",
"about.contact": "Contact:",
"about.disclaimer": "Mastodon is vrije, opensourcesoftware en een handelsmerk van Mastodon gGmbH.",
"about.domain_blocks.no_reason_available": "Reden niet beschikbaar",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/locales/vi.json
Expand Up @@ -136,7 +136,7 @@
"compose.language.change": "Chọn ngôn ngữ tút",
"compose.language.search": "Tìm ngôn ngữ...",
"compose.published.body": "Đã đăng.",
"compose.published.open": "Mở",
"compose.published.open": "Xem lại",
"compose.saved.body": "Đã lưu tút.",
"compose_form.direct_message_warning_learn_more": "Tìm hiểu thêm",
"compose_form.encryption_warning": "Các tút trên Mastodon không được mã hóa đầu cuối. Không chia sẻ bất kỳ thông tin nhạy cảm nào qua Mastodon.",
Expand Down
3 changes: 3 additions & 0 deletions app/serializers/rest/credential_account_serializer.rb
Expand Up @@ -15,6 +15,9 @@ def source
note: object.note,
fields: object.fields.map(&:to_h),
follow_requests_count: FollowRequest.where(target_account: object).limit(40).count,
hide_collections: object.hide_collections,
discoverable: object.discoverable,
indexable: object.indexable,
}
end

Expand Down
34 changes: 16 additions & 18 deletions config/initializers/paperclip.rb
Expand Up @@ -91,28 +91,26 @@
# Some S3-compatible providers might not actually be compatible with some APIs
# used by kt-paperclip, see https://github.com/mastodon/mastodon/issues/16822
# and https://github.com/mastodon/mastodon/issues/26394
if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true' || ENV['S3_DISABLE_CHECKSUM_MODE'] == 'true'
module Paperclip
module Storage
module S3Extensions
def copy_to_local_file(style, local_dest_path)
log("copying #{path(style)} to local file #{local_dest_path}")

options = {}
options[:mode] = 'single_request' if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
options[:checksum_mode] = 'DISABLED' if ENV['S3_DISABLE_CHECKSUM_MODE'] == 'true'

s3_object(style).download_file(local_dest_path, options)
rescue Aws::Errors::ServiceError => e
warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}")
false
end
module Paperclip
module Storage
module S3Extensions
def copy_to_local_file(style, local_dest_path)
log("copying #{path(style)} to local file #{local_dest_path}")

options = {}
options[:mode] = 'single_request' if ENV['S3_FORCE_SINGLE_REQUEST'] == 'true'
options[:checksum_mode] = 'DISABLED' unless ENV['S3_ENABLE_CHECKSUM_MODE'] == 'true'

s3_object(style).download_file(local_dest_path, options)
rescue Aws::Errors::ServiceError => e
warn("#{e} - cannot copy #{path(style)} to local file #{local_dest_path}")
false
end
end
end

Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions)
end

Paperclip::Storage::S3.prepend(Paperclip::Storage::S3Extensions)
elsif ENV['SWIFT_ENABLED'] == 'true'
require 'fog/openstack'

Expand Down

0 comments on commit ef7b928

Please sign in to comment.