mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: the muted message should be sent after edit (#9593)
Recently, we added feature that we are sending `/muted` to users who muted specific topic just before `/latest` so the client knows to ignore those messages - https://github.com/discourse/discourse/pull/9482 Same `/muted` message should be included when the post is edited
This commit is contained in:
committed by
GitHub
parent
d615de9139
commit
37e93914fc
@@ -72,8 +72,8 @@ class TopicTrackingState
|
||||
"/unread/#{user_id}"
|
||||
end
|
||||
|
||||
def self.publish_muted(post)
|
||||
user_ids = post.topic.topic_users
|
||||
def self.publish_muted(topic)
|
||||
user_ids = topic.topic_users
|
||||
.where(notification_level: NotificationLevels.all[:muted])
|
||||
.joins(:user)
|
||||
.where("users.last_seen_at > ?", 7.days.ago)
|
||||
@@ -82,7 +82,7 @@ class TopicTrackingState
|
||||
.pluck(:user_id)
|
||||
return if user_ids.blank?
|
||||
message = {
|
||||
topic_id: post.topic_id,
|
||||
topic_id: topic.id,
|
||||
message_type: MUTED_MESSAGE_TYPE,
|
||||
}
|
||||
MessageBus.publish("/latest", message.as_json, user_ids: user_ids)
|
||||
|
||||
Reference in New Issue
Block a user