mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: set notification level when changing post owner (#5616)
FIX: do not notify last post editor if they mention themself
This commit is contained in:
committed by
Gerhard Schlager
parent
b602bab741
commit
3d99726981
@@ -47,7 +47,7 @@ class PostAlerter
|
||||
end
|
||||
|
||||
def after_save_post(post, new_record = false)
|
||||
notified = [post.user]
|
||||
notified = [post.user, post.last_editor].uniq
|
||||
|
||||
# mentions (users/groups)
|
||||
mentioned_groups, mentioned_users = extract_mentions(post)
|
||||
|
||||
@@ -23,6 +23,12 @@ class PostOwnerChanger
|
||||
post.set_owner(@new_owner, @acting_user, @skip_revision)
|
||||
PostAction.remove_act(@new_owner, post, PostActionType.types[:like])
|
||||
|
||||
if post.post_number == 1
|
||||
TopicUser.change(@new_owner.id, @topic.id, notification_level: NotificationLevels.topic_levels[:watching])
|
||||
else
|
||||
TopicUser.change(@new_owner.id, @topic.id, notification_level: NotificationLevels.topic_levels[:tracking])
|
||||
end
|
||||
|
||||
@topic.update_statistics
|
||||
|
||||
@new_owner.user_stat.update(
|
||||
|
||||
Reference in New Issue
Block a user