Skip to content

Commit f9afbd0

Browse files
mashirozxdependabot[bot]GargronClearlyClaireaquarla
authored
merge upstream & update theme (#234)
* Bump babel-jest from 26.3.0 to 26.5.2 (mastodon#14945) Bumps [babel-jest](https://github.com/facebook/jest/tree/HEAD/packages/babel-jest) from 26.3.0 to 26.5.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/commits/v26.5.2/packages/babel-jest) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump @github/webauthn-json from 0.5.5 to 0.5.6 (mastodon#14946) Bumps [@github/webauthn-json](https://github.com/github/webauthn-json) from 0.5.5 to 0.5.6. - [Release notes](https://github.com/github/webauthn-json/releases) - [Commits](github/webauthn-json@v0.5.5...v0.5.6) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump sass from 1.26.11 to 1.26.12 (mastodon#14947) Bumps [sass](https://github.com/sass/dart-sass) from 1.26.11 to 1.26.12. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](sass/dart-sass@1.26.11...1.26.12) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-react from 7.21.2 to 7.21.3 (mastodon#14950) Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.2 to 7.21.3. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](jsx-eslint/eslint-plugin-react@v7.21.2...v7.21.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump mini-css-extract-plugin from 0.11.0 to 0.11.3 (mastodon#14949) Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 0.11.0 to 0.11.3. - [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases) - [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md) - [Commits](webpack/mini-css-extract-plugin@v0.11.0...v0.11.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump jest from 26.4.2 to 26.5.2 (mastodon#14951) Bumps [jest](https://github.com/facebook/jest) from 26.4.2 to 26.5.2. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](jestjs/jest@v26.4.2...v26.5.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 7.6.0 to 7.10.0 (mastodon#14948) Bumps [eslint](https://github.com/eslint/eslint) from 7.6.0 to 7.10.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.6.0...v7.10.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update themes * Remove dependency on goldfinger gem (mastodon#14919) There are edge cases where requests to certain hosts timeout when using the vanilla HTTP.rb gem, which the goldfinger gem uses. Now that we no longer need to support OStatus servers, webfinger logic is so simple that there is no point encapsulating it in a gem, so we can just use our own Request class. With that, we benefit from more robust timeout code and IPv4/IPv6 resolution. Fix mastodon#14091 * Fix unread notification marker not updating when mounting column (mastodon#14954) * Fix issue checking for last unread notification when there are gaps (mastodon#14960) * add & fix themes * update theme * fix theme * fix theme * Add IP-based rules (mastodon#14963) * Fix browser notification permission request logic (mastodon#13543) * Add notification permission handling code * Request notification permission when enabling any notification setting * Add badge to notification settings when permissions insufficient * Disable alerts by default, requesting permission and enable them on onboarding * Add duration parameter to muting. (mastodon#13831) * Adding duration to muting. * Remove useless checks * helm: add optional cron job to run `tootctl remove media` (mastodon#14396) * Change how CDN_HOST is passed down to make assets build reproducible (mastodon#14381) * Change how CDN_HOST is passed down to make assets build reproducible * Change webpacker/webpack configuration to dynamically load publicPath based on meta header * Fix embedded layout missing the cdn-host meta header * Bump compression-webpack-plugin from 6.0.2 to 6.0.3 (mastodon#14979) Bumps [compression-webpack-plugin](https://github.com/webpack-contrib/compression-webpack-plugin) from 6.0.2 to 6.0.3. - [Release notes](https://github.com/webpack-contrib/compression-webpack-plugin/releases) - [Changelog](https://github.com/webpack-contrib/compression-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](webpack/compression-webpack-plugin@v6.0.2...v6.0.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump sass-loader from 10.0.2 to 10.0.3 (mastodon#14977) Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.0.2 to 10.0.3. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](webpack/sass-loader@v10.0.2...v10.0.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump imports-loader from 1.1.0 to 1.2.0 (mastodon#14976) Bumps [imports-loader](https://github.com/webpack-contrib/imports-loader) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/webpack-contrib/imports-loader/releases) - [Changelog](https://github.com/webpack-contrib/imports-loader/blob/master/CHANGELOG.md) - [Commits](webpack/imports-loader@v1.1.0...v1.2.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump tzinfo-data from 1.2020.1 to 1.2020.2 (mastodon#14966) Bumps [tzinfo-data](https://github.com/tzinfo/tzinfo-data) from 1.2020.1 to 1.2020.2. - [Release notes](https://github.com/tzinfo/tzinfo-data/releases) - [Commits](tzinfo/tzinfo-data@v1.2020.1...v1.2020.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rubocop from 0.92.0 to 0.93.0 (mastodon#14967) Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.92.0 to 0.93.0. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v0.92.0...v0.93.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump file-loader from 6.1.0 to 6.1.1 (mastodon#14974) Bumps [file-loader](https://github.com/webpack-contrib/file-loader) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/webpack-contrib/file-loader/releases) - [Changelog](https://github.com/webpack-contrib/file-loader/blob/master/CHANGELOG.md) - [Commits](webpack-contrib/file-loader@v6.1.0...v6.1.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint-plugin-react from 7.21.3 to 7.21.4 (mastodon#14968) Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.21.3 to 7.21.4. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](jsx-eslint/eslint-plugin-react@v7.21.3...v7.21.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump terser-webpack-plugin from 4.2.2 to 4.2.3 (mastodon#14971) Bumps [terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin) from 4.2.2 to 4.2.3. - [Release notes](https://github.com/webpack-contrib/terser-webpack-plugin/releases) - [Changelog](https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md) - [Commits](webpack/terser-webpack-plugin@v4.2.2...v4.2.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump eslint from 7.10.0 to 7.11.0 (mastodon#14975) Bumps [eslint](https://github.com/eslint/eslint) from 7.10.0 to 7.11.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.10.0...v7.11.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump sass from 1.26.12 to 1.27.0 (mastodon#14973) Bumps [sass](https://github.com/sass/dart-sass) from 1.26.12 to 1.27.0. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md) - [Commits](sass/dart-sass@1.26.12...1.27.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump jest from 26.5.2 to 26.5.3 (mastodon#14969) Bumps [jest](https://github.com/facebook/jest) from 26.5.2 to 26.5.3. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) - [Commits](jestjs/jest@v26.5.2...v26.5.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix a bear check when the activity object is nil (mastodon#14981) * Change how missing desktop notifications permission is displayed (mastodon#14985) Add missing controls for new notification type * Fix strings that could not be translated (mastodon#14980) * Fix translation string (mastodon#14986) * update theme Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eugen Rochko <eugen@zeonfederated.com> Co-authored-by: ThibG <thib@sitedethib.com> Co-authored-by: OSAMU SATO <satosamu@gmail.com> Co-authored-by: Alex Dunn <dunn.alex@gmail.com> Co-authored-by: Takeshi Umeda <noel.yoshiba@gmail.com> Co-authored-by: mayaeh <mayaeh@marimo-net.org>
1 parent 6c485bf commit f9afbd0

99 files changed

Lines changed: 1523 additions & 399 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ gem 'doorkeeper', '~> 5.4'
5454
gem 'ed25519', '~> 1.2'
5555
gem 'fast_blank', '~> 1.0'
5656
gem 'fastimage'
57-
gem 'goldfinger', '~> 2.1'
5857
gem 'hiredis', '~> 0.6'
5958
gem 'redis-namespace', '~> 1.8'
6059
gem 'health_check', git: 'https://github.com/ianheggie/health_check', ref: '0b799ead604f900ed50685e9b2d469cd2befba5b'
@@ -143,7 +142,7 @@ group :development do
143142
gem 'letter_opener', '~> 1.7'
144143
gem 'letter_opener_web', '~> 1.4'
145144
gem 'memory_profiler'
146-
gem 'rubocop', '~> 0.92', require: false
145+
gem 'rubocop', '~> 0.93', require: false
147146
gem 'rubocop-rails', '~> 2.8', require: false
148147
gem 'brakeman', '~> 4.10', require: false
149148
gem 'bundler-audit', '~> 0.7', require: false

Gemfile.lock

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ GEM
240240
ruby-progressbar (~> 1.4)
241241
globalid (0.4.2)
242242
activesupport (>= 4.2.0)
243-
goldfinger (2.1.1)
244-
addressable (~> 2.5)
245-
http (~> 4.0)
246-
nokogiri (~> 1.8)
247-
oj (~> 3.0)
248243
hamlit (2.13.0)
249244
temple (>= 0.8.2)
250245
thor
@@ -403,7 +398,7 @@ GEM
403398
parallel (1.19.2)
404399
parallel_tests (3.3.0)
405400
parallel
406-
parser (2.7.1.5)
401+
parser (2.7.2.0)
407402
ast (~> 2.4.1)
408403
parslet (2.0.0)
409404
pastel (0.8.0)
@@ -503,7 +498,7 @@ GEM
503498
redis-store (>= 1.2, < 2)
504499
redis-store (1.9.0)
505500
redis (>= 4, < 5)
506-
regexp_parser (1.8.1)
501+
regexp_parser (1.8.2)
507502
request_store (1.5.0)
508503
rack (>= 1.4)
509504
responders (3.0.1)
@@ -539,13 +534,13 @@ GEM
539534
rspec-support (3.9.3)
540535
rspec_junit_formatter (0.4.1)
541536
rspec-core (>= 2, < 4, != 2.12.0)
542-
rubocop (0.92.0)
537+
rubocop (0.93.0)
543538
parallel (~> 1.10)
544539
parser (>= 2.7.1.5)
545540
rainbow (>= 2.2.2, < 4.0)
546-
regexp_parser (>= 1.7)
541+
regexp_parser (>= 1.8)
547542
rexml
548-
rubocop-ast (>= 0.5.0)
543+
rubocop-ast (>= 0.6.0)
549544
ruby-progressbar (~> 1.7)
550545
unicode-display_width (>= 1.4.0, < 2.0)
551546
rubocop-ast (0.7.1)
@@ -640,7 +635,7 @@ GEM
640635
unf (~> 0.1.0)
641636
tzinfo (1.2.7)
642637
thread_safe (~> 0.1)
643-
tzinfo-data (1.2020.1)
638+
tzinfo-data (1.2020.2)
644639
tzinfo (>= 1.0.0)
645640
unf (0.1.4)
646641
unf_ext
@@ -722,7 +717,6 @@ DEPENDENCIES
722717
fog-core (<= 2.1.0)
723718
fog-openstack (~> 0.3)
724719
fuubar (~> 2.5)
725-
goldfinger (~> 2.1)
726720
hamlit-rails (~> 0.2)
727721
health_check!
728722
hiredis (~> 0.6)
@@ -787,7 +781,7 @@ DEPENDENCIES
787781
rspec-rails (~> 4.0)
788782
rspec-sidekiq (~> 3.1)
789783
rspec_junit_formatter (~> 0.4)
790-
rubocop (~> 0.92)
784+
rubocop (~> 0.93)
791785
rubocop-rails (~> 2.8)
792786
ruby-progressbar (~> 1.10)
793787
sanitize (~> 5.2)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# frozen_string_literal: true
2+
3+
module Admin
4+
class IpBlocksController < BaseController
5+
def index
6+
authorize :ip_block, :index?
7+
8+
@ip_blocks = IpBlock.page(params[:page])
9+
@form = Form::IpBlockBatch.new
10+
end
11+
12+
def new
13+
authorize :ip_block, :create?
14+
15+
@ip_block = IpBlock.new(ip: '', severity: :no_access, expires_in: 1.year)
16+
end
17+
18+
def create
19+
authorize :ip_block, :create?
20+
21+
@ip_block = IpBlock.new(resource_params)
22+
23+
if @ip_block.save
24+
log_action :create, @ip_block
25+
redirect_to admin_ip_blocks_path, notice: I18n.t('admin.ip_blocks.created_msg')
26+
else
27+
render :new
28+
end
29+
end
30+
31+
def batch
32+
@form = Form::IpBlockBatch.new(form_ip_block_batch_params.merge(current_account: current_account, action: action_from_button))
33+
@form.save
34+
rescue ActionController::ParameterMissing
35+
flash[:alert] = I18n.t('admin.ip_blocks.no_ip_block_selected')
36+
rescue Mastodon::NotPermittedError
37+
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
38+
ensure
39+
redirect_to admin_ip_blocks_path
40+
end
41+
42+
private
43+
44+
def resource_params
45+
params.require(:ip_block).permit(:ip, :severity, :comment, :expires_in)
46+
end
47+
48+
def action_from_button
49+
'delete' if params[:delete]
50+
end
51+
52+
def form_ip_block_batch_params
53+
params.require(:form_ip_block_batch).permit(ip_block_ids: [])
54+
end
55+
end
56+
end

app/controllers/api/v1/accounts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def show
2020
end
2121

2222
def create
23-
token = AppSignUpService.new.call(doorkeeper_token.application, account_params)
23+
token = AppSignUpService.new.call(doorkeeper_token.application, request.remote_ip, account_params)
2424
response = Doorkeeper::OAuth::TokenResponse.new(token)
2525

2626
headers.merge!(response.headers)
@@ -42,7 +42,7 @@ def block
4242
end
4343

4444
def mute
45-
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications))
45+
MuteService.new.call(current_user.account, @account, notifications: truthy_param?(:notifications), duration: (params[:duration] || 0))
4646
render json: @account, serializer: REST::RelationshipSerializer, relationships: relationships
4747
end
4848

