diff --git a/app/javascript/mastodon/components/poll.jsx b/app/javascript/mastodon/components/poll.jsx index dfc4034fa3..4304f9acd4 100644 --- a/app/javascript/mastodon/components/poll.jsx +++ b/app/javascript/mastodon/components/poll.jsx @@ -130,6 +130,10 @@ class Poll extends ImmutablePureComponent { this.props.refresh(); }; + handleReveal = () => { + this.setState({ revealed: true }); + } + renderOption (option, optionIndex, showResults) { const { poll, lang, disabled, intl } = this.props; const pollVotesCount = poll.get('voters_count') || poll.get('votes_count'); @@ -205,14 +209,14 @@ class Poll extends ImmutablePureComponent { render () { const { poll, intl } = this.props; - const { expired } = this.state; + const { revealed, expired } = this.state; if (!poll) { return null; } const timeRemaining = expired ? intl.formatMessage(messages.closed) : ; - const showResults = poll.get('voted') || expired; + const showResults = poll.get('voted') || revealed || expired; const disabled = this.props.disabled || Object.entries(this.state.selected).every(item => !item); let votesCount = null; @@ -231,9 +235,10 @@ class Poll extends ImmutablePureComponent {
{!showResults && } - {showResults && !this.props.disabled && · } + {!showResults && <> · } + {showResults && !this.props.disabled && <> · } {votesCount} - {poll.get('expires_at') && · {timeRemaining}} + {poll.get('expires_at') && <> · {timeRemaining}}
); diff --git a/app/javascript/mastodon/features/account/components/header.jsx b/app/javascript/mastodon/features/account/components/header.jsx index 3288fd73da..7ee801d800 100644 --- a/app/javascript/mastodon/features/account/components/header.jsx +++ b/app/javascript/mastodon/features/account/components/header.jsx @@ -482,6 +482,7 @@ class Header extends ImmutablePureComponent { {titleFromAccount(account)} + ); diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index ed1679be55..1fb32cb2e7 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -764,6 +764,7 @@ class Status extends ImmutablePureComponent { {titleFromStatus(intl, status)} + ); diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 94b7b3c9a3..c641a97707 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -498,6 +498,7 @@ "picture_in_picture.restore": "Put it back", "poll.closed": "Closed", "poll.refresh": "Refresh", + "poll.reveal": "See results", "poll.total_people": "{count, plural, one {# person} other {# people}}", "poll.total_votes": "{count, plural, one {# vote} other {# votes}}", "poll.vote": "Vote", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 65ca458a61..6723953b2a 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -1137,6 +1137,8 @@ body > [data-popper-placement] { } &--in-thread { + $thread-margin: 46px + 10px; + border-bottom: 0; .status__content, @@ -1148,8 +1150,12 @@ body > [data-popper-placement] { .attachment-list, .picture-in-picture-placeholder, .status-card { - margin-inline-start: 46px + 10px; - width: calc(100% - (46px + 10px)); + margin-inline-start: $thread-margin; + width: calc(100% - ($thread-margin)); + } + + .status__content__read-more-button { + margin-inline-start: $thread-margin; } } diff --git a/app/lib/scope_parser.rb b/app/lib/scope_parser.rb index d268688c83..45eb3c7b93 100644 --- a/app/lib/scope_parser.rb +++ b/app/lib/scope_parser.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true class ScopeParser < Parslet::Parser - rule(:term) { match('[a-z]').repeat(1).as(:term) } + rule(:term) { match('[a-z_]').repeat(1).as(:term) } rule(:colon) { str(':') } rule(:access) { (str('write') | str('read')).as(:access) } rule(:namespace) { str('admin').as(:namespace) } diff --git a/app/workers/account_deletion_worker.rb b/app/workers/account_deletion_worker.rb index fdf013e010..b501511728 100644 --- a/app/workers/account_deletion_worker.rb +++ b/app/workers/account_deletion_worker.rb @@ -6,9 +6,12 @@ class AccountDeletionWorker sidekiq_options queue: 'pull', lock: :until_executed def perform(account_id, options = {}) + account = Account.find(account_id) + return unless account.suspended? + reserve_username = options.with_indifferent_access.fetch(:reserve_username, true) skip_activitypub = options.with_indifferent_access.fetch(:skip_activitypub, false) - DeleteAccountService.new.call(Account.find(account_id), reserve_username: reserve_username, skip_activitypub: skip_activitypub, reserve_email: false) + DeleteAccountService.new.call(account, reserve_username: reserve_username, skip_activitypub: skip_activitypub, reserve_email: false) rescue ActiveRecord::RecordNotFound true end diff --git a/db/migrate/20230702151753_add_index_user_on_unconfirmed_email.rb b/db/migrate/20230702151753_add_index_user_on_unconfirmed_email.rb new file mode 100644 index 0000000000..a935463eaa --- /dev/null +++ b/db/migrate/20230702151753_add_index_user_on_unconfirmed_email.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddIndexUserOnUnconfirmedEmail < ActiveRecord::Migration[6.1] + disable_ddl_transaction! + + def change + add_index :users, :unconfirmed_email, where: 'unconfirmed_email IS NOT NULL', algorithm: :concurrently + end +end