Skip to content

Commit

Permalink
ensure that default volume preferences apply to new polls
Browse files Browse the repository at this point in the history
  • Loading branch information
robguthrie committed Jun 15, 2024
1 parent 4648253 commit 03d214d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/services/poll_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ def self.create_stances(poll:, actor:, user_ids: [], emails: [], audience: nil,
volumes = {}
group_member_ids = (poll.group || NullGroup.new).member_ids

# if the user has chosen to mute the thread or group then mute the poll too, but dont subsribe
if poll.discussion_id
DiscussionReader.active.where(
discussion_id: poll.discussion_id,
user_id: users.pluck(:id),
volume: 1
).find_each do |dr|
volumes[dr.user_id] = dr.volume
end
Expand All @@ -157,7 +155,6 @@ def self.create_stances(poll:, actor:, user_ids: [], emails: [], audience: nil,
Membership.active.where(
group_id: poll.group_id,
user_id: users.pluck(:id),
volume: 1
).find_each do |m|
volumes[m.user_id] = m.volume unless volumes.has_key? m.user_id
end
Expand Down

0 comments on commit 03d214d

Please sign in to comment.