diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-10-22 17:34:29 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-10-22 17:34:29 -0500 |
commit | adf60e63806a4b8f843ce6722a9086044f0bb5cd (patch) | |
tree | 722969bdb867727a65aeb78bfdab4fa5f60248a5 /app/services/mute_service.rb | |
parent | c36dd229f9dcb1d77c46d8db23297fc5781b4a97 (diff) | |
parent | 36e5c9d45be0e94216b5b92ea8749a00bb68e0e3 (diff) |
Merge remote-tracking branch 'upstream/master' into merge-glitch
Diffstat (limited to 'app/services/mute_service.rb')
-rw-r--r-- | app/services/mute_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/mute_service.rb b/app/services/mute_service.rb index 1a3f4981f..67df92f5c 100644 --- a/app/services/mute_service.rb +++ b/app/services/mute_service.rb @@ -1,10 +1,10 @@ # frozen_string_literal: true class MuteService < BaseService - def call(account, target_account, notifications: nil, timelines_only: nil) + def call(account, target_account, notifications: nil, timelines_only: nil, duration: 0) return if account.id == target_account.id - mute = account.mute!(target_account, notifications: notifications, timelines_only: timelines_only) + mute = account.mute!(target_account, notifications: notifications, timelines_only: timelines_only, duration: duration) if mute.hide_notifications? BlockWorker.perform_async(account.id, target_account.id) @@ -12,6 +12,8 @@ class MuteService < BaseService MuteWorker.perform_async(account.id, target_account.id) end + DeleteMuteWorker.perform_at(duration.seconds, mute.id) if duration != 0 + mute end end |