diff --git a/app/models/topic.rb b/app/models/topic.rb index 6e9aef04456..09de70dcfd9 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -765,7 +765,8 @@ SQL group_id = group.id group.users.where( - "group_users.notification_level > ?", NotificationLevels.all[:muted] + "group_users.notification_level > ? AND user_id != ?", + NotificationLevels.all[:muted], user.id ).find_each do |u| u.notifications.create!( diff --git a/spec/models/topic_spec.rb b/spec/models/topic_spec.rb index 2952a9d9210..559013b1526 100644 --- a/spec/models/topic_spec.rb +++ b/spec/models/topic_spec.rb @@ -675,6 +675,7 @@ describe Topic do group.add(user) group.add(user_2) + group.add(topic.user) group.group_users.find_by(user: user_2).update!( notification_level: NotificationLevels.all[:muted]