mirror of
https://github.com/discourse/discourse.git
synced 2026-08-14 06:55:03 -05:00
FIX: Don't update posts_read_count when the post is from a PM. (#12131)
We don't want TL0 users doing the discobot tutorial to increase their read count.
This commit is contained in:
@@ -40,6 +40,8 @@ class PostTiming < ActiveRecord::Base
|
||||
# still happen, if it happens we just don't care, its an invalid record anyway
|
||||
return if row_count == 0
|
||||
Post.where(['topic_id = :topic_id and post_number = :post_number', args]).update_all 'reads = reads + 1'
|
||||
|
||||
return if Topic.exists?(id: args[:topic_id], archetype: Archetype.private_message)
|
||||
UserStat.where(user_id: args[:user_id]).update_all 'posts_read_count = posts_read_count + 1'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user