mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: show status on mentions on just posted posts (#19639)
We show live user status on mentions starting from a76d864. But status didn’t appear on the post that appears on the bottom of the topic just after a user posted it (status appeared only after page reloading). This adds status to just posted posts.
This commit is contained in:
committed by
GitHub
parent
f7cfffa043
commit
5e844793d8
@@ -563,13 +563,14 @@ class PostSerializer < BasicPostSerializer
|
||||
|
||||
def mentioned_users
|
||||
if @topic_view && (mentions = @topic_view.mentions[object.id])
|
||||
return mentions
|
||||
.map { |username| @topic_view.mentioned_users[username] }
|
||||
.compact
|
||||
.map { |user| BasicUserWithStatusSerializer.new(user, root: false) }
|
||||
users = mentions
|
||||
.map { |username| @topic_view.mentioned_users[username] }
|
||||
.compact
|
||||
else
|
||||
users = User.where(username: object.mentions)
|
||||
end
|
||||
|
||||
[]
|
||||
users.map { |user| BasicUserWithStatusSerializer.new(user, root: false) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user