app/controllers/api/v1/mutes_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Api::V1::MutesController < Api::BaseController
77

88
def index
99
@accounts = load_accounts
10-
render json: @accounts, each_serializer: REST::AccountSerializer
10+
render json: @accounts, each_serializer: REST::MutedAccountSerializer
1111
end
1212

1313
private

app/controllers/auth/registrations_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ def update_resource(resource, params)
4545
def build_resource(hash = nil)
4646
super(hash)
4747

48-
resource.locale = I18n.locale
49-
resource.invite_code = params[:invite_code] if resource.invite_code.blank?
50-
resource.current_sign_in_ip = request.remote_ip
48+
resource.locale = I18n.locale
49+
resource.invite_code = params[:invite_code] if resource.invite_code.blank?
50+
resource.sign_up_ip = request.remote_ip
5151

5252
resource.build_account if resource.account.nil?
5353
end

app/helpers/admin/action_logs_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ def linkable_log_target(record)
2929
link_to record.target_account.acct, admin_account_path(record.target_account_id)
3030
when 'Announcement'
3131
link_to truncate(record.text), edit_admin_announcement_path(record.id)
32+
when 'IpBlock'
33+
"#{record.ip}/#{record.ip.prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{record.severity}")})"
3234
end
3335
end
3436

@@ -48,6 +50,8 @@ def log_target_from_history(type, attributes)
4850
end
4951
when 'Announcement'
5052
truncate(attributes['text'].is_a?(Array) ? attributes['text'].last : attributes['text'])
53+
when 'IpBlock'
54+
"#{attributes['ip']}/#{attributes['ip'].prefix} (#{I18n.t("simple_form.labels.ip_block.severities.#{attributes['severity']}")})"
5155
end
5256
end
5357
end

