mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Mark all chat channels read with a shortcut (#20629)
This commit adds a keyboard shortcut (Shift+ESC) for chat which marks all of the chat channels that the user is currently a following member of as read, updating their `last_read_message_id`. This is done via a new service. It also includes some refactors and controller changes: * The old mark message read route from `ChatController` is now supplanted by the `Chat::Api::ReadsController#update` route. * The new controller can handle either marking a single or all messages read, and uses the correct service based on the route and params. * The `UpdateUserLastRead` service is now used (it wasn't before), and has been slightly updated to just use the guardian user ID.
This commit is contained in:
@ -6,6 +6,8 @@ Chat::Engine.routes.draw do
|
||||
get "/channels" => "channels#index"
|
||||
get "/channels/me" => "current_user_channels#index"
|
||||
post "/channels" => "channels#create"
|
||||
put "/channels/read/" => "reads#update_all"
|
||||
put "/channels/:channel_id/read/:message_id" => "reads#update"
|
||||
delete "/channels/:channel_id" => "channels#destroy"
|
||||
put "/channels/:channel_id" => "channels#update"
|
||||
get "/channels/:channel_id" => "channels#show"
|
||||
|
Reference in New Issue
Block a user