mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Better thread reply counter cache (#21108)
This commit introduces a redis cache over the top of the thread replies_count DB cache, so that we can quickly and accurately increment/decrement the reply count for all users and not have to constantly update the database-level count. This is done so the UI can have a count that is displayed to the users on each thread indicator, that appears to live update on each chat message create/trash/recover inside the thread. This commit also introduces the `Chat::RestoreMessage` service and moves the restore endpoint into the `Api::ChannelMessages` controller as part of incremental migrations to move things out of ChatController. Finally, this commit refactors `Chat::Publisher` to be less repetitive with its `MessageBus` sending code.
This commit is contained in:
@ -30,6 +30,7 @@ Chat::Engine.routes.draw do
|
||||
|
||||
get "/channels/:channel_id/threads/:thread_id" => "channel_threads#show"
|
||||
|
||||
put "/channels/:channel_id/messages/:message_id/restore" => "channel_messages#restore"
|
||||
delete "/channels/:channel_id/messages/:message_id" => "channel_messages#destroy"
|
||||
end
|
||||
|
||||
@ -61,7 +62,6 @@ Chat::Engine.routes.draw do
|
||||
put "/:chat_channel_id/:message_id/rebake" => "chat#rebake"
|
||||
post "/:chat_channel_id/:message_id/flag" => "chat#flag"
|
||||
post "/:chat_channel_id/quote" => "chat#quote_messages"
|
||||
put "/:chat_channel_id/restore/:message_id" => "chat#restore"
|
||||
get "/lookup/:message_id" => "chat#lookup_message"
|
||||
put "/:chat_channel_id/read/:message_id" => "chat#update_user_last_read"
|
||||
put "/user_chat_enabled/:user_id" => "chat#set_user_chat_status"
|
||||
|
Reference in New Issue
Block a user