mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Create original message user thread membership (#21808)
When a thread is created / a new message is created in the thread, we want to make sure that the original message user has a membership for that thread, otherwise they will not receive unread indicators for messages in the thread.
This commit is contained in:
@ -233,6 +233,13 @@ module Chat
|
||||
return if resolved_thread.blank?
|
||||
resolved_thread.increment_replies_count_cache
|
||||
Chat::UserChatThreadMembership.find_or_create_by!(user: @user, thread: resolved_thread)
|
||||
|
||||
if resolved_thread.original_message_user != @user
|
||||
Chat::UserChatThreadMembership.find_or_create_by!(
|
||||
user: resolved_thread.original_message_user,
|
||||
thread: resolved_thread,
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user