Fix broken mute check in question worker

This commit is contained in:
Karina Kwiatek 2023-11-01 22:40:02 +01:00
parent 83ac156382
commit 1dd1c828eb
1 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ class QuestionWorker
question = Question.includes(:user).find(question_id) question = Question.includes(:user).find(question_id)
webpush_app = Rpush::App.find_by(name: "webpush") webpush_app = Rpush::App.find_by(name: "webpush")
return if skip_inbox?(follower, question, user) return if skip_inbox?(follower, question)
inbox = Inbox.create(user_id: follower.id, question_id:, new: true) inbox = Inbox.create(user_id: follower.id, question_id:, new: true)
follower.push_notification(webpush_app, inbox) if webpush_app follower.push_notification(webpush_app, inbox) if webpush_app
@ -20,11 +20,11 @@ class QuestionWorker
private private
def skip_inbox?(follower, question, user) def skip_inbox?(follower, question)
return true if follower.inbox_locked? return true if follower.inbox_locked?
return true if follower.banned? return true if follower.banned?
return true if muted?(follower, question) return true if muted?(follower, question)
return true if user.muting?(question.user) return true if follower.muting?(question.user)
return true if question.long? && !follower.profile.allow_long_questions return true if question.long? && !follower.profile.allow_long_questions
false false