Skip to content

Commit

Permalink
disabled notifications on conversation part
Browse files Browse the repository at this point in the history
  • Loading branch information
michelson committed Feb 22, 2024
1 parent a161e18 commit b4176db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/models/app_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def self.ransackable_associations(auth_object = nil)
end
end

def disabled_notifications?
unsubscribed? || archived? || blocked?
end

def update_email(email)
app_user = app.get_app_user_by_email(email)
if app_user
Expand Down
3 changes: 2 additions & 1 deletion app/models/conversation_part.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ def send_constraints?

def email_send_disabled?
app = conversation.app
app.flagged || (app.plan.name == "free" && Chaskiq::Config.get("DISABLE_OUTGOING_EMAILS_FREE_PLAN"))
app.flagged || (app.plan.name == "free" && Chaskiq::Config.get("DISABLE_OUTGOING_EMAILS_FREE_PLAN")) ||
conversation&.main_participant&.disabled_notifications?
end

def is_from_auto_message_campaign?
Expand Down

0 comments on commit b4176db

Please sign in to comment.