DEV: Use new core code API for topic view tracking (#173)
Brings this plugin into line with the changes at https://github.com/discourse/discourse/pull/27533, where we have split the topic view tracking into 2 controller functions.
This commit is contained in:
parent
11dcab8466
commit
0d9365571b
|
@ -1,3 +1,4 @@
|
|||
< 3.3.0.beta3-dev: 11dcab84669462b05eba3f1a59401727cafe8188
|
||||
< 3.3.0.beta1-dev: 94c7b7da216c66d773f800a714493f087affaac9
|
||||
3.1.999: a4b203274b88c5277d0b5b936de0bc0e0016726c
|
||||
2.8.0.beta9: 05678c451caf2ceb192501da91cf0d24ea44c8e8
|
||||
|
|
|
@ -54,9 +54,11 @@ module Docs
|
|||
|
||||
ip = request.remote_ip
|
||||
user_id = (current_user.id if current_user)
|
||||
track_visit = should_track_visit_to_topic?
|
||||
|
||||
TopicsController.defer_track_visit(topic.id, ip, user_id, track_visit)
|
||||
# TODO (martin) Change this to `defer_track_visit` once the core
|
||||
# method is renamed.
|
||||
TopicsController.defer_track_visit_v2(topic.id, user_id) if should_track_visit_to_topic?
|
||||
TopicsController.defer_topic_view(topic.id, ip, user_id)
|
||||
|
||||
TopicViewSerializer.new(topic_view, scope: guardian, root: false)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue