diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index bf50afe8c7..51ee8a071a 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: hadolint/hadolint-action@v3.0.0 + - uses: hadolint/hadolint-action@v3.1.0 - uses: docker/setup-qemu-action@v2 - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index ead69ded61..9a1ad4ffcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. - Add listing of followed hashtags ([connorshea](https://github.com/mastodon/mastodon/pull/21773)) - Add support for editing media description and focus point of already-sent posts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20878)) - Add follow request banner on account header ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20785)) -- Add confirmation screen when handling reports ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22375), [Gargron](https://github.com/mastodon/mastodon/pull/23156)) +- Add confirmation screen when handling reports ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22375), [Gargron](https://github.com/mastodon/mastodon/pull/23156), [tribela](https://github.com/mastodon/mastodon/pull/23178)) - Add option to make the landing page be `/about` even when trends are enabled ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20808)) - Add `noindex` setting back to the admin interface ([prplecake](https://github.com/mastodon/mastodon/pull/22205)) - Add instance peers API endpoint toggle back to the admin interface ([dariusk](https://github.com/mastodon/mastodon/pull/22810)) @@ -42,6 +42,7 @@ All notable changes to this project will be documented in this file. - Add left and right margins to emojis ([dsblank](https://github.com/mastodon/mastodon/pull/20464)) - Add `reading:autoplay:gifs` to `/api/v1/preferences` ([j-f1](https://github.com/mastodon/mastodon/pull/22706)) - Add `hide_collections` parameter to `/api/v1/accounts/credentials` ([CarlSchwan](https://github.com/mastodon/mastodon/pull/22790)) +- Add `policy` attribute to web push subscription objects in `/api/v1/push/subscriptions` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23210)) - Add more specific error messages to HTTP signature verification ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21617)) - Add Storj DCS to cloud object storage options in the `mastodon:setup` rake task ([jtolio](https://github.com/mastodon/mastodon/pull/21929)) - Add checkmark symbol in the checkbox for sensitive media ([sidp](https://github.com/mastodon/mastodon/pull/22795)) @@ -49,6 +50,7 @@ All notable changes to this project will be documented in this file. - Add missing accessibility attributes to “Hide image” button in `MediaGallery` ([hs4man21](https://github.com/mastodon/mastodon/pull/22513)) - Add missing accessibility attributes to hide content warning field when disabled ([hs4man21](https://github.com/mastodon/mastodon/pull/22568)) - Add `aria-hidden` to footer circle dividers to improve accessibility ([hs4man21](https://github.com/mastodon/mastodon/pull/22576)) +- Add `lang` attribute to compose form inputs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23240)) ### Changed @@ -66,6 +68,7 @@ All notable changes to this project will be documented in this file. - Change language surrounding disability in prompts for media descriptions ([hs4man21](https://github.com/mastodon/mastodon/pull/20923)) - Change confusing wording in the sign in banner ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22490)) - Change account moderation notes to make links clickable ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22553)) +- Change email address input to be read-only for logged-in users when requesting a new confirmation e-mail ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23247)) - Save avatar or header correctly even if the other one fails ([tribela](https://github.com/mastodon/mastodon/pull/18465)) - Change `referrer-policy` to `same-origin` application-wide ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23014), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/23037)) - Add 'private' to `Cache-Control`, match Rails expectations ([daxtens](https://github.com/mastodon/mastodon/pull/20608)) @@ -97,7 +100,6 @@ All notable changes to this project will be documented in this file. ### Removed - Officially remove support for Ruby 2.6 ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21477)) -- Remove LDSignature on actor Delete activities ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21466)) - Remove `object-fit` polyfill used for old versions of Microsoft Edge ([shuuji3](https://github.com/mastodon/mastodon/pull/22693)) - Remove empty `title` tag from mailer layout ([nametoolong](https://github.com/mastodon/mastodon/pull/23078)) @@ -107,8 +109,11 @@ All notable changes to this project will be documented in this file. - Fix suspension worker crashing on S3-compatible setups without ACL support ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22487)) - Fix possible race conditions when suspending/unsuspending accounts ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22363)) - Fix being stuck in edit mode when deleting the edited status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22126)) +- Fix filters not being applied to some notification types ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23211)) - Fix some performance issues with `/admin/instances` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21907)) - Fix some pre-4.0 admin audit logs ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22091)) +- Fix moderation audit log items for warnings having incorrect links ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23242)) +- Fix account activation being sometimes triggered before email confirmation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23245)) - Fix missing OAuth scopes for admin APIs ([trwnh](https://github.com/mastodon/mastodon/pull/20918), [trwnh](https://github.com/mastodon/mastodon/pull/20979)) - Fix voter count not being cleared when a poll is reset ([afontenot](https://github.com/mastodon/mastodon/pull/21700)) - Fix attachments of edited statuses not being fetched ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21565)) @@ -116,15 +121,19 @@ All notable changes to this project will be documented in this file. - Fix 500 error when marking posts as sensitive while some of them are deleted ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22134)) - Fix expanded statuses not always being scrolled into view ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21797)) - Fix not being able to scroll the remote interaction modal on small screens ([xendke](https://github.com/mastodon/mastodon/pull/21763)) +- Fix audio player volume control on Safari ([minacle](https://github.com/mastodon/mastodon/pull/23187)) - Fix disappearing “Explore” tabs on Safari ([nyura](https://github.com/mastodon/mastodon/pull/20917), [ykzts](https://github.com/mastodon/mastodon/pull/20982)) - Fix wrong padding in RTL layout ([Gargron](https://github.com/mastodon/mastodon/pull/23157)) +- Fix drag & drop upload area display in single-column mode ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23217)) - Fix being unable to get a single EmailDomainBlock from the admin API ([trwnh](https://github.com/mastodon/mastodon/pull/20846)) - Fix pagination of followed tags ([trwnh](https://github.com/mastodon/mastodon/pull/20861)) - Fix dropdown menu positions when scrolling ([sidp](https://github.com/mastodon/mastodon/pull/22916), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/23062)) +- Fix email with empty domain name labels passing validation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23246)) - Fix mysterious registration failure when “Require a reason to join” is set with open registrations ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22127)) - Fix attachment rendering of edited posts in OpenGraph ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/22270)) - Fix invalid/empty RSS feed link on account pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/20772)) - Fix error in `VerifyLinkService` when processing links with no href ([joshuap](https://github.com/mastodon/mastodon/pull/20741)) +- Fix error in `VerifyLinkService` when processing links with invalid URLs ([untitaker](https://github.com/mastodon/mastodon/pull/23204)) - Fix media uploads with FFmpeg 5 ([dead10ck](https://github.com/mastodon/mastodon/pull/21191)) - Fix sensitive flag not being set when replying to a post with a content warning under certain conditions ([kedamaDQ](https://github.com/mastodon/mastodon/pull/21724)) - Fix “Share @user's profile” profile menu item not working ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/21490)) diff --git a/Gemfile b/Gemfile index 1af346093a..dd3d59d2db 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'rack', '~> 2.2.6' gem 'hamlit-rails', '~> 0.2' gem 'pg', '~> 1.4' gem 'makara', '~> 0.5' -gem 'pghero', '~> 2.8' +gem 'pghero' gem 'dotenv-rails', '~> 2.8' gem 'aws-sdk-s3', '~> 1.117', require: false diff --git a/Gemfile.lock b/Gemfile.lock index accb3744cd..2160c15791 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -174,7 +174,7 @@ GEM cocoon (1.2.15) coderay (1.1.3) color_diff (0.1) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.0) connection_pool (2.3.0) cose (1.2.1) cbor (~> 0.5.9) @@ -470,8 +470,8 @@ GEM pastel (0.8.0) tty-color (~> 0.5) pg (1.4.5) - pghero (2.8.3) - activerecord (>= 5) + pghero (3.1.0) + activerecord (>= 6) pkg-config (1.5.1) posix-spawn (0.3.15) premailer (1.18.0) @@ -560,7 +560,7 @@ GEM redis (>= 4) redlock (1.3.2) redis (>= 3.0.0, < 6.0) - regexp_parser (2.6.1) + regexp_parser (2.6.2) request_store (1.5.1) rack (>= 1.4) responders (3.0.1) @@ -595,7 +595,7 @@ GEM rspec-support (3.11.1) rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) - rubocop (1.43.0) + rubocop (1.44.0) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) @@ -616,9 +616,9 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.18.0) + rubocop-rspec (2.18.1) rubocop (~> 1.33) - rubocop-capybara + rubocop-capybara (~> 2.17) ruby-progressbar (1.11.0) ruby-saml (1.13.0) nokogiri (>= 1.10.5) @@ -833,7 +833,7 @@ DEPENDENCIES ox (~> 2.14) parslet pg (~> 1.4) - pghero (~> 2.8) + pghero pkg-config (~> 1.5) posix-spawn premailer-rails diff --git a/app/helpers/admin/action_logs_helper.rb b/app/helpers/admin/action_logs_helper.rb index 215ecea0d7..4018ef6b1c 100644 --- a/app/helpers/admin/action_logs_helper.rb +++ b/app/helpers/admin/action_logs_helper.rb @@ -20,7 +20,7 @@ module Admin::ActionLogsHelper when 'Status' link_to log.human_identifier, log.permalink when 'AccountWarning' - link_to log.human_identifier, admin_account_path(log.target_id) + link_to log.human_identifier, disputes_strike_path(log.target_id) when 'Announcement' link_to truncate(log.human_identifier), edit_admin_announcement_path(log.target_id) when 'IpBlock', 'Instance', 'CustomEmoji' diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js index b40a2ff350..c7b0246523 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ b/app/javascript/flavours/glitch/components/autosuggest_input.js @@ -50,6 +50,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { id: PropTypes.string, searchTokens: PropTypes.arrayOf(PropTypes.string), maxLength: PropTypes.number, + lang: PropTypes.string, }; static defaultProps = { @@ -185,7 +186,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { } render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props; const { suggestionsHidden } = this.state; return ( @@ -210,6 +211,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { id={id} className={className} maxLength={maxLength} + lang={lang} /> diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js index 967c593af2..68c0834336 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js +++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js @@ -48,6 +48,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { onKeyDown: PropTypes.func, onPaste: PropTypes.func.isRequired, autoFocus: PropTypes.bool, + lang: PropTypes.string, }; static defaultProps = { @@ -192,7 +193,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { } render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; const { suggestionsHidden } = this.state; return [ @@ -216,6 +217,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { onPaste={this.onPaste} dir='auto' aria-autocomplete='list' + lang={lang} /> diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 014a0a213d..3a0d491009 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -59,7 +59,7 @@ class Audio extends React.PureComponent { duration: null, paused: true, muted: false, - volume: 0.5, + volume: 1, dragging: false, revealed: this.props.visible !== undefined ? this.props.visible : (displayMedia !== 'hide_all' && !this.props.sensitive || displayMedia === 'show_all'), }; @@ -80,8 +80,8 @@ class Audio extends React.PureComponent { _pack() { return { src: this.props.src, - volume: this.audio.volume, - muted: this.audio.muted, + volume: this.state.volume, + muted: this.state.muted, currentTime: this.audio.currentTime, poster: this.props.poster, backgroundColor: this.props.backgroundColor, @@ -117,7 +117,8 @@ class Audio extends React.PureComponent { this.audio = c; if (this.audio) { - this.setState({ volume: this.audio.volume, muted: this.audio.muted }); + this.audio.volume = 1; + this.audio.muted = false; } } @@ -208,7 +209,9 @@ class Audio extends React.PureComponent { const muted = !this.state.muted; this.setState({ muted }, () => { - this.audio.muted = muted; + if (this.gainNode) { + this.gainNode.gain.value = muted ? 0 : this.state.volume; + } }); } @@ -286,7 +289,9 @@ class Audio extends React.PureComponent { if(!isNaN(x)) { this.setState({ volume: x }, () => { - this.audio.volume = x; + if (this.gainNode) { + this.gainNode.gain.value = this.state.muted ? 0 : x; + } }); } }, 15); @@ -319,20 +324,12 @@ class Audio extends React.PureComponent { } handleLoadedData = () => { - const { autoPlay, currentTime, volume, muted } = this.props; + const { autoPlay, currentTime } = this.props; if (currentTime) { this.audio.currentTime = currentTime; } - if (volume !== undefined) { - this.audio.volume = volume; - } - - if (muted !== undefined) { - this.audio.muted = muted; - } - if (autoPlay) { this.togglePlay(); } @@ -342,11 +339,16 @@ class Audio extends React.PureComponent { const AudioContext = window.AudioContext || window.webkitAudioContext; const context = new AudioContext(); const source = context.createMediaElementSource(this.audio); + const gainNode = context.createGain(); + + gainNode.gain.value = this.state.muted ? 0 : this.state.volume; this.visualizer.setAudioContext(context, source); - source.connect(context.destination); + source.connect(gainNode); + gainNode.connect(context.destination); this.audioContext = context; + this.gainNode = gainNode; } handleDownload = () => { diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 0462c7c4b7..2b57cf15d8 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -61,6 +61,7 @@ class ComposeForm extends ImmutablePureComponent { anyMedia: PropTypes.bool, isInReply: PropTypes.bool, singleColumn: PropTypes.bool, + lang: PropTypes.string, advancedOptions: ImmutablePropTypes.map, layout: PropTypes.string, @@ -325,6 +326,7 @@ class ComposeForm extends ImmutablePureComponent { searchTokens={[':']} id='glitch.composer.spoiler.input' className='spoiler-input__input' + lang={this.props.lang} autoFocus={false} /> @@ -343,6 +345,7 @@ class ComposeForm extends ImmutablePureComponent { onSuggestionSelected={this.onSuggestionSelected} onPaste={onPaste} autoFocus={!showSearch && !isMobile(window.innerWidth, layout)} + lang={this.props.lang} > diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index d12c98c01d..8f2947672b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -70,6 +70,7 @@ function mapStateToProps (state) { mediaDescriptionConfirmation: state.getIn(['local_settings', 'confirm_missing_media_description']), preselectOnReply: state.getIn(['local_settings', 'preselect_on_reply']), isInReply: state.getIn(['compose', 'in_reply_to']) !== null, + lang: state.getIn(['compose', 'language']), }; }; diff --git a/app/javascript/flavours/glitch/features/notifications/components/notification.js b/app/javascript/flavours/glitch/features/notifications/components/notification.js index d676a4207c..d1aea1b21d 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notification.js +++ b/app/javascript/flavours/glitch/features/notifications/components/notification.js @@ -124,6 +124,7 @@ export default class Notification extends ImmutablePureComponent { onMoveDown={onMoveDown} onMoveUp={onMoveUp} onMention={onMention} + contextType='notifications' getScrollPosition={getScrollPosition} updateScrollBottom={updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} @@ -146,6 +147,7 @@ export default class Notification extends ImmutablePureComponent { onMoveDown={onMoveDown} onMoveUp={onMoveUp} onMention={onMention} + contextType='notifications' getScrollPosition={getScrollPosition} updateScrollBottom={updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} @@ -168,6 +170,7 @@ export default class Notification extends ImmutablePureComponent { onMoveDown={onMoveDown} onMoveUp={onMoveUp} onMention={onMention} + contextType='notifications' getScrollPosition={getScrollPosition} updateScrollBottom={updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} @@ -190,6 +193,7 @@ export default class Notification extends ImmutablePureComponent { onMoveDown={onMoveDown} onMoveUp={onMoveUp} onMention={onMention} + contextType='notifications' getScrollPosition={getScrollPosition} updateScrollBottom={updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} @@ -212,6 +216,7 @@ export default class Notification extends ImmutablePureComponent { onMoveDown={onMoveDown} onMoveUp={onMoveUp} onMention={onMention} + contextType='notifications' getScrollPosition={getScrollPosition} updateScrollBottom={updateScrollBottom} cachedMediaWidth={this.props.cachedMediaWidth} diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index d50316366b..d4c0d77c84 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -1585,14 +1585,14 @@ button.icon-button.active i.fa-retweet { align-items: center; background: rgba($base-overlay-background, 0.8); display: flex; - height: 100%; + height: 100vh; justify-content: center; left: 0; opacity: 0; - position: absolute; + position: fixed; top: 0; visibility: hidden; - width: 100%; + width: 100vw; z-index: 2000; * { diff --git a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss index c23a05c511..b97c6c5ad6 100644 --- a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss +++ b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss @@ -551,25 +551,6 @@ html { } } -.directory__tag.active > a, -.directory__tag.active > div { - border-color: $ui-highlight-color; - - &, - h4, - h4 small, - .fa, - .trends__item__current { - color: $white; - } - - &:hover, - &:active, - &:focus { - background: $ui-highlight-color; - } -} - .batch-table { &__toolbar, &__row, diff --git a/app/javascript/mastodon/components/autosuggest_input.js b/app/javascript/mastodon/components/autosuggest_input.js index 12d44b5d0b..b8f8c6f45f 100644 --- a/app/javascript/mastodon/components/autosuggest_input.js +++ b/app/javascript/mastodon/components/autosuggest_input.js @@ -50,6 +50,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { id: PropTypes.string, searchTokens: PropTypes.arrayOf(PropTypes.string), maxLength: PropTypes.number, + lang: PropTypes.string, }; static defaultProps = { @@ -185,7 +186,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { } render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props; const { suggestionsHidden } = this.state; return ( @@ -210,6 +211,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { id={id} className={className} maxLength={maxLength} + lang={lang} /> diff --git a/app/javascript/mastodon/components/autosuggest_textarea.js b/app/javascript/mastodon/components/autosuggest_textarea.js index 08b9cd80bb..b6c590916e 100644 --- a/app/javascript/mastodon/components/autosuggest_textarea.js +++ b/app/javascript/mastodon/components/autosuggest_textarea.js @@ -48,6 +48,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { onKeyDown: PropTypes.func, onPaste: PropTypes.func.isRequired, autoFocus: PropTypes.bool, + lang: PropTypes.string, }; static defaultProps = { @@ -192,7 +193,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { } render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, children } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; const { suggestionsHidden } = this.state; return [ @@ -216,6 +217,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { onPaste={this.onPaste} dir='auto' aria-autocomplete='list' + lang={lang} /> diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js index 00854d0e49..21a453d2cf 100644 --- a/app/javascript/mastodon/features/audio/index.js +++ b/app/javascript/mastodon/features/audio/index.js @@ -59,7 +59,7 @@ class Audio extends React.PureComponent { duration: null, paused: true, muted: false, - volume: 0.5, + volume: 1, dragging: false, revealed: this.props.visible !== undefined ? this.props.visible : (displayMedia !== 'hide_all' && !this.props.sensitive || displayMedia === 'show_all'), }; @@ -80,8 +80,8 @@ class Audio extends React.PureComponent { _pack() { return { src: this.props.src, - volume: this.audio.volume, - muted: this.audio.muted, + volume: this.state.volume, + muted: this.state.muted, currentTime: this.audio.currentTime, poster: this.props.poster, backgroundColor: this.props.backgroundColor, @@ -115,7 +115,8 @@ class Audio extends React.PureComponent { this.audio = c; if (this.audio) { - this.setState({ volume: this.audio.volume, muted: this.audio.muted }); + this.audio.volume = 1; + this.audio.muted = false; } } @@ -202,7 +203,9 @@ class Audio extends React.PureComponent { const muted = !this.state.muted; this.setState({ muted }, () => { - this.audio.muted = muted; + if (this.gainNode) { + this.gainNode.gain.value = muted ? 0 : this.state.volume; + } }); } @@ -280,7 +283,9 @@ class Audio extends React.PureComponent { if(!isNaN(x)) { this.setState({ volume: x }, () => { - this.audio.volume = x; + if (this.gainNode) { + this.gainNode.gain.value = this.state.muted ? 0 : x; + } }); } }, 15); @@ -313,20 +318,12 @@ class Audio extends React.PureComponent { } handleLoadedData = () => { - const { autoPlay, currentTime, volume, muted } = this.props; + const { autoPlay, currentTime } = this.props; if (currentTime) { this.audio.currentTime = currentTime; } - if (volume !== undefined) { - this.audio.volume = volume; - } - - if (muted !== undefined) { - this.audio.muted = muted; - } - if (autoPlay) { this.togglePlay(); } @@ -336,11 +333,16 @@ class Audio extends React.PureComponent { const AudioContext = window.AudioContext || window.webkitAudioContext; const context = new AudioContext(); const source = context.createMediaElementSource(this.audio); + const gainNode = context.createGain(); + + gainNode.gain.value = this.state.muted ? 0 : this.state.volume; this.visualizer.setAudioContext(context, source); - source.connect(context.destination); + source.connect(gainNode); + gainNode.connect(context.destination); this.audioContext = context; + this.gainNode = gainNode; } handleDownload = () => { diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index ebdd55d33e..91d21f12d4 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -65,6 +65,7 @@ class ComposeForm extends ImmutablePureComponent { anyMedia: PropTypes.bool, isInReply: PropTypes.bool, singleColumn: PropTypes.bool, + lang: PropTypes.string, }; static defaultProps = { @@ -241,6 +242,7 @@ class ComposeForm extends ImmutablePureComponent { searchTokens={[':']} id='cw-spoiler-input' className='spoiler-input__input' + lang={this.props.lang} /> @@ -258,6 +260,7 @@ class ComposeForm extends ImmutablePureComponent { onSuggestionSelected={this.onSuggestionSelected} onPaste={onPaste} autoFocus={autoFocus} + lang={this.props.lang} > diff --git a/app/javascript/mastodon/features/compose/containers/compose_form_container.js b/app/javascript/mastodon/features/compose/containers/compose_form_container.js index 14cf9230bc..2b76422376 100644 --- a/app/javascript/mastodon/features/compose/containers/compose_form_container.js +++ b/app/javascript/mastodon/features/compose/containers/compose_form_container.js @@ -26,6 +26,7 @@ const mapStateToProps = state => ({ isUploading: state.getIn(['compose', 'is_uploading']), anyMedia: state.getIn(['compose', 'media_attachments']).size > 0, isInReply: state.getIn(['compose', 'in_reply_to']) !== null, + lang: state.getIn(['compose', 'language']), }); const mapDispatchToProps = (dispatch) => ({ diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js index ea2c9c0a42..746d085c6e 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/mastodon/features/notifications/components/notification.js @@ -246,7 +246,11 @@ class Notification extends ImmutablePureComponent { } renderStatus (notification, link) { - const { intl, unread } = this.props; + const { intl, unread, status } = this.props; + + if (!status) { + return null; + } return ( @@ -264,6 +268,7 @@ class Notification extends ImmutablePureComponent {