app/helpers/webfinger_helper.rb

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
11
# frozen_string_literal: true
22

3-
# Monkey-patch on monkey-patch.
4-
# Because it conflicts with the request.rb patch.
5-
class HTTP::Timeout::PerOperationOriginal < HTTP::Timeout::PerOperation
6-
def connect(socket_class, host, port, nodelay = false)
7-
::Timeout.timeout(@connect_timeout, HTTP::TimeoutError) do
8-
@socket = socket_class.open(host, port)
9-
@socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) if nodelay
10-
end
11-
end
12-
end
13-
143
module WebfingerHelper
154
def webfinger!(uri)
16-
hidden_service_uri = /\.(onion|i2p)(:\d+)?$/.match(uri)
17-
18-
raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if !Rails.configuration.x.access_to_hidden_service && hidden_service_uri
19-
20-
opts = {
21-
ssl: !hidden_service_uri,
22-
23-
headers: {
24-
'User-Agent': Mastodon::Version.user_agent,
25-
},
26-
27-
timeout_class: HTTP::Timeout::PerOperationOriginal,
28-
29-
timeout_options: {
30-
write_timeout: 10,
31-
connect_timeout: 5,
32-
read_timeout: 10,
33-
},
34-
}
35-
36-
Goldfinger::Client.new(uri, opts.merge(Rails.configuration.x.http_client_proxy)).finger
5+
Webfinger.new(uri).perform
376
end
387
end

