mirror of
https://github.com/discourse/discourse.git
synced 2025-02-23 03:39:39 +08:00

* Revert "Revert "FEATURE: Publish read state on group messages. (#7989) [Undo revert] (#8024)"" This reverts commit 36425eb9f04cfac7201632d648050cb43a035bc1. * Fix: Show who read only if the attribute is enabled * PERF: Precalculate the last post readed by a group member * Use book-reader icon instear of far-eye * FIX: update topic groups correctly * DEV: Tidy up read indicator update on write
43 lines
804 B
Ruby
43 lines
804 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_dependency 'pinned_check'
|
|
|
|
class WebHookTopicViewSerializer < TopicViewSerializer
|
|
attributes :created_by,
|
|
:last_poster
|
|
|
|
%i{
|
|
post_stream
|
|
timeline_lookup
|
|
pm_with_non_human_user
|
|
draft
|
|
draft_key
|
|
draft_sequence
|
|
message_bus_last_id
|
|
suggested_topics
|
|
has_summary
|
|
actions_summary
|
|
current_post_number
|
|
chunk_size
|
|
topic_timer
|
|
private_topic_timer
|
|
details
|
|
}.each do |attr|
|
|
define_method("include_#{attr}?") do
|
|
false
|
|
end
|
|
end
|
|
|
|
def include_show_read_indicator?
|
|
false
|
|
end
|
|
|
|
def created_by
|
|
BasicUserSerializer.new(object.topic.user, scope: scope, root: false)
|
|
end
|
|
|
|
def last_poster
|
|
BasicUserSerializer.new(object.topic.last_poster, scope: scope, root: false)
|
|
end
|
|
end
|