FEATURE: Publish read state on group messages. (Originally introduced in #7989) (#8025)

* 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
This commit is contained in:
Roman Rizzi
2019-08-27 09:09:00 -03:00
committed by GitHub
parent f2331ef07f
commit 7c741fa0d6
42 changed files with 688 additions and 21 deletions

View File

@ -1020,6 +1020,24 @@ describe TopicQuery do
expect(topics).to eq([])
end
context "Calculating minimum unread count for a topic" do
before { group.update!(publish_read_state: true) }
let(:listed_message) do
TopicQuery.new(nil, group_name: group.name)
.list_private_messages_group(creator)
.topics.first
end
it 'returns the last read post number' do
topic_group = TopicGroup.create!(
topic: group_message, group: group, last_read_post_number: 10
)
expect(listed_message.last_read_post_number).to eq(topic_group.last_read_post_number)
end
end
end
context "shared drafts" do