app/javascript/mastodon/actions/accounts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,11 @@ export function unblockAccountFail(error) {
257257
};
258258

259259

260-
export function muteAccount(id, notifications) {
260+
export function muteAccount(id, notifications, duration=0) {
261261
return (dispatch, getState) => {
262262
dispatch(muteAccountRequest(id));
263263

264-
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications }).then(response => {
264+
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => {
265265
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
266266
dispatch(muteAccountSuccess(response.data, getState().get('statuses')));
267267
}).catch(error => {

app/javascript/mastodon/actions/mutes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const MUTES_EXPAND_FAIL = 'MUTES_EXPAND_FAIL';
1313

1414
export const MUTES_INIT_MODAL = 'MUTES_INIT_MODAL';
1515
export const MUTES_TOGGLE_HIDE_NOTIFICATIONS = 'MUTES_TOGGLE_HIDE_NOTIFICATIONS';
16+
export const MUTES_CHANGE_DURATION = 'MUTES_CHANGE_DURATION';
1617

1718
export function fetchMutes() {
1819
return (dispatch, getState) => {
@@ -104,3 +105,12 @@ export function toggleHideNotifications() {
104105
dispatch({ type: MUTES_TOGGLE_HIDE_NOTIFICATIONS });
105106
};
106107
}
108+
109+
export function changeMuteDuration(duration) {
110+
return dispatch => {
111+
dispatch({
112+
type: MUTES_CHANGE_DURATION,
113+
duration,
114+
});
115+
};
116+
}

0 commit comments

Comments
 (0)