Skip to content

Commit

Permalink
fix(forum-post-anonymous): do not create course-activity for anonymou…
Browse files Browse the repository at this point in the history
…s topic creator
  • Loading branch information
phungmanhcuong authored and cysjonathan committed Oct 8, 2024
1 parent c5dae21 commit 40686b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/notifiers/course/forum/topic_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ def topic_created(user, course_user, topic)
return unless email_enabled.regular || email_enabled.phantom

activity = create_activity(actor: user, object: topic, event: :created)
activity.notify(course, :feed) unless course_user.phantom?
activity.notify(course, :feed) if course_user && !course_user.phantom? &&
!topic.posts.first.is_anonymous

topic.forum.subscriptions.includes(:user).each do |subscription|
course_user = course.course_users.find_by(user: subscription.user)
Expand Down

0 comments on commit 40686b5

Please sign in to